[gst-devel] How to perform frame-by-frame video playing

Albert Costa costa_albert at yahoo.fr
Fri Jun 19 18:02:29 CEST 2009

I'm trying to do the following:
I have an application that constructs and controls a pipeline. Merely, my pipe would be "filesink ! decodebin ! identity sync=true ! myfilter ! ffmpegcolorspace ! directdrawsink sync=false".
The element myfilter is currently just a pass-through element (it does not process anything). My goal is, from the application, to play the file only by moving a frame ahead when the user hits a key (in fact later that would be a signal sent by another process). My idea was to block the chain() function inside myfilter each time it is called, untill a release notification is sent. What I did so far is :
in the chain() :
    g_cond_wait(myfilter->process_next, myfilter->lock);
  g_mutex_unlock(myfilter ->lock);

In my application, I have a specific function that gets the sink pad of my filter element, and send a specific event on it.
In myfilter's sink_event function, I have a case of event type where I call g_cond_signal(myfilter->process_next) (which I thought would release the lock in the chain).
My problem is that when I launch the pipeline, the cond_wait does lock the chain function; but then in my application specific function, calling gst_pad_send_event never returns, and my event is thus not received by my element. Eveything hangs...
Is there any way to have it working somehow? (another option was to set the pipe in pause mode and send seek events to go to next frame, but i'm using mpeg2 ts files that do not support seek anyway, and I have other constraints for which I need an element that can be controled).
Any help would be appreciated,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090619/6f820711/attachment.htm>

More information about the gstreamer-devel mailing list