[Bug 759470] input-selector: add mode that waits for keyframe before switching inputs

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Dec 16 07:17:22 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=759470

--- Comment #10 from Thiago Sousa Santos <thiagossantos at gmail.com> ---
(In reply to Tapas Kumar Kundu from comment #9)
> (In reply to Sebastian Dröge (slomo) from comment #8)
> > I think the check/switching should happen around
> > http://cgit.freedesktop.org/gstreamer/gstreamer/tree/plugins/elements/
> > gstinputselector.c#n988
> 
> Thanks.  here is the code which i am going to put soon just below line #988:
> 
> active_sinkpad = gst_input_selector_get_active_sinkpad (sel); // line 988
> if (active_sinkpad == pad) { //line 989
>  // this pad is active sink pad so check for DELTA UNIT and discard.
>  // buf is passed as pointer of GstBuf in arguments to this chain func.
>  // so check for DELTA UNIT flag in buf.
>  if (// buf has DELTA UNIT) 
>    goto ignore; 
> }

This will make it stall anyway, you need to keep pushing buffers from the
previous active pad. This code will drop buffers until the next keyframe which
cause a stall just like it does currently.

Here are few steps
1) Add a new enum property with 2 modes: immediate and next-keyframe to select
the switching behavior. There should be plenty of examples in element's code
adding enum properties, this is done on class_init()

2) Check the set_active_pad() that is the function that switches the active_pad
value. In your case you don't want that to happen until the to-be-activated pad
has a non-delta-unit buffer.

3) Keep in mind that the _chain() function is called for every buffer arriving
on all of the pads (active or inactive). You need to check if it is the pad to
be activated and check if the buffer is a non-delta, and then activate it, if
it is in your new operation mode.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list