mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 18:50:48 +00:00
rtpmux: Send stream-start before caps
This commit is contained in:
parent
7719b19aec
commit
04c9f43567
3 changed files with 17 additions and 0 deletions
|
@ -554,6 +554,16 @@ gst_rtp_mux_setcaps (GstPad * pad, GstRTPMux * rtp_mux, GstCaps * caps)
|
|||
"clock-base", G_TYPE_UINT, rtp_mux->ts_base,
|
||||
"seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base, NULL);
|
||||
|
||||
if (rtp_mux->send_stream_start) {
|
||||
gchar s_id[32];
|
||||
|
||||
/* stream-start (FIXME: create id based on input ids) */
|
||||
g_snprintf (s_id, sizeof (s_id), "interleave-%08x", g_random_int ());
|
||||
gst_pad_push_event (rtp_mux->srcpad, gst_event_new_stream_start (s_id));
|
||||
|
||||
rtp_mux->send_stream_start = FALSE;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (rtp_mux,
|
||||
"setting caps %" GST_PTR_FORMAT " on src pad..", caps);
|
||||
ret = gst_pad_set_caps (rtp_mux->srcpad, caps);
|
||||
|
@ -815,6 +825,7 @@ gst_rtp_mux_ready_to_paused (GstRTPMux * rtp_mux)
|
|||
GST_OBJECT_LOCK (rtp_mux);
|
||||
|
||||
g_clear_object (&rtp_mux->last_pad);
|
||||
rtp_mux->send_stream_start = TRUE;
|
||||
|
||||
if (rtp_mux->ssrc == -1)
|
||||
rtp_mux->current_ssrc = g_random_int ();
|
||||
|
|
|
@ -75,6 +75,7 @@ struct _GstRTPMux
|
|||
GstPad *last_pad; /* protected by object lock */
|
||||
|
||||
GstClockTime last_stop;
|
||||
gboolean send_stream_start;
|
||||
};
|
||||
|
||||
struct _GstRTPMuxClass
|
||||
|
|
|
@ -148,6 +148,11 @@ test_basic (const gchar * elem_name, const gchar * sink2, int count,
|
|||
gst_pad_set_active (src1, TRUE);
|
||||
gst_pad_set_active (src2, TRUE);
|
||||
|
||||
fail_unless (gst_pad_push_event (src1,
|
||||
gst_event_new_stream_start ("stream1")));
|
||||
fail_unless (gst_pad_push_event (src2,
|
||||
gst_event_new_stream_start ("stream2")));
|
||||
|
||||
gst_caps_set_simple (sinkcaps,
|
||||
"payload", G_TYPE_INT, 98, "seqnum-base", G_TYPE_UINT, 100,
|
||||
"clock-base", G_TYPE_UINT, 1000, "ssrc", G_TYPE_UINT, 66, NULL);
|
||||
|
|
Loading…
Reference in a new issue