mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
interleave: Send stream-start before caps event
This commit is contained in:
parent
04c9f43567
commit
f67c227878
1 changed files with 21 additions and 17 deletions
|
@ -296,6 +296,24 @@ gst_interleave_set_channel_positions (GstInterleave * self, GstStructure * s)
|
||||||
gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
|
gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_interleave_send_stream_start (GstInterleave * self)
|
||||||
|
{
|
||||||
|
GST_OBJECT_LOCK (self);
|
||||||
|
if (self->send_stream_start) {
|
||||||
|
gchar s_id[32];
|
||||||
|
|
||||||
|
self->send_stream_start = FALSE;
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
|
/* 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 (self->src, gst_event_new_stream_start (s_id));
|
||||||
|
} else {
|
||||||
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_interleave_class_init (GstInterleaveClass * klass)
|
gst_interleave_class_init (GstInterleaveClass * klass)
|
||||||
{
|
{
|
||||||
|
@ -386,7 +404,6 @@ gst_interleave_init (GstInterleave * self)
|
||||||
gst_pad_set_event_function (self->src,
|
gst_pad_set_event_function (self->src,
|
||||||
GST_DEBUG_FUNCPTR (gst_interleave_src_event));
|
GST_DEBUG_FUNCPTR (gst_interleave_src_event));
|
||||||
|
|
||||||
gst_pad_set_active (self->src, TRUE);
|
|
||||||
gst_element_add_pad (GST_ELEMENT (self), self->src);
|
gst_element_add_pad (GST_ELEMENT (self), self->src);
|
||||||
|
|
||||||
self->collect = gst_collect_pads_new ();
|
self->collect = gst_collect_pads_new ();
|
||||||
|
@ -508,8 +525,7 @@ gst_interleave_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
||||||
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
||||||
gst_interleave_set_channel_positions (self, s);
|
gst_interleave_set_channel_positions (self, s);
|
||||||
|
|
||||||
/* FIXME: send caps event after stream-start event */
|
gst_interleave_send_stream_start (self);
|
||||||
gst_pad_set_active (self->src, TRUE);
|
|
||||||
gst_pad_set_caps (self->src, srccaps);
|
gst_pad_set_caps (self->src, srccaps);
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
|
|
||||||
|
@ -575,7 +591,7 @@ gst_interleave_release_pad (GstElement * element, GstPad * pad)
|
||||||
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
||||||
gst_interleave_set_channel_positions (self, s);
|
gst_interleave_set_channel_positions (self, s);
|
||||||
|
|
||||||
gst_pad_set_active (self->src, TRUE);
|
gst_interleave_send_stream_start (self);
|
||||||
gst_pad_set_caps (self->src, srccaps);
|
gst_pad_set_caps (self->src, srccaps);
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
} else {
|
} else {
|
||||||
|
@ -762,7 +778,7 @@ gst_interleave_sink_setcaps (GstInterleave * self, GstPad * pad,
|
||||||
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
gst_structure_set (s, "channels", G_TYPE_INT, self->channels, NULL);
|
||||||
gst_interleave_set_channel_positions (self, s);
|
gst_interleave_set_channel_positions (self, s);
|
||||||
|
|
||||||
gst_pad_set_active (self->src, TRUE);
|
gst_interleave_send_stream_start (self);
|
||||||
res = gst_pad_set_caps (self->src, srccaps);
|
res = gst_pad_set_caps (self->src, srccaps);
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
|
|
||||||
|
@ -1189,18 +1205,6 @@ gst_interleave_collected (GstCollectPads * pads, GstInterleave * self)
|
||||||
GstMapInfo write_info;
|
GstMapInfo write_info;
|
||||||
GstClockTime timestamp = -1;
|
GstClockTime timestamp = -1;
|
||||||
|
|
||||||
/* FIXME: send caps and tags after stream-start */
|
|
||||||
#if 0
|
|
||||||
if (self->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 (self->src, gst_event_new_stream_start (s_id));
|
|
||||||
self->send_stream_start = FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
size = gst_collect_pads_available (pads);
|
size = gst_collect_pads_available (pads);
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
goto eos;
|
goto eos;
|
||||||
|
|
Loading…
Reference in a new issue