diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-08-04 12:47:44 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-08-06 13:43:57 +0200 |
commit | 7b5925b5a4aaed4e4cc00d4d6abc37f6c308d2a2 (patch) | |
tree | 886d9845d4aac94f114b7bb943bc9938d67827ed | |
parent | 46255d6ada6213c966cfcf49d77dfc8335b24b16 (diff) |
gst: Add stream-id to stream-start events
m--------- | common | 0 | ||||
-rw-r--r-- | ext/dv/gstdvdemux.c | 18 | ||||
-rw-r--r-- | gst/avi/gstavidemux.c | 7 | ||||
-rw-r--r-- | gst/flv/gstflvdemux.c | 13 | ||||
-rw-r--r-- | gst/isomp4/qtdemux.c | 8 | ||||
-rw-r--r-- | gst/matroska/matroska-demux.c | 9 |
6 files changed, 48 insertions, 7 deletions
diff --git a/common b/common -Subproject 668acee6b7f0967e841523f78f31152b3cb9130 +Subproject 94ccf4cadba30549c22a13a5b9c95cc7548060e diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c index 9f0b057e9..75320822d 100644 --- a/ext/dv/gstdvdemux.c +++ b/ext/dv/gstdvdemux.c @@ -1177,6 +1177,14 @@ gst_dvdemux_demux_audio (GstDVDemux * dvdemux, GstBuffer * buffer, || (channels != dvdemux->channels))) { GstCaps *caps; GstAudioInfo info; + gchar *stream_id; + + stream_id = + gst_pad_create_stream_id (dvdemux->audiosrcpad, + GST_ELEMENT_CAST (dvdemux), "audio"); + gst_pad_push_event (dvdemux->audiosrcpad, + gst_event_new_stream_start (stream_id)); + g_free (stream_id); dvdemux->frequency = frequency; dvdemux->channels = channels; @@ -1185,7 +1193,6 @@ gst_dvdemux_demux_audio (GstDVDemux * dvdemux, GstBuffer * buffer, gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_S16LE, frequency, channels, NULL); caps = gst_audio_info_to_caps (&info); - gst_pad_push_event (dvdemux->audiosrcpad, gst_event_new_stream_start ()); gst_pad_set_caps (dvdemux->audiosrcpad, caps); gst_caps_unref (caps); } @@ -1246,6 +1253,14 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer, if (G_UNLIKELY ((dvdemux->height != height) || dvdemux->wide != wide)) { GstCaps *caps; gint par_x, par_y; + gchar *stream_id; + + stream_id = + gst_pad_create_stream_id (dvdemux->videosrcpad, + GST_ELEMENT_CAST (dvdemux), "video"); + gst_pad_push_event (dvdemux->videosrcpad, + gst_event_new_stream_start (stream_id)); + g_free (stream_id); dvdemux->height = height; dvdemux->wide = wide; @@ -1275,7 +1290,6 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer, "framerate", GST_TYPE_FRACTION, dvdemux->framerate_numerator, dvdemux->framerate_denominator, "pixel-aspect-ratio", GST_TYPE_FRACTION, par_x, par_y, NULL); - gst_pad_push_event (dvdemux->videosrcpad, gst_event_new_stream_start ()); gst_pad_set_caps (dvdemux->videosrcpad, caps); gst_caps_unref (caps); } diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 42986ffd2..6087b3bc6 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -1924,6 +1924,7 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf) GstElement *element; gboolean got_strh = FALSE, got_strf = FALSE, got_vprp = FALSE; gst_riff_vprp *vprp = NULL; + gchar *stream_id; element = GST_ELEMENT_CAST (avi); @@ -2299,7 +2300,11 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf) avi->num_streams++; gst_pad_set_active (pad, TRUE); - gst_pad_push_event (pad, gst_event_new_stream_start ()); + stream_id = + gst_pad_create_stream_id_printf (pad, GST_ELEMENT_CAST (avi), "%u", + avi->num_streams); + gst_pad_push_event (pad, gst_event_new_stream_start (stream_id)); + g_free (stream_id); gst_pad_set_caps (pad, caps); gst_caps_unref (caps); diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 3777054c5..df53775ed 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -642,6 +642,7 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag, gchar *codec_name = NULL; gboolean ret = FALSE; guint adjusted_rate = rate; + gchar *stream_id; switch (codec_tag) { case 1: @@ -732,7 +733,11 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag, demux->audio_codec_data, NULL); } - gst_pad_push_event (demux->audio_pad, gst_event_new_stream_start ()); + stream_id = + gst_pad_create_stream_id (demux->audio_pad, GST_ELEMENT_CAST (demux), + "audio"); + gst_pad_push_event (demux->audio_pad, gst_event_new_stream_start (stream_id)); + g_free (stream_id); ret = gst_pad_set_caps (demux->audio_pad, caps); if (G_LIKELY (ret)) { @@ -1123,6 +1128,7 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag) gboolean ret = FALSE; GstCaps *caps = NULL; gchar *codec_name = NULL; + gchar *stream_id; /* Generate caps for that pad */ switch (codec_tag) { @@ -1179,7 +1185,10 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag) demux->video_codec_data, NULL); } - gst_pad_push_event (demux->video_pad, gst_event_new_stream_start ()); + stream_id = + gst_pad_create_stream_id (demux->video_pad, GST_ELEMENT_CAST (demux), + "video"); + gst_pad_push_event (demux->video_pad, gst_event_new_stream_start (stream_id)); ret = gst_pad_set_caps (demux->video_pad, caps); if (G_LIKELY (ret)) { diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 88d069b36..89f80555b 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -5168,6 +5168,8 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, } if (stream->pad) { + gchar *stream_id; + GST_PAD_ELEMENT_PRIVATE (stream->pad) = stream; gst_pad_use_fixed_caps (stream->pad); @@ -5176,7 +5178,11 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, gst_pad_set_active (stream->pad, TRUE); GST_DEBUG_OBJECT (qtdemux, "setting caps %" GST_PTR_FORMAT, stream->caps); - gst_pad_push_event (stream->pad, gst_event_new_stream_start ()); + stream_id = + gst_pad_create_stream_id_printf (stream->pad, + GST_ELEMENT_CAST (qtdemux), "%u", stream->track_id); + gst_pad_push_event (stream->pad, gst_event_new_stream_start (stream_id)); + g_free (stream_id); gst_pad_set_caps (stream->pad, stream->caps); GST_DEBUG_OBJECT (qtdemux, "adding pad %s %p to qtdemux %p", diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 8a230c61e..b2b630433 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -535,6 +535,7 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml) guint16 riff_audio_fmt = 0; GstTagList *list = NULL; gchar *codec = NULL; + gchar *stream_id; DEBUG_ELEMENT_START (demux, ebml, "TrackEntry"); @@ -1335,8 +1336,14 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml) gst_pad_use_fixed_caps (context->pad); gst_pad_set_active (context->pad, TRUE); - gst_pad_push_event (context->pad, gst_event_new_stream_start ()); + + stream_id = + gst_pad_create_stream_id_printf (context->pad, GST_ELEMENT_CAST (demux), + "%u", context->uid); + gst_pad_push_event (context->pad, gst_event_new_stream_start (stream_id)); + g_free (stream_id); gst_pad_set_caps (context->pad, context->caps); + gst_element_add_pad (GST_ELEMENT (demux), context->pad); g_free (padname); |