examples: webrtc: Update Android example to libsoup 3.0

Cerbero 1.26 no longer ships 2.4, this wasn't ported earlier because the examples aren't built in CI.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7861>
This commit is contained in:
L. E. Segovia 2024-11-09 21:47:52 -03:00 committed by GStreamer Marge Bot
parent 44cb3025ff
commit da0e6c62ac
2 changed files with 12 additions and 10 deletions

View file

@ -39,7 +39,7 @@ GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE_CUSTOM) $(GSTREAMER_PLUGIN
$(GSTREAMER_PLUGINS_SYS) \ $(GSTREAMER_PLUGINS_SYS) \
$(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_PLAYBACK)
GSTREAMER_EXTRA_DEPS := gstreamer-webrtc-1.0 gstreamer-sdp-1.0 gstreamer-video-1.0 libsoup-2.4 json-glib-1.0 glib-2.0 GSTREAMER_EXTRA_DEPS := gstreamer-webrtc-1.0 gstreamer-sdp-1.0 gstreamer-video-1.0 libsoup-3.0 json-glib-1.0 glib-2.0
GSTREAMER_EXTRA_LIBS := -liconv GSTREAMER_EXTRA_LIBS := -liconv
G_IO_MODULES = openssl G_IO_MODULES = openssl

View file

@ -288,9 +288,10 @@ send_sdp_offer (WebRTC * webrtc, GstWebRTCSessionDescription * offer)
/* Offer created by our pipeline, to be sent to the peer */ /* Offer created by our pipeline, to be sent to the peer */
static void static void
on_offer_created (GstPromise * promise, WebRTC * webrtc) on_offer_created (GstPromise * promise, gpointer user_data)
{ {
GstWebRTCSessionDescription *offer = NULL; GstWebRTCSessionDescription *offer = NULL;
WebRTC *webrtc = (WebRTC *) user_data;
const GstStructure *reply; const GstStructure *reply;
g_assert (webrtc->app_state == PEER_CALL_NEGOTIATING); g_assert (webrtc->app_state == PEER_CALL_NEGOTIATING);
@ -681,18 +682,18 @@ connect_to_websocket_server_async (WebRTC * webrtc)
SoupLogger *logger; SoupLogger *logger;
SoupMessage *message; SoupMessage *message;
SoupSession *session; SoupSession *session;
const char *https_aliases[] = { "wss", NULL };
const gchar *ca_certs; const gchar *ca_certs;
GTlsDatabase *db;
ca_certs = g_getenv ("CA_CERTIFICATES"); ca_certs = g_getenv ("CA_CERTIFICATES");
g_assert (ca_certs != NULL); g_assert (ca_certs != NULL);
g_print ("ca-certificates %s", ca_certs); g_print ("ca-certificates %s", ca_certs);
session = soup_session_new_with_options (SOUP_SESSION_SSL_STRICT, FALSE, session = soup_session_new_with_options (NULL);
// SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE, db = g_tls_file_database_new (ca_certs, NULL);
SOUP_SESSION_SSL_CA_FILE, ca_certs, if (db)
SOUP_SESSION_HTTPS_ALIASES, https_aliases, NULL); soup_session_set_tls_database (session, db);
logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1); logger = soup_logger_new (SOUP_LOGGER_LOG_BODY);
soup_session_add_feature (session, SOUP_SESSION_FEATURE (logger)); soup_session_add_feature (session, SOUP_SESSION_FEATURE (logger));
g_object_unref (logger); g_object_unref (logger);
@ -701,8 +702,9 @@ connect_to_websocket_server_async (WebRTC * webrtc)
g_print ("Connecting to server...\n"); g_print ("Connecting to server...\n");
/* Once connected, we will register */ /* Once connected, we will register */
soup_session_websocket_connect_async (session, message, NULL, NULL, NULL, soup_session_websocket_connect_async (session, message, NULL, NULL,
(GAsyncReadyCallback) on_server_connected, webrtc); G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) on_server_connected,
webrtc);
webrtc->app_state = SERVER_CONNECTING; webrtc->app_state = SERVER_CONNECTING;
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;