Playback speed and playbin - do they work together?

Alexandru Palade alexandru.palade at loopback.ro
Wed May 7 09:00:34 PDT 2014


This is my first project in gstreamer, so please pardon my newbie question.

I'm trying to make a combination of playbin example[1], and playback speed
example[2]. I want a video to loop indefinitely (using about-to-finish
signal), but I would like to be able to control the speed as well.
Here[3]'s my experiment so far. It works, but I do have quite a few
problems:

1) when the video is finished and it goes at the beginning, the playback
speed reverts to the original one. Only after I send a send_seek_event by
pressing a key it goes back to what is supposed to be.
2) when the video is finished playing and it needs to start again,
sometimes, it gets stuck for a few seconds and only then starts playing
again. Again, calling send_seek_event unfreezes it.

The whole day I tried to:
a) send_seek_event in 'about-to-finish' callback, it appears to fix #2, but
not #1
b) listen on the bus for STREAM_START message and call send_seek_event
then, doesn't work because it can't query the position in at line 28.
c) listen on the bus for STATE_CHANGED message and try to call
send_seek_event on different combinations of old state and new state, but I
always ended up in crashing the program
d) listen on the bus of ASYNC_DONE message and combined it with
STREAM_START, still no luck.

I'm assuming now that somehow the state of the playbin is important when to
call that send_seek_event so that playbin can restore the playback speed,
but I'm out of ideas where to try it. I've read on playbin's documentation
page that it should have no problem in taking gst_element_send_event.

Oh, and I'm in 1.x branch. I know that the examples are 0.1, but I've taken
the modified versions.

If you've read so far, thank you, I really appreciate it,
Alex

[1]
http://docs.gstreamer.com/display/GstSDK/Playback+tutorial+1%3A+Playbin2+usage
[2]
http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+13%3A+Playback+speed
[3] http://pastebin.com/ACWzwBxe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140507/5045e0fd/attachment.html>


More information about the gstreamer-devel mailing list