Commit 21f0e461 authored by Olivier Crête's avatar Olivier Crête
Browse files

Error out on state change failure

parent c19641e1
......@@ -139,13 +139,15 @@ webrtc_client_connected_cb (MssHttpServer *server, MssClientId client_id,
gchar *name;
GstElement *webrtcbin;
GstCaps *caps;
GstStateChangeReturn ret;
name = g_strdup_printf ("webrtcbin_%p", client_id);
webrtcbin = gst_element_factory_make ("webrtcbin", name);
g_object_set_data (G_OBJECT (webrtcbin), "client_id", client_id);
gst_bin_add (pipeline, webrtcbin);
gst_element_sync_state_with_parent (webrtcbin);
ret = gst_element_set_state (webrtcbin, GST_STATE_PLAYING);
g_assert (ret != GST_STATE_CHANGE_FAILURE);
g_signal_connect (webrtcbin, "on-ice-candidate",
G_CALLBACK (webrtc_on_ice_candidate_cb), NULL);
......@@ -245,6 +247,7 @@ int main (int argc, char *argv[])
GstElement *pipeline;
GError *error = NULL;
GstBus *bus;
GstStateChangeReturn ret;
option_context = g_option_context_new (NULL);
g_option_context_add_main_entries (option_context, options, NULL);
......@@ -301,7 +304,8 @@ int main (int argc, char *argv[])
srt_uri,
rist_addresses);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_assert (ret != GST_STATE_CHANGE_FAILURE);
g_signal_connect (http_server, "ws-client-connected",
G_CALLBACK (webrtc_client_connected_cb), pipeline);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment