mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
collectpads: add STREAM_START handling
Use a flag to forward the first STREAM_START
This commit is contained in:
parent
867051c7f6
commit
46a4f2f6c0
1 changed files with 12 additions and 1 deletions
|
@ -109,6 +109,7 @@ struct _GstCollectPadsPrivate
|
||||||
{
|
{
|
||||||
/* with LOCK and/or STREAM_LOCK */
|
/* with LOCK and/or STREAM_LOCK */
|
||||||
gboolean started;
|
gboolean started;
|
||||||
|
gboolean stream_started;
|
||||||
|
|
||||||
/* with STREAM_LOCK */
|
/* with STREAM_LOCK */
|
||||||
guint32 cookie; /* @data list cookie */
|
guint32 cookie; /* @data list cookie */
|
||||||
|
@ -235,6 +236,7 @@ gst_collect_pads_init (GstCollectPads * pads)
|
||||||
pads->priv->queuedpads = 0;
|
pads->priv->queuedpads = 0;
|
||||||
pads->priv->eospads = 0;
|
pads->priv->eospads = 0;
|
||||||
pads->priv->started = FALSE;
|
pads->priv->started = FALSE;
|
||||||
|
pads->priv->stream_started = FALSE;
|
||||||
|
|
||||||
g_rec_mutex_init (&pads->stream_lock);
|
g_rec_mutex_init (&pads->stream_lock);
|
||||||
|
|
||||||
|
@ -1013,6 +1015,7 @@ gst_collect_pads_stop (GstCollectPads * pads)
|
||||||
unref_data (pads->priv->earliest_data);
|
unref_data (pads->priv->earliest_data);
|
||||||
pads->priv->earliest_data = NULL;
|
pads->priv->earliest_data = NULL;
|
||||||
pads->priv->earliest_time = GST_CLOCK_TIME_NONE;
|
pads->priv->earliest_time = GST_CLOCK_TIME_NONE;
|
||||||
|
pads->priv->stream_started = FALSE;
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (pads);
|
GST_OBJECT_UNLOCK (pads);
|
||||||
/* Wake them up so they can end the chain functions. */
|
/* Wake them up so they can end the chain functions. */
|
||||||
|
@ -1837,8 +1840,16 @@ gst_collect_pads_event_default (GstCollectPads * pads, GstCollectData * data,
|
||||||
* accumulated and this is certainly not what we want. */
|
* accumulated and this is certainly not what we want. */
|
||||||
goto eat;
|
goto eat;
|
||||||
}
|
}
|
||||||
case GST_EVENT_CAPS:
|
|
||||||
case GST_EVENT_STREAM_START:
|
case GST_EVENT_STREAM_START:
|
||||||
|
/* let the only the first one go through */
|
||||||
|
if (!pads->priv->stream_started) {
|
||||||
|
pads->priv->stream_started = TRUE;
|
||||||
|
goto forward;
|
||||||
|
} else {
|
||||||
|
goto eat;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GST_EVENT_CAPS:
|
||||||
case GST_EVENT_STREAM_CONFIG:
|
case GST_EVENT_STREAM_CONFIG:
|
||||||
goto eat;
|
goto eat;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue