• Home
  • Raw
  • Download

Lines Matching refs:demux

101 static void gst_sdp_demux_stream_push_event (GstSDPDemux * demux,
171 gst_sdp_demux_init (GstSDPDemux * demux) in gst_sdp_demux_init() argument
173 demux->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink"); in gst_sdp_demux_init()
174 gst_pad_set_event_function (demux->sinkpad, in gst_sdp_demux_init()
176 gst_pad_set_chain_function (demux->sinkpad, in gst_sdp_demux_init()
178 gst_element_add_pad (GST_ELEMENT (demux), demux->sinkpad); in gst_sdp_demux_init()
182 g_rec_mutex_init (&demux->stream_rec_lock); in gst_sdp_demux_init()
184 demux->adapter = gst_adapter_new (); in gst_sdp_demux_init()
190 GstSDPDemux *demux; in gst_sdp_demux_finalize() local
192 demux = GST_SDP_DEMUX (object); in gst_sdp_demux_finalize()
195 g_rec_mutex_clear (&demux->stream_rec_lock); in gst_sdp_demux_finalize()
197 g_object_unref (demux->adapter); in gst_sdp_demux_finalize()
206 GstSDPDemux *demux; in gst_sdp_demux_set_property() local
208 demux = GST_SDP_DEMUX (object); in gst_sdp_demux_set_property()
212 demux->debug = g_value_get_boolean (value); in gst_sdp_demux_set_property()
215 demux->udp_timeout = g_value_get_uint64 (value); in gst_sdp_demux_set_property()
218 demux->latency = g_value_get_uint (value); in gst_sdp_demux_set_property()
221 demux->redirect = g_value_get_boolean (value); in gst_sdp_demux_set_property()
233 GstSDPDemux *demux; in gst_sdp_demux_get_property() local
235 demux = GST_SDP_DEMUX (object); in gst_sdp_demux_get_property()
239 g_value_set_boolean (value, demux->debug); in gst_sdp_demux_get_property()
242 g_value_set_uint64 (value, demux->udp_timeout); in gst_sdp_demux_get_property()
245 g_value_set_uint (value, demux->latency); in gst_sdp_demux_get_property()
248 g_value_set_boolean (value, demux->redirect); in gst_sdp_demux_get_property()
292 find_stream (GstSDPDemux * demux, gconstpointer data, gconstpointer func) in find_stream() argument
298 g_list_find_custom (demux->streams, data, (GCompareFunc) func))) in find_stream()
305 gst_sdp_demux_stream_free (GstSDPDemux * demux, GstSDPStream * stream) in gst_sdp_demux_stream_free() argument
309 GST_DEBUG_OBJECT (demux, "free stream %p", stream); in gst_sdp_demux_stream_free()
320 gst_bin_remove (GST_BIN_CAST (demux), udpsrc); in gst_sdp_demux_stream_free()
325 if (demux->session) { in gst_sdp_demux_stream_free()
326 gst_element_release_request_pad (demux->session, channelpad); in gst_sdp_demux_stream_free()
334 gst_bin_remove (GST_BIN_CAST (demux), stream->udpsink); in gst_sdp_demux_stream_free()
338 if (demux->session) { in gst_sdp_demux_stream_free()
339 gst_element_release_request_pad (demux->session, stream->rtcppad); in gst_sdp_demux_stream_free()
347 gst_element_remove_pad (GST_ELEMENT_CAST (demux), stream->srcpad); in gst_sdp_demux_stream_free()
387 gst_sdp_demux_create_stream (GstSDPDemux * demux, GstSDPMessage * sdp, gint idx) in gst_sdp_demux_create_stream() argument
400 stream->parent = demux; in gst_sdp_demux_create_stream()
406 stream->id = demux->numstreams++; in gst_sdp_demux_create_stream()
427 if (find_stream (demux, GINT_TO_POINTER (stream->pt), in gst_sdp_demux_create_stream()
460 GST_DEBUG_OBJECT (demux, "stream %d, (%p)", stream->id, stream); in gst_sdp_demux_create_stream()
461 GST_DEBUG_OBJECT (demux, " pt: %d", stream->pt); in gst_sdp_demux_create_stream()
462 GST_DEBUG_OBJECT (demux, " container: %d", stream->container); in gst_sdp_demux_create_stream()
463 GST_DEBUG_OBJECT (demux, " caps: %" GST_PTR_FORMAT, stream->caps); in gst_sdp_demux_create_stream()
466 demux->streams = g_list_append (demux->streams, stream); in gst_sdp_demux_create_stream()
473 gst_sdp_demux_stream_free (demux, stream); in gst_sdp_demux_create_stream()
479 gst_sdp_demux_cleanup (GstSDPDemux * demux) in gst_sdp_demux_cleanup() argument
483 GST_DEBUG_OBJECT (demux, "cleanup"); in gst_sdp_demux_cleanup()
485 for (walk = demux->streams; walk; walk = g_list_next (walk)) { in gst_sdp_demux_cleanup()
488 gst_sdp_demux_stream_free (demux, stream); in gst_sdp_demux_cleanup()
490 g_list_free (demux->streams); in gst_sdp_demux_cleanup()
491 demux->streams = NULL; in gst_sdp_demux_cleanup()
492 if (demux->session) { in gst_sdp_demux_cleanup()
493 if (demux->session_sig_id) { in gst_sdp_demux_cleanup()
494 g_signal_handler_disconnect (demux->session, demux->session_sig_id); in gst_sdp_demux_cleanup()
495 demux->session_sig_id = 0; in gst_sdp_demux_cleanup()
497 if (demux->session_nmp_id) { in gst_sdp_demux_cleanup()
498 g_signal_handler_disconnect (demux->session, demux->session_nmp_id); in gst_sdp_demux_cleanup()
499 demux->session_nmp_id = 0; in gst_sdp_demux_cleanup()
501 if (demux->session_ptmap_id) { in gst_sdp_demux_cleanup()
502 g_signal_handler_disconnect (demux->session, demux->session_ptmap_id); in gst_sdp_demux_cleanup()
503 demux->session_ptmap_id = 0; in gst_sdp_demux_cleanup()
505 gst_element_set_state (demux->session, GST_STATE_NULL); in gst_sdp_demux_cleanup()
506 gst_bin_remove (GST_BIN_CAST (demux), demux->session); in gst_sdp_demux_cleanup()
507 demux->session = NULL; in gst_sdp_demux_cleanup()
509 demux->numstreams = 0; in gst_sdp_demux_cleanup()
515 new_session_pad (GstElement * session, GstPad * pad, GstSDPDemux * demux) in new_session_pad() argument
524 GST_DEBUG_OBJECT (demux, "got new session pad %" GST_PTR_FORMAT, pad); in new_session_pad()
526 GST_SDP_STREAM_LOCK (demux); in new_session_pad()
532 GST_DEBUG_OBJECT (demux, "stream: %u, SSRC %u, PT %u", id, ssrc, pt); in new_session_pad()
535 find_stream (demux, GUINT_TO_POINTER (id), (gpointer) find_stream_by_id); in new_session_pad()
554 gst_element_add_pad (GST_ELEMENT_CAST (demux), stream->srcpad); in new_session_pad()
558 for (lstream = demux->streams; lstream; lstream = g_list_next (lstream)) { in new_session_pad()
567 GST_SDP_STREAM_UNLOCK (demux); in new_session_pad()
570 GST_DEBUG_OBJECT (demux, "We added all streams"); in new_session_pad()
573 gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); in new_session_pad()
581 GST_DEBUG_OBJECT (demux, "ignoring unknown stream"); in new_session_pad()
582 GST_SDP_STREAM_UNLOCK (demux); in new_session_pad()
589 rtsp_session_pad_added (GstElement * session, GstPad * pad, GstSDPDemux * demux) in rtsp_session_pad_added() argument
594 GST_DEBUG_OBJECT (demux, "got new session pad %" GST_PTR_FORMAT, pad); in rtsp_session_pad_added()
601 gst_element_add_pad (GST_ELEMENT_CAST (demux), srcpad); in rtsp_session_pad_added()
605 rtsp_session_no_more_pads (GstElement * session, GstSDPDemux * demux) in rtsp_session_no_more_pads() argument
607 GST_DEBUG_OBJECT (demux, "got no-more-pads"); in rtsp_session_no_more_pads()
608 gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); in rtsp_session_no_more_pads()
612 request_pt_map (GstElement * sess, guint session, guint pt, GstSDPDemux * demux) in request_pt_map() argument
617 GST_DEBUG_OBJECT (demux, "getting pt map for pt %d in session %d", pt, in request_pt_map()
620 GST_SDP_STREAM_LOCK (demux); in request_pt_map()
622 find_stream (demux, GINT_TO_POINTER (session), in request_pt_map()
630 GST_SDP_STREAM_UNLOCK (demux); in request_pt_map()
636 GST_DEBUG_OBJECT (demux, "unknown stream %d", session); in request_pt_map()
637 GST_SDP_STREAM_UNLOCK (demux); in request_pt_map()
643 gst_sdp_demux_do_stream_eos (GstSDPDemux * demux, guint session, guint32 ssrc) in gst_sdp_demux_do_stream_eos() argument
647 GST_DEBUG_OBJECT (demux, "setting stream for session %u to EOS", session); in gst_sdp_demux_do_stream_eos()
651 find_stream (demux, GINT_TO_POINTER (session), in gst_sdp_demux_do_stream_eos()
663 gst_sdp_demux_stream_push_event (demux, stream, gst_event_new_eos ()); in gst_sdp_demux_do_stream_eos()
669 GST_DEBUG_OBJECT (demux, "unknown stream for session %u", session); in gst_sdp_demux_do_stream_eos()
674 GST_DEBUG_OBJECT (demux, "stream for session %u was already EOS", session); in gst_sdp_demux_do_stream_eos()
679 GST_DEBUG_OBJECT (demux, "unkown SSRC %08x for session %u", ssrc, session); in gst_sdp_demux_do_stream_eos()
686 GstSDPDemux * demux) in on_bye_ssrc() argument
688 GST_DEBUG_OBJECT (demux, "SSRC %08x in session %u received BYE", ssrc, in on_bye_ssrc()
691 gst_sdp_demux_do_stream_eos (demux, session, ssrc); in on_bye_ssrc()
696 GstSDPDemux * demux) in on_timeout() argument
698 GST_DEBUG_OBJECT (demux, "SSRC %08x in session %u timed out", ssrc, session); in on_timeout()
700 gst_sdp_demux_do_stream_eos (demux, session, ssrc); in on_timeout()
705 gst_sdp_demux_configure_manager (GstSDPDemux * demux, char *rtsp_sdp) in gst_sdp_demux_configure_manager() argument
709 if (!(demux->session = gst_element_factory_make ("rtspsrc", NULL))) in gst_sdp_demux_configure_manager()
712 g_object_set (demux->session, "location", rtsp_sdp, NULL); in gst_sdp_demux_configure_manager()
714 GST_DEBUG_OBJECT (demux, "connect to signals on rtspsrc"); in gst_sdp_demux_configure_manager()
715 demux->session_sig_id = in gst_sdp_demux_configure_manager()
716 g_signal_connect (demux->session, "pad-added", in gst_sdp_demux_configure_manager()
717 (GCallback) rtsp_session_pad_added, demux); in gst_sdp_demux_configure_manager()
718 demux->session_nmp_id = in gst_sdp_demux_configure_manager()
719 g_signal_connect (demux->session, "no-more-pads", in gst_sdp_demux_configure_manager()
720 (GCallback) rtsp_session_no_more_pads, demux); in gst_sdp_demux_configure_manager()
722 if (!(demux->session = gst_element_factory_make ("rtpbin", NULL))) in gst_sdp_demux_configure_manager()
726 GST_DEBUG_OBJECT (demux, "connect to signals on session manager"); in gst_sdp_demux_configure_manager()
727 demux->session_sig_id = in gst_sdp_demux_configure_manager()
728 g_signal_connect (demux->session, "pad-added", in gst_sdp_demux_configure_manager()
729 (GCallback) new_session_pad, demux); in gst_sdp_demux_configure_manager()
730 demux->session_ptmap_id = in gst_sdp_demux_configure_manager()
731 g_signal_connect (demux->session, "request-pt-map", in gst_sdp_demux_configure_manager()
732 (GCallback) request_pt_map, demux); in gst_sdp_demux_configure_manager()
733 g_signal_connect (demux->session, "on-bye-ssrc", (GCallback) on_bye_ssrc, in gst_sdp_demux_configure_manager()
734 demux); in gst_sdp_demux_configure_manager()
735 g_signal_connect (demux->session, "on-bye-timeout", (GCallback) on_timeout, in gst_sdp_demux_configure_manager()
736 demux); in gst_sdp_demux_configure_manager()
737 g_signal_connect (demux->session, "on-timeout", (GCallback) on_timeout, in gst_sdp_demux_configure_manager()
738 demux); in gst_sdp_demux_configure_manager()
741 g_object_set (demux->session, "latency", demux->latency, NULL); in gst_sdp_demux_configure_manager()
744 gst_bin_add (GST_BIN_CAST (demux), demux->session); in gst_sdp_demux_configure_manager()
751 GST_DEBUG_OBJECT (demux, "no session manager element gstrtpbin found"); in gst_sdp_demux_configure_manager()
756 GST_DEBUG_OBJECT (demux, "no manager element rtspsrc found"); in gst_sdp_demux_configure_manager()
762 gst_sdp_demux_stream_configure_udp (GstSDPDemux * demux, GstSDPStream * stream) in gst_sdp_demux_stream_configure_udp() argument
768 GST_DEBUG_OBJECT (demux, "creating UDP sources for multicast"); in gst_sdp_demux_stream_configure_udp()
779 GST_DEBUG_OBJECT (demux, "receiving RTP from %s:%d", destination, in gst_sdp_demux_stream_configure_udp()
790 gst_bin_add (GST_BIN_CAST (demux), stream->udpsrc[0]); in gst_sdp_demux_stream_configure_udp()
792 GST_DEBUG_OBJECT (demux, in gst_sdp_demux_stream_configure_udp()
794 demux->udp_timeout); in gst_sdp_demux_stream_configure_udp()
799 demux->udp_timeout * 1000, NULL); in gst_sdp_demux_stream_configure_udp()
806 gst_element_request_pad_simple (demux->session, name); in gst_sdp_demux_stream_configure_udp()
809 GST_DEBUG_OBJECT (demux, "connecting RTP source 0 to manager"); in gst_sdp_demux_stream_configure_udp()
821 GST_DEBUG_OBJECT (demux, "receiving RTCP from %s:%d", destination, in gst_sdp_demux_stream_configure_udp()
831 gst_bin_add (GST_BIN_CAST (demux), stream->udpsrc[1]); in gst_sdp_demux_stream_configure_udp()
833 GST_DEBUG_OBJECT (demux, "connecting RTCP source to manager"); in gst_sdp_demux_stream_configure_udp()
837 gst_element_request_pad_simple (demux->session, name); in gst_sdp_demux_stream_configure_udp()
851 GST_DEBUG_OBJECT (demux, "no UDP source element found"); in gst_sdp_demux_stream_configure_udp()
858 gst_sdp_demux_stream_configure_udp_sink (GstSDPDemux * demux, in gst_sdp_demux_stream_configure_udp_sink() argument
870 GST_DEBUG_OBJECT (demux, "configure UDP sink for %s:%d", destination, port); in gst_sdp_demux_stream_configure_udp_sink()
897 GST_DEBUG_OBJECT (demux, "UDP src has socket %p", socket); in gst_sdp_demux_stream_configure_udp_sink()
909 gst_bin_add (GST_BIN_CAST (demux), stream->udpsink); in gst_sdp_demux_stream_configure_udp_sink()
913 stream->rtcppad = gst_element_request_pad_simple (demux->session, name); in gst_sdp_demux_stream_configure_udp_sink()
923 GST_WARNING_OBJECT (demux, "could not get session RTCP pad"); in gst_sdp_demux_stream_configure_udp_sink()
931 GST_DEBUG_OBJECT (demux, "no UDP sink element found"); in gst_sdp_demux_stream_configure_udp_sink()
937 gst_sdp_demux_combine_flows (GstSDPDemux * demux, GstSDPStream * stream, in gst_sdp_demux_combine_flows() argument
955 for (streams = demux->streams; streams; streams = g_list_next (streams)) { in gst_sdp_demux_combine_flows()
971 gst_sdp_demux_stream_push_event (GstSDPDemux * demux, GstSDPStream * stream, in gst_sdp_demux_stream_push_event() argument
995 GstSDPDemux *demux; in gst_sdp_demux_handle_message() local
997 demux = GST_SDP_DEMUX (bin); in gst_sdp_demux_handle_message()
1009 GST_OBJECT_LOCK (demux); in gst_sdp_demux_handle_message()
1010 ignore_timeout = demux->ignore_timeout; in gst_sdp_demux_handle_message()
1011 demux->ignore_timeout = TRUE; in gst_sdp_demux_handle_message()
1012 GST_OBJECT_UNLOCK (demux); in gst_sdp_demux_handle_message()
1019 GST_ELEMENT_ERROR (demux, RESOURCE, READ, (NULL), in gst_sdp_demux_handle_message()
1022 gst_guint64_to_gdouble (demux->udp_timeout / 1000000.0))); in gst_sdp_demux_handle_message()
1037 GST_DEBUG_OBJECT (demux, "got error from %s", GST_ELEMENT_NAME (udpsrc)); in gst_sdp_demux_handle_message()
1039 stream = find_stream (demux, udpsrc, (gpointer) find_stream_by_udpsrc); in gst_sdp_demux_handle_message()
1051 ret = gst_sdp_demux_combine_flows (demux, stream, GST_FLOW_NOT_LINKED); in gst_sdp_demux_handle_message()
1052 GST_DEBUG_OBJECT (demux, "combined flows: %s", gst_flow_get_name (ret)); in gst_sdp_demux_handle_message()
1073 gst_sdp_demux_start (GstSDPDemux * demux) in gst_sdp_demux_start() argument
1085 GST_SDP_STREAM_LOCK (demux); in gst_sdp_demux_start()
1087 GST_DEBUG_OBJECT (demux, "parse SDP..."); in gst_sdp_demux_start()
1089 size = gst_adapter_available (demux->adapter); in gst_sdp_demux_start()
1093 data = gst_adapter_take (demux->adapter, size); in gst_sdp_demux_start()
1099 if (demux->debug) in gst_sdp_demux_start()
1149 if (demux->redirect) { in gst_sdp_demux_start()
1150 GST_INFO_OBJECT (demux, "redirect to %s", uri); in gst_sdp_demux_start()
1152 gst_element_post_message (GST_ELEMENT_CAST (demux), in gst_sdp_demux_start()
1153 gst_message_new_element (GST_OBJECT_CAST (demux), in gst_sdp_demux_start()
1164 if (!gst_sdp_demux_configure_manager (demux, uri)) in gst_sdp_demux_start()
1170 stream = gst_sdp_demux_create_stream (demux, &sdp, i); in gst_sdp_demux_start()
1175 GST_DEBUG_OBJECT (demux, "configuring transport for stream %p", stream); in gst_sdp_demux_start()
1177 if (!gst_sdp_demux_stream_configure_udp (demux, stream)) in gst_sdp_demux_start()
1179 if (!gst_sdp_demux_stream_configure_udp_sink (demux, stream)) in gst_sdp_demux_start()
1183 if (!demux->streams) in gst_sdp_demux_start()
1191 if (demux->target > GST_STATE_PAUSED) { in gst_sdp_demux_start()
1192 ret = gst_element_set_state (demux->session, GST_STATE_PAUSED); in gst_sdp_demux_start()
1196 ret = gst_element_set_state (demux->session, demux->target); in gst_sdp_demux_start()
1202 for (walk = demux->streams; walk; walk = g_list_next (walk)) { in gst_sdp_demux_start()
1206 gst_element_set_state (stream->udpsrc[0], demux->target); in gst_sdp_demux_start()
1207 gst_element_set_state (stream->udpsrc[1], demux->target); in gst_sdp_demux_start()
1210 GST_SDP_STREAM_UNLOCK (demux); in gst_sdp_demux_start()
1219 GST_SDP_STREAM_UNLOCK (demux); in gst_sdp_demux_start()
1226 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1232 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1238 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1244 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1250 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1257 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1263 GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), in gst_sdp_demux_start()
1265 gst_element_set_state (demux->session, GST_STATE_NULL); in gst_sdp_demux_start()
1266 gst_bin_remove (GST_BIN_CAST (demux), demux->session); in gst_sdp_demux_start()
1267 demux->session = NULL; in gst_sdp_demux_start()
1275 GstSDPDemux *demux; in gst_sdp_demux_sink_event() local
1278 demux = GST_SDP_DEMUX (parent); in gst_sdp_demux_sink_event()
1283 res = gst_sdp_demux_start (demux); in gst_sdp_demux_sink_event()
1297 GstSDPDemux *demux; in gst_sdp_demux_sink_chain() local
1299 demux = GST_SDP_DEMUX (parent); in gst_sdp_demux_sink_chain()
1303 gst_adapter_push (demux->adapter, buffer); in gst_sdp_demux_sink_chain()
1311 GstSDPDemux *demux; in gst_sdp_demux_change_state() local
1314 demux = GST_SDP_DEMUX (element); in gst_sdp_demux_change_state()
1316 GST_SDP_STREAM_LOCK (demux); in gst_sdp_demux_change_state()
1323 gst_adapter_clear (demux->adapter); in gst_sdp_demux_change_state()
1324 demux->ignore_timeout = FALSE; in gst_sdp_demux_change_state()
1325 demux->target = GST_STATE_PAUSED; in gst_sdp_demux_change_state()
1328 demux->target = GST_STATE_PLAYING; in gst_sdp_demux_change_state()
1344 demux->target = GST_STATE_PAUSED; in gst_sdp_demux_change_state()
1347 gst_sdp_demux_cleanup (demux); in gst_sdp_demux_change_state()
1356 GST_SDP_STREAM_UNLOCK (demux); in gst_sdp_demux_change_state()