Videomixer race when seeking/flushing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Videomixer race when seeking/flushing

Thadeu Lima de Souza Cascardo
Hello, there.

We work on a streaming application (sltv) and we are trying to implement
the following functionality: While some live source is playing, the user
select a file to be played from start to end and then go back to the
live source. Perhaps, the file will be played on a loop until the user
switches back to the live source.

Our previous solution to switching live sources included input-selector.
Now, we are using videomixer. When introducing the filesrc and doing
seek to start playing it from the start, we get the following race:

1) videomixer sets all pads to flushing using gst_collect_pads_set_flushing
2) One of the live sources has pushed and collectpads chain is executing
3) Since the pad is now flushing, the chain function fails with
GST_FLOW_WRONG_STATE
4) This source is now stopped
5) The other sources push, and collectpads chain function will put them
to wait
6) They will wait forever, since one of the sources is stopped

I would like to get some feedback on what would be the best solution to
this problem. Whether this is a problem in GStreamer or one of the
elements or a problem in our pipeline. Perhaps, this should never be
used like this and we should go look for another solution, instead of
using videomixer and seeking.

Some of the things I thought of trying and any problems I see are
described below. That's where I want feedback the most if the problem
should be solved in GStreamer or one of the elements/libs.

1) Set the element or the pipeline state to paused and, then, set it to
playing. This may be a solution, because that'll put the live source
back on pushing. However, this must be synchronized with the end of
flushing. And it will not end until all sources push to collectpads.

This likely implies the problem lies in videomixer/collectpads.

2) Do not let collectpads chain function return GST_FLOW_WRONG_STATE
when it's flushing. The seek/flush operation, then, will be serialized
with the chain function. But, then, should FLUSH_STOP be sent
immediately or should videomixer wait for all sources send the
FLUSH_STOP and, then, send it? Will non-seekable sources send
FLUSH_START/FLUSH_STOP when videomixer tries to seek them?

3) Handle GST_FLOW_WRONG_STATE differently. But how should it be
handled?

If I recall any other ideas, I will send a followup. Meanwhile, any
feedback on this particular problem?

Best regards,
Cascardo.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (853 bytes) Download Attachment