Commit 633c1db1 authored by Olivier Crête's avatar Olivier Crête

Connect signals before starting pipeline

parent 96e94296
...@@ -276,7 +276,6 @@ int main (int argc, char *argv[]) ...@@ -276,7 +276,6 @@ int main (int argc, char *argv[])
gst_init (&argc, &argv); gst_init (&argc, &argv);
pipeline = gst_parse_launch (pipeline_str, &error); pipeline = gst_parse_launch (pipeline_str, &error);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_assert_no_error (error); g_assert_no_error (error);
g_free (pipeline_str); g_free (pipeline_str);
...@@ -284,8 +283,6 @@ int main (int argc, char *argv[]) ...@@ -284,8 +283,6 @@ int main (int argc, char *argv[])
gst_bus_add_watch (bus, gst_bus_cb, NULL); gst_bus_add_watch (bus, gst_bus_cb, NULL);
gst_object_unref (bus); gst_object_unref (bus);
g_signal_connect (http_server, "ws-client-connected",
G_CALLBACK (webrtc_client_connected_cb), pipeline);
g_signal_connect (http_server, "ws-client-disconnected", g_signal_connect (http_server, "ws-client-disconnected",
G_CALLBACK (webrtc_client_disconnected_cb), pipeline); G_CALLBACK (webrtc_client_disconnected_cb), pipeline);
g_signal_connect (http_server, "sdp-answer", g_signal_connect (http_server, "sdp-answer",
...@@ -304,6 +301,11 @@ int main (int argc, char *argv[]) ...@@ -304,6 +301,11 @@ int main (int argc, char *argv[])
srt_uri, srt_uri,
rist_addresses); rist_addresses);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_signal_connect (http_server, "ws-client-connected",
G_CALLBACK (webrtc_client_connected_cb), pipeline);
g_main_loop_run (loop); g_main_loop_run (loop);
g_main_loop_unref (loop); g_main_loop_unref (loop);
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