[gst-devel] Problem trying to fix dvdnavsrc.

Simone Gotti simone.gotti at email.it
Tue Sep 4 12:23:43 CEST 2007

Hi all,

I'm trying to fix and complete the dvdnavsrc element.

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

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!


Simone Gotti
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070904/66d1af71/attachment.pgp>

More information about the gstreamer-devel mailing list