mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
soup: Reintroduce compile-time libsoup dependency for static builds
On Android (especially) and for static builds in general it is safer to link against libsoup and have the dynamic custom loading disabled. For those cases we can safely assume the application will use either libsoup2 or libsoup3 and not both. Fixes #939 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1536>
This commit is contained in:
parent
a44a1bf193
commit
0b6df00606
5 changed files with 227 additions and 2 deletions
|
@ -33,10 +33,12 @@ plugin_init (GstPlugin * plugin)
|
|||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_soup_debug, "soup", 0, "soup");
|
||||
|
||||
#ifndef STATIC_SOUP
|
||||
if (!gst_soup_load_library ()) {
|
||||
GST_WARNING ("Failed to load libsoup library");
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret |= GST_ELEMENT_REGISTER (souphttpsrc, plugin);
|
||||
ret |= GST_ELEMENT_REGISTER (souphttpclientsink, plugin);
|
||||
|
|
|
@ -280,6 +280,9 @@ gst_soup_load_library (void)
|
|||
guint
|
||||
gst_soup_loader_get_api_version (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return STATIC_SOUP;
|
||||
#endif
|
||||
return gst_soup_vtable.lib_version;
|
||||
}
|
||||
|
||||
|
@ -300,34 +303,57 @@ _soup_session_new_with_options (const char *optname1, ...)
|
|||
SoupLogger *
|
||||
_soup_logger_new (SoupLoggerLogLevel level)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return soup_logger_new (level, -1);
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_logger_new (level);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 2) {
|
||||
g_assert (gst_soup_vtable._soup_logger_new_2 != NULL);
|
||||
return gst_soup_vtable._soup_logger_new_2 (level, -1);
|
||||
}
|
||||
g_assert (gst_soup_vtable._soup_logger_new_3 != NULL);
|
||||
return gst_soup_vtable._soup_logger_new_3 (level);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_logger_set_printer (SoupLogger * logger, SoupLoggerPrinter printer,
|
||||
gpointer printer_data, GDestroyNotify destroy)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_logger_set_printer (logger, printer, printer_data, destroy);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_logger_set_printer != NULL);
|
||||
gst_soup_vtable._soup_logger_set_printer (logger, printer, printer_data,
|
||||
destroy);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_session_add_feature (SoupSession * session, SoupSessionFeature * feature)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_session_add_feature (session, feature);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_add_feature != NULL);
|
||||
gst_soup_vtable._soup_session_add_feature (session, feature);
|
||||
#endif
|
||||
}
|
||||
|
||||
GstSoupUri *
|
||||
gst_soup_uri_new (const char *uri_string)
|
||||
{
|
||||
GstSoupUri *uri = g_new0 (GstSoupUri, 1);
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
uri->soup_uri = soup_uri_new (uri_string);
|
||||
#else
|
||||
uri->uri = g_uri_parse (uri_string, SOUP_HTTP_URI_FLAGS, NULL);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 2) {
|
||||
g_assert (gst_soup_vtable._soup_uri_new_2 != NULL);
|
||||
uri->soup_uri = gst_soup_vtable._soup_uri_new_2 (uri_string);
|
||||
|
@ -336,6 +362,7 @@ gst_soup_uri_new (const char *uri_string)
|
|||
uri->uri = g_uri_parse (uri_string, SOUP_HTTP_URI_FLAGS, NULL);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
@ -348,8 +375,12 @@ gst_soup_uri_free (GstSoupUri * uri)
|
|||
}
|
||||
#endif
|
||||
if (uri->soup_uri) {
|
||||
#if defined(STATIC_SOUP) && STATIC_SOUP == 2
|
||||
soup_uri_free (uri->soup_uri);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_uri_free_2 != NULL);
|
||||
gst_soup_vtable._soup_uri_free_2 (uri->soup_uri);
|
||||
#endif
|
||||
}
|
||||
g_free (uri);
|
||||
}
|
||||
|
@ -363,8 +394,12 @@ gst_soup_uri_to_string (GstSoupUri * uri)
|
|||
}
|
||||
#endif
|
||||
if (uri->soup_uri) {
|
||||
#if defined(STATIC_SOUP) && STATIC_SOUP == 2
|
||||
return soup_uri_to_string (uri->soup_uri, FALSE);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_uri_to_string_2 != NULL);
|
||||
return gst_soup_vtable._soup_uri_to_string_2 (uri->soup_uri, FALSE);
|
||||
#endif
|
||||
}
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
|
@ -373,6 +408,17 @@ gst_soup_uri_to_string (GstSoupUri * uri)
|
|||
char *
|
||||
gst_soup_message_uri_to_string (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
SoupURI *uri = NULL;
|
||||
uri = soup_message_get_uri (msg);
|
||||
return soup_uri_to_string (uri, FALSE);
|
||||
#elif STATIC_SOUP == 3
|
||||
GUri *uri = NULL;
|
||||
uri = soup_message_get_uri (msg);
|
||||
return g_uri_to_string_partial (uri, G_URI_HIDE_PASSWORD);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 2) {
|
||||
SoupURI *uri = NULL;
|
||||
g_assert (gst_soup_vtable._soup_message_get_uri_2 != NULL);
|
||||
|
@ -386,6 +432,7 @@ gst_soup_message_uri_to_string (SoupMessage * msg)
|
|||
return g_uri_to_string_partial (uri, G_URI_HIDE_PASSWORD);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* If we reach this, it means the plugin was built for old glib, but somehow
|
||||
* we managed to load libsoup3, which requires a very recent glib. As this
|
||||
|
@ -398,28 +445,49 @@ gst_soup_message_uri_to_string (SoupMessage * msg)
|
|||
guint
|
||||
_soup_get_major_version (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_get_major_version ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_get_major_version != NULL);
|
||||
return gst_soup_vtable._soup_get_major_version ();
|
||||
#endif
|
||||
}
|
||||
|
||||
guint
|
||||
_soup_get_minor_version (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_get_minor_version ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_get_minor_version != NULL);
|
||||
return gst_soup_vtable._soup_get_minor_version ();
|
||||
#endif
|
||||
}
|
||||
|
||||
guint
|
||||
_soup_get_micro_version (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_get_micro_version ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_get_micro_version != NULL);
|
||||
return gst_soup_vtable._soup_get_micro_version ();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_set_request_body_from_bytes (SoupMessage * msg,
|
||||
const char *content_type, GBytes * bytes)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
gsize size;
|
||||
gconstpointer data = g_bytes_get_data (bytes, &size);
|
||||
soup_message_body_append (msg->request_body, SOUP_MEMORY_COPY, data, size);
|
||||
#elif STATIC_SOUP == 3
|
||||
soup_message_set_request_body_from_bytes (msg, content_type, bytes);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_set_request_body_from_bytes_3 !=
|
||||
NULL);
|
||||
|
@ -433,53 +501,85 @@ _soup_message_set_request_body_from_bytes (SoupMessage * msg,
|
|||
gst_soup_vtable._soup_message_body_append_2 (msg2->request_body,
|
||||
SOUP_MEMORY_COPY, data, size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
GType
|
||||
_soup_session_get_type (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_session_get_type ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_get_type != NULL);
|
||||
return gst_soup_vtable._soup_session_get_type ();
|
||||
#endif
|
||||
}
|
||||
|
||||
GType
|
||||
_soup_logger_log_level_get_type (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_logger_log_level_get_type ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_logger_log_level_get_type != NULL);
|
||||
return gst_soup_vtable._soup_logger_log_level_get_type ();
|
||||
#endif
|
||||
}
|
||||
|
||||
GType
|
||||
_soup_content_decoder_get_type (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_content_decoder_get_type ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_content_decoder_get_type != NULL);
|
||||
return gst_soup_vtable._soup_content_decoder_get_type ();
|
||||
#endif
|
||||
}
|
||||
|
||||
GType
|
||||
_soup_cookie_jar_get_type (void)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_cookie_jar_get_type ();
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_cookie_jar_get_type != NULL);
|
||||
return gst_soup_vtable._soup_cookie_jar_get_type ();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_session_abort (SoupSession * session)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_session_abort (session);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_abort != NULL);
|
||||
gst_soup_vtable._soup_session_abort (session);
|
||||
#endif
|
||||
}
|
||||
|
||||
SoupMessage *
|
||||
_soup_message_new (const char *method, const char *uri_string)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_message_new (method, uri_string);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_new != NULL);
|
||||
return gst_soup_vtable._soup_message_new (method, uri_string);
|
||||
#endif
|
||||
}
|
||||
|
||||
SoupMessageHeaders *
|
||||
_soup_message_get_request_headers (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return msg->request_headers;
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_message_get_request_headers (msg);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_get_request_headers_3 != NULL);
|
||||
return gst_soup_vtable._soup_message_get_request_headers_3 (msg);
|
||||
|
@ -487,11 +587,19 @@ _soup_message_get_request_headers (SoupMessage * msg)
|
|||
SoupMessage2 *msg2 = (SoupMessage2 *) msg;
|
||||
return msg2->request_headers;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SoupMessageHeaders *
|
||||
_soup_message_get_response_headers (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return msg->response_headers;
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_message_get_response_headers (msg);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_get_response_headers_3 != NULL);
|
||||
return gst_soup_vtable._soup_message_get_response_headers_3 (msg);
|
||||
|
@ -499,62 +607,98 @@ _soup_message_get_response_headers (SoupMessage * msg)
|
|||
SoupMessage2 *msg2 = (SoupMessage2 *) msg;
|
||||
return msg2->response_headers;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_headers_remove (SoupMessageHeaders * hdrs, const char *name)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_message_headers_remove (hdrs, name);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_remove != NULL);
|
||||
gst_soup_vtable._soup_message_headers_remove (hdrs, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_headers_append (SoupMessageHeaders * hdrs, const char *name,
|
||||
const char *value)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_message_headers_append (hdrs, name, value);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_append != NULL);
|
||||
gst_soup_vtable._soup_message_headers_append (hdrs, name, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_set_flags (SoupMessage * msg, SoupMessageFlags flags)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_message_set_flags (msg, flags);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_set_flags != NULL);
|
||||
gst_soup_vtable._soup_message_set_flags (msg, flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_session_add_feature_by_type (SoupSession * session, GType feature_type)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_session_add_feature_by_type (session, feature_type);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_add_feature_by_type != NULL);
|
||||
gst_soup_vtable._soup_session_add_feature_by_type (session, feature_type);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_headers_foreach (SoupMessageHeaders * hdrs,
|
||||
SoupMessageHeadersForeachFunc func, gpointer user_data)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_message_headers_foreach (hdrs, func, user_data);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_foreach != NULL);
|
||||
gst_soup_vtable._soup_message_headers_foreach (hdrs, func, user_data);
|
||||
#endif
|
||||
}
|
||||
|
||||
SoupEncoding
|
||||
_soup_message_headers_get_encoding (SoupMessageHeaders * hdrs)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_message_headers_get_encoding (hdrs);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_get_encoding != NULL);
|
||||
return gst_soup_vtable._soup_message_headers_get_encoding (hdrs);
|
||||
#endif
|
||||
}
|
||||
|
||||
goffset
|
||||
_soup_message_headers_get_content_length (SoupMessageHeaders * hdrs)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_message_headers_get_content_length (hdrs);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_get_content_length != NULL);
|
||||
return gst_soup_vtable._soup_message_headers_get_content_length (hdrs);
|
||||
#endif
|
||||
}
|
||||
|
||||
SoupStatus
|
||||
_soup_message_get_status (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return msg->status_code;
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_message_get_status (msg);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_get_status_3 != NULL);
|
||||
return gst_soup_vtable._soup_message_get_status_3 (msg);
|
||||
|
@ -562,11 +706,19 @@ _soup_message_get_status (SoupMessage * msg)
|
|||
SoupMessage2 *msg2 = (SoupMessage2 *) msg;
|
||||
return msg2->status_code;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
_soup_message_get_reason_phrase (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return msg->reason_phrase;
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_message_get_reason_phrase (msg);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_get_reason_phrase_3 != NULL);
|
||||
return gst_soup_vtable._soup_message_get_reason_phrase_3 (msg);
|
||||
|
@ -574,41 +726,65 @@ _soup_message_get_reason_phrase (SoupMessage * msg)
|
|||
SoupMessage2 *msg2 = (SoupMessage2 *) msg;
|
||||
return msg2->reason_phrase;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
_soup_message_headers_get_one (SoupMessageHeaders * hdrs, const char *name)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_message_headers_get_one (hdrs, name);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_get_one != NULL);
|
||||
return gst_soup_vtable._soup_message_headers_get_one (hdrs, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_message_disable_feature (SoupMessage * msg, GType feature_type)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_message_disable_feature (msg, feature_type);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_disable_feature != NULL);
|
||||
gst_soup_vtable._soup_message_disable_feature (msg, feature_type);
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
_soup_message_headers_get_content_type (SoupMessageHeaders * hdrs,
|
||||
GHashTable ** params)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_message_headers_get_content_type (hdrs, params);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_message_headers_get_content_type != NULL);
|
||||
return gst_soup_vtable._soup_message_headers_get_content_type (hdrs, params);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_soup_auth_authenticate (SoupAuth * auth, const char *username,
|
||||
const char *password)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
soup_auth_authenticate (auth, username, password);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_auth_authenticate != NULL);
|
||||
gst_soup_vtable._soup_auth_authenticate (auth, username, password);
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
_soup_message_get_method (SoupMessage * msg)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 2
|
||||
return msg->method;
|
||||
#elif STATIC_SOUP == 3
|
||||
return soup_message_get_method (msg);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_assert (gst_soup_vtable._soup_message_get_method_3 != NULL);
|
||||
return gst_soup_vtable._soup_message_get_method_3 (msg);
|
||||
|
@ -616,28 +792,44 @@ _soup_message_get_method (SoupMessage * msg)
|
|||
SoupMessage2 *msg2 = (SoupMessage2 *) msg;
|
||||
return msg2->method;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
GInputStream *
|
||||
_soup_session_send_finish (SoupSession * session,
|
||||
GAsyncResult * result, GError ** error)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_session_send_finish (session, result, error);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_send_finish != NULL);
|
||||
return gst_soup_vtable._soup_session_send_finish (session, result, error);
|
||||
#endif
|
||||
}
|
||||
|
||||
GInputStream *
|
||||
_soup_session_send (SoupSession * session, SoupMessage * msg,
|
||||
GCancellable * cancellable, GError ** error)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
return soup_session_send (session, msg, cancellable, error);
|
||||
#else
|
||||
g_assert (gst_soup_vtable._soup_session_send != NULL);
|
||||
return gst_soup_vtable._soup_session_send (session, msg, cancellable, error);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
gst_soup_session_cancel_message (SoupSession * session, SoupMessage * msg,
|
||||
GCancellable * cancellable)
|
||||
{
|
||||
#ifdef STATIC_SOUP
|
||||
#if STATIC_SOUP == 3
|
||||
g_cancellable_cancel (cancellable);
|
||||
#else
|
||||
soup_session_cancel_message (session, msg, SOUP_STATUS_CANCELLED);
|
||||
#endif
|
||||
#else
|
||||
if (gst_soup_vtable.lib_version == 3) {
|
||||
g_cancellable_cancel (cancellable);
|
||||
} else {
|
||||
|
@ -645,4 +837,5 @@ gst_soup_session_cancel_message (SoupSession * session, SoupMessage * msg,
|
|||
gst_soup_vtable._soup_session_cancel_message_2 (session, msg,
|
||||
SOUP_STATUS_CANCELLED);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -15,7 +15,12 @@
|
|||
#ifndef __GST_SOUP_LOADER_H__
|
||||
#define __GST_SOUP_LOADER_H__
|
||||
|
||||
#ifdef STATIC_SOUP
|
||||
#include <libsoup/soup.h>
|
||||
#else
|
||||
#include "stub/soup.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
|
|
@ -21,7 +21,11 @@
|
|||
#include <glib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#ifdef STATIC_SOUP
|
||||
#include <libsoup/soup.h>
|
||||
#else
|
||||
#include "stub/soup.h"
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -17,12 +17,33 @@ gobject_dep = dependency('gobject-2.0', fallback: ['glib', 'libgobject_dep'])
|
|||
|
||||
libdl_dep = cc.find_library('dl', required: false)
|
||||
|
||||
extra_args = []
|
||||
extra_deps = []
|
||||
if get_option('default_library') == 'static'
|
||||
libsoup2_dep = dependency('libsoup-2.4', version : '>=2.48',
|
||||
required : false, fallback : ['libsoup', 'libsoup_dep'],
|
||||
default_options: ['sysprof=disabled'])
|
||||
libsoup3_dep = dependency('libsoup-3.0', required : false,
|
||||
fallback : ['libsoup3', 'libsoup_dep'])
|
||||
if not libsoup2_dep.found() and not libsoup3_dep.found()
|
||||
error('Either libsoup2 or libsoup3 is needed')
|
||||
subdir_done()
|
||||
endif
|
||||
if libsoup3_dep.found()
|
||||
extra_deps += libsoup3_dep
|
||||
extra_args += '-DSTATIC_SOUP=3'
|
||||
elif libsoup2_dep.found()
|
||||
extra_deps += libsoup2_dep
|
||||
extra_args += '-DSTATIC_SOUP=2'
|
||||
endif
|
||||
endif
|
||||
|
||||
gstsouphttpsrc = library('gstsoup',
|
||||
soup_sources,
|
||||
c_args : gst_plugins_good_args,
|
||||
c_args : gst_plugins_good_args + extra_args,
|
||||
link_args : noseh_link_args,
|
||||
include_directories : [configinc, libsinc],
|
||||
dependencies : [gst_dep, gstbase_dep, gsttag_dep, gmodule_dep, gobject_dep, gio_dep, libdl_dep],
|
||||
dependencies : [gst_dep, gstbase_dep, gsttag_dep, gmodule_dep, gobject_dep, gio_dep, libdl_dep] + extra_deps,
|
||||
install : true,
|
||||
install_dir : plugins_install_dir,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue