• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2021 Igalia S.L.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more
13  */
14 
15 #ifndef __GST_SOUP_LOADER_H__
16 #define __GST_SOUP_LOADER_H__
17 
18 #ifdef STATIC_SOUP
19 #include <libsoup/soup.h>
20 #else
21 #include "stub/soup.h"
22 #endif
23 
24 #include <gst/gst.h>
25 #include <gio/gio.h>
26 
27 G_BEGIN_DECLS
28 
29 gboolean gst_soup_load_library (void);
30 guint gst_soup_loader_get_api_version (void);
31 
32 SoupSession *_soup_session_new_with_options (const char *optname1, ...) G_GNUC_NULL_TERMINATED;
33 
34 SoupLogger *_soup_logger_new (SoupLoggerLogLevel);
35 
36 void _soup_logger_set_printer (SoupLogger *logger, SoupLoggerPrinter printer,
37                                gpointer printer_data, GDestroyNotify destroy);
38 
39 void _soup_session_add_feature (SoupSession *session,
40                                 SoupSessionFeature *feature);
41 void _soup_session_add_feature_by_type (SoupSession *session, GType feature_type);
42 
43 typedef struct _GstSoupUri {
44 #if (defined(STATIC_SOUP) && STATIC_SOUP == 3) || (!defined(STATIC_SOUP) && GLIB_CHECK_VERSION(2, 66, 0))
45   GUri *uri;
46 #endif
47 #if (defined(STATIC_SOUP) && STATIC_SOUP == 2) || !defined(STATIC_SOUP)
48   SoupURI *soup_uri;
49 #endif
50 } GstSoupUri;
51 
52 GstSoupUri *gst_soup_uri_new (const char *uri_string);
53 void gst_soup_uri_free (GstSoupUri *uri);
54 char *gst_soup_uri_to_string (GstSoupUri *uri);
55 
56 char *gst_soup_message_uri_to_string (SoupMessage* msg);
57 
58 guint _soup_get_major_version (void);
59 guint _soup_get_minor_version (void);
60 guint _soup_get_micro_version (void);
61 
62 void _soup_message_set_request_body_from_bytes (SoupMessage *msg,
63                                                 const char *content_type,
64                                                 GBytes *bytes);
65 
66 GType _soup_session_get_type (void);
67 GType _soup_logger_log_level_get_type (void);
68 GType _soup_content_decoder_get_type (void);
69 GType _soup_cookie_jar_get_type (void);
70 
71 void _soup_session_abort (SoupSession * session);
72 SoupMessage *_soup_message_new (const char *method, const char *uri_string);
73 SoupMessageHeaders *_soup_message_get_request_headers (SoupMessage *msg);
74 SoupMessageHeaders *_soup_message_get_response_headers (SoupMessage *msg);
75 
76 void _soup_message_headers_remove (SoupMessageHeaders *hdrs, const char *name);
77 void _soup_message_headers_append (SoupMessageHeaders *hdrs, const char *name,
78                                    const char *value);
79 void _soup_message_set_flags (SoupMessage *msg, SoupMessageFlags flags);
80 
81 void _soup_message_headers_foreach (SoupMessageHeaders *hdrs,
82                                     SoupMessageHeadersForeachFunc func,
83                                     gpointer user_data);
84 
85 SoupEncoding _soup_message_headers_get_encoding (SoupMessageHeaders *hdrs);
86 
87 goffset _soup_message_headers_get_content_length (SoupMessageHeaders *hdrs);
88 
89 SoupStatus _soup_message_get_status (SoupMessage *msg);
90 const char *_soup_message_get_reason_phrase (SoupMessage *msg);
91 
92 const char *_soup_message_headers_get_one (SoupMessageHeaders *hdrs,
93                                            const char *name);
94 void _soup_message_disable_feature (SoupMessage *msg, GType feature_type);
95 
96 const char *_soup_message_headers_get_content_type (SoupMessageHeaders *hdrs,
97                                                     GHashTable **params);
98 
99 void _soup_auth_authenticate (SoupAuth *auth, const char *username,
100                               const char *password);
101 
102 const char *_soup_message_get_method (SoupMessage *msg);
103 
104 void _soup_session_send_async (SoupSession *session,
105                                SoupMessage *msg,
106                                GCancellable *cancellable,
107                                GAsyncReadyCallback callback,
108                                gpointer user_data);
109 
110 GInputStream *_soup_session_send_finish (SoupSession *session,
111                                          GAsyncResult *result, GError **error);
112 
113 GInputStream *_soup_session_send (SoupSession *session, SoupMessage *msg,
114                                   GCancellable *cancellable,
115                                   GError **error) G_GNUC_WARN_UNUSED_RESULT;
116 
117 void gst_soup_session_cancel_message (SoupSession *session, SoupMessage *msg, GCancellable *cancellable);
118 
119 G_END_DECLS
120 
121 #endif /* __GST_SOUP_LOADER_H__ */
122