[gst-devel] Problem trying to fix dvdnavsrc.

Stefan Kost ensonic at hora-obscura.de
Wed Sep 5 19:21:45 CEST 2007


Hi,

Simone Gotti wrote:
> Hi all,
> 
> I'm trying to fix and complete the dvdnavsrc element.

Cool!

> 
> My first step is to fix a problem with some DVDs where after choosing a
> menu like "Chapter Selection" the played video is not animated but it's
> the same image for 20 or more seconds.
> 
> As dvdnavsrc inherits from gstpushsrc that inherits from gstbasesrc, it
> works in push mode.
> 
> GstBaseSrc:gst_base_src_loop is a GstPad task so it's continously
> called, it in turns calls the gst_dvd_nav_src_create function, that asks
> for a data buffer from dvdnav.
> because with this type of unanimated videos the demux sink doesn't need
> other buffers, after some cycles gst_base_src_loop calls gst_pad_push
> that will block.
> 
> In this state every menu selection (click on the image) isn't managed as
> dvdnav_get_next_block isn't called as gst_base_src_loop is blocked on
> gst_pad_push.
> Only after the video ends the demux sink accepts again buffers and the
> event is managed.
> 
> Trying to fix this I found this solution:
> 
> When we manage the navigation event we'll also call
> dvdnav_get_next_block, and if it returns an event of type
> DVDNAV_HOP_CHANNEL (that means that a new video needs to be played and a
> flush on the fifos is needed) we send a flush event (all this needs to
> be managed in a sort of dvdnavsrc internal queue as I can click at
> everytime getting also other events or data block that needs to be
> passed to gst_dvd_nav_src_create and cannot be lost).
> 
> The problem is:
> 
> when the flush event is sent gst_pad_push will finally return with a
> GST_FLOW_WRONG_STATE and gst_base_src_loop will pause itself so it's
> never called again.
> 
> To reschedule it a call to gst_pad_start_task is needed after the flush
> but gst_base_src_loop isn't exported so it cannot be used inside
> dvdnavsrc.

I think you shoudl call gst_pad_start_task() yourself. Look at qtdemux or
avidemux in gst-plugins-good. They do this after they perormed a seek.

> 
> To test it I changed gstbasesrc to export it and all worked quite well.
> 
> But I'm searching for a correct solution (if there's one) without
> changing the code of gstbasesrc.
> 
> Has anyone an hint?
> 
> Thanks a lot!
> 
> Bye!

It would rock, if you could add a top-level comment to dvdnavsrc.c (like other
plugin have) that has a brief description and an example gst-launch line.

Ciao
  Stefan




More information about the gstreamer-devel mailing list