mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
[411/906] gstglmixer: copy/past recent changes from gstvideomixer
This commit is contained in:
parent
4874b35304
commit
0b6112c4a0
1 changed files with 20 additions and 4 deletions
|
@ -821,7 +821,7 @@ gst_gl_mixer_fill_queues (GstGLMixer * mix)
|
||||||
|
|
||||||
GST_LOG_OBJECT (mix, "we need a new buffer");
|
GST_LOG_OBJECT (mix, "we need a new buffer");
|
||||||
|
|
||||||
buf = gst_collect_pads_pop (mix->collect, data);
|
buf = gst_collect_pads_peek (mix->collect, data);
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
guint64 duration;
|
guint64 duration;
|
||||||
|
@ -836,7 +836,9 @@ gst_gl_mixer_fill_queues (GstGLMixer * mix)
|
||||||
if (mixpad->fps_n == 0) {
|
if (mixpad->fps_n == 0) {
|
||||||
duration = GST_CLOCK_TIME_NONE;
|
duration = GST_CLOCK_TIME_NONE;
|
||||||
} else {
|
} else {
|
||||||
duration = GST_SECOND * mixpad->fps_d / mixpad->fps_n;
|
duration =
|
||||||
|
gst_util_uint64_scale_int (GST_SECOND, mixpad->fps_d,
|
||||||
|
mixpad->fps_n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GST_CLOCK_TIME_IS_VALID (duration))
|
if (GST_CLOCK_TIME_IS_VALID (duration))
|
||||||
|
@ -951,7 +953,7 @@ static void
|
||||||
gst_gl_mixer_update_queues (GstGLMixer * mix)
|
gst_gl_mixer_update_queues (GstGLMixer * mix)
|
||||||
{
|
{
|
||||||
GSList *walk;
|
GSList *walk;
|
||||||
guint64 interval;
|
gint64 interval;
|
||||||
|
|
||||||
interval = mix->master->queued;
|
interval = mix->master->queued;
|
||||||
if (interval <= 0) {
|
if (interval <= 0) {
|
||||||
|
@ -960,7 +962,7 @@ gst_gl_mixer_update_queues (GstGLMixer * mix)
|
||||||
} else {
|
} else {
|
||||||
interval = GST_SECOND * mix->fps_d / mix->fps_n;
|
interval = GST_SECOND * mix->fps_d / mix->fps_n;
|
||||||
}
|
}
|
||||||
GST_LOG_OBJECT (mix, "set interval to %" G_GUINT64_FORMAT " nanoseconds",
|
GST_LOG_OBJECT (mix, "set interval to %" G_GINT64_FORMAT " nanoseconds",
|
||||||
interval);
|
interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -975,7 +977,14 @@ gst_gl_mixer_update_queues (GstGLMixer * mix)
|
||||||
pad->queued -= interval;
|
pad->queued -= interval;
|
||||||
GST_LOG_OBJECT (pad, "queued now %" G_GINT64_FORMAT, pad->queued);
|
GST_LOG_OBJECT (pad, "queued now %" G_GINT64_FORMAT, pad->queued);
|
||||||
if (pad->queued <= 0) {
|
if (pad->queued <= 0) {
|
||||||
|
GstBuffer *buffer =
|
||||||
|
gst_collect_pads_pop (mix->collect, &mixcol->collect);
|
||||||
GST_LOG_OBJECT (pad, "unreffing buffer");
|
GST_LOG_OBJECT (pad, "unreffing buffer");
|
||||||
|
if (buffer)
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
|
else
|
||||||
|
GST_WARNING_OBJECT (pad,
|
||||||
|
"Buffer was removed by GstCollectPads in the meantime");
|
||||||
gst_buffer_unref (mixcol->buffer);
|
gst_buffer_unref (mixcol->buffer);
|
||||||
mixcol->buffer = NULL;
|
mixcol->buffer = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1151,6 +1160,7 @@ gst_gl_mixer_src_event (GstPad * pad, GstEvent * event)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_gl_mixer_sink_event (GstPad * pad, GstEvent * event)
|
gst_gl_mixer_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
|
GstGLMixerPad *vpad = GST_GL_MIXER_PAD (pad);
|
||||||
GstGLMixer *videomixer = GST_GL_MIXER (gst_pad_get_parent (pad));
|
GstGLMixer *videomixer = GST_GL_MIXER (gst_pad_get_parent (pad));
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
|
@ -1166,6 +1176,12 @@ gst_gl_mixer_sink_event (GstPad * pad, GstEvent * event)
|
||||||
* and downstream (using our source pad, the bastard!).
|
* and downstream (using our source pad, the bastard!).
|
||||||
*/
|
*/
|
||||||
videomixer->sendseg = TRUE;
|
videomixer->sendseg = TRUE;
|
||||||
|
|
||||||
|
/* Reset pad state after FLUSH_STOP */
|
||||||
|
if (vpad->mixcol->buffer)
|
||||||
|
gst_buffer_unref (vpad->mixcol->buffer);
|
||||||
|
vpad->mixcol->buffer = NULL;
|
||||||
|
vpad->queued = 0;
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_NEWSEGMENT:
|
case GST_EVENT_NEWSEGMENT:
|
||||||
videomixer->sendseg = TRUE;
|
videomixer->sendseg = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue