Reusing osxvideosink

Илья Кулаков kulakov.ilya at gmail.com
Tue Jun 25 09:42:58 PDT 2013


Hi,

I'm trying to reuse pipeline which ends which is essentially "filesrc ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! osxvideosink

The code can be reduced to:

1. Init and add elements. register "pad-added" signal on qtdemux
2. Set location of filesrc
3. Set state of the pipeline to PLAYING
4. Wait for EOS using gst_bus_timed_pop_filtered
5. Set state of the pipeline to READY
6. Set new location of filesrc
7. Set state of the pipeline to PLAYING

Unfortunately the deadlock occurs at step 7. Sometimes, when I run it through debugger it is able to create new window but that's all because it is stuck in deadlock again.
Stack shown that thread is stuck in waiting for completion of the command which is deferred to another, specifically created thread for Cocoa.

Since I'm primarily Mac OS X / Cocoa developer I decided to look into implementation.

First of all what is the particular reason to set up new thread and run loop for each instance of osxvideosink?
Then it looks like thread/run loop can be started multiple times for the same instance each time you go ready -> playing.
Also why is window created (destroyed) when we go from ready -> playing (and vice versa). I think it would be wise and better to reuse it unless state is transitioned to NULL.

I would be able to fix and address all of these issues, but I'd like to know whether it would make sense and be accepted by the community.


Best regards, 
Ilya Kulakov



More information about the gstreamer-devel mailing list