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

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Dec 16 15:57:27 PST 2015


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

--- Comment #12 from Thiago Sousa Santos <thiagossantos at gmail.com> ---
(In reply to Tapas Kumar Kundu from comment #11)
> (In reply to Thiago Sousa Santos from comment #10)
> > (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.
> 
> No it should not . Chain function is invoked for both active and inactive
> pads and i am checking whether this is invoked for active pad or not. If it
> is invoked on active pad and then only I am dropping for 'delta unit'

If you switch the pad immediately you will stop pushing buffers on the old pad
and downstream will receive no buffers until you get a keyframe, so yes. You
get a stall just like it happens today. You need to current active pad to keep
pushing buffers until the one you want to activate gets a keyframe.

> > 
> > 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.
> > 
> 
> If we do it in this way then the code which will use gst-input-selector,
> needs to activate same pad again and again untill it sees for activation is
> success. 

No, you will store some state that will mean that you are switching on the next
keyframe and that will happen in the _chain() function once a non delta buffer
arrives.

> 
> Please correct me if I am wrong. Thanks for your help

-- 
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