mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
gst: Add stream-id to stream-start events
This commit is contained in:
parent
2cc06f7aaf
commit
87d9927126
4 changed files with 31 additions and 5 deletions
|
@ -290,6 +290,7 @@ siddec_negotiate (GstSidDec * siddec)
|
|||
GstCaps *caps;
|
||||
const gchar *str;
|
||||
GstAudioFormat format;
|
||||
gchar *stream_id;
|
||||
|
||||
allowed = gst_pad_get_allowed_caps (siddec->srcpad);
|
||||
if (!allowed)
|
||||
|
@ -332,12 +333,15 @@ siddec_negotiate (GstSidDec * siddec)
|
|||
gst_structure_get_int (structure, "channels", &channels);
|
||||
siddec->config->channels = channels;
|
||||
|
||||
stream_id = gst_pad_create_stream_id (siddec->srcpad, GST_ELEMENT_CAST (siddec), NULL);
|
||||
gst_pad_push_event (siddec->srcpad, gst_event_new_stream_start (stream_id));
|
||||
g_free (stream_id);
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw",
|
||||
"format", G_TYPE_STRING, gst_audio_format_to_string (format),
|
||||
"layout", G_TYPE_STRING, "interleaved",
|
||||
"rate", G_TYPE_INT, siddec->config->frequency,
|
||||
"channels", G_TYPE_INT, siddec->config->channels, NULL);
|
||||
gst_pad_push_event (siddec->srcpad, gst_event_new_stream_start ());
|
||||
gst_pad_set_caps (siddec->srcpad, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
|
|
@ -2367,12 +2367,20 @@ static void
|
|||
gst_asf_demux_activate_stream (GstASFDemux * demux, AsfStream * stream)
|
||||
{
|
||||
if (!stream->active) {
|
||||
gchar *stream_id;
|
||||
|
||||
GST_INFO_OBJECT (demux, "Activating stream %2u, pad %s, caps %"
|
||||
GST_PTR_FORMAT, stream->id, GST_PAD_NAME (stream->pad), stream->caps);
|
||||
gst_pad_set_active (stream->pad, TRUE);
|
||||
|
||||
stream_id =
|
||||
gst_pad_create_stream_id_printf (stream->pad, GST_ELEMENT_CAST (demux),
|
||||
"%u", stream->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_element_add_pad (GST_ELEMENT_CAST (demux), stream->pad);
|
||||
gst_pad_push_event (stream->pad, gst_event_new_stream_start ());
|
||||
stream->active = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -319,6 +319,7 @@ gst_real_audio_demux_parse_header (GstRealAudioDemux * demux)
|
|||
const guint8 *data;
|
||||
gchar *codec_name = NULL;
|
||||
GstCaps *caps = NULL;
|
||||
gchar *stream_id;
|
||||
guint avail;
|
||||
|
||||
g_assert (demux->ra_version == 4 || demux->ra_version == 3);
|
||||
|
@ -443,10 +444,16 @@ gst_real_audio_demux_parse_header (GstRealAudioDemux * demux)
|
|||
GST_DEBUG_FUNCPTR (gst_real_audio_demux_src_query));
|
||||
gst_pad_set_active (demux->srcpad, TRUE);
|
||||
gst_pad_use_fixed_caps (demux->srcpad);
|
||||
gst_pad_push_event (demux->srcpad, gst_event_new_stream_start ());
|
||||
|
||||
stream_id =
|
||||
gst_pad_create_stream_id (demux->srcpad, GST_ELEMENT_CAST (demux), NULL);
|
||||
gst_pad_push_event (demux->srcpad, gst_event_new_stream_start (stream_id));
|
||||
g_free (stream_id);
|
||||
|
||||
gst_pad_set_caps (demux->srcpad, caps);
|
||||
codec_name = gst_pb_utils_get_codec_description (caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
gst_element_add_pad (GST_ELEMENT (demux), demux->srcpad);
|
||||
|
||||
if (demux->byterate_num > 0 && demux->byterate_denom > 0) {
|
||||
|
|
|
@ -1281,6 +1281,7 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
|||
GstCaps *stream_caps = NULL;
|
||||
const gchar *codec_tag = NULL;
|
||||
gchar *codec_name = NULL;
|
||||
gchar *stream_id;
|
||||
int version = 0;
|
||||
|
||||
if (stream->subtype == GST_RMDEMUX_STREAM_VIDEO) {
|
||||
|
@ -1487,9 +1488,14 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
|||
GST_DEBUG_OBJECT (rmdemux, "adding pad %s with caps %" GST_PTR_FORMAT
|
||||
", stream_id=%d", GST_PAD_NAME (stream->pad), stream_caps, stream->id);
|
||||
gst_pad_set_active (stream->pad, TRUE);
|
||||
|
||||
stream_id =
|
||||
gst_pad_create_stream_id_printf (stream->pad,
|
||||
GST_ELEMENT_CAST (rmdemux), "%u", stream->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_element_add_pad (GST_ELEMENT_CAST (rmdemux), stream->pad);
|
||||
gst_pad_push_event (stream->pad, gst_event_new_stream_start ());
|
||||
|
||||
codec_name = gst_pb_utils_get_codec_description (stream_caps);
|
||||
|
||||
|
@ -1501,6 +1507,7 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
|||
codec_tag, codec_name, NULL);
|
||||
g_free (codec_name);
|
||||
}
|
||||
gst_element_add_pad (GST_ELEMENT_CAST (rmdemux), stream->pad);
|
||||
}
|
||||
|
||||
beach:
|
||||
|
|
Loading…
Reference in a new issue