Page 1 of 1

Control VLC from inside a plugin

Posted: 12 Sep 2012 10:00
by kostyan
Not sure if this is the right section for my question.

What is the preferred way to control VLC programmatically from inside a plugin? I have written a plugin and at some point in time I would like to, let's say, pause or stop the ongoing playback from the plugin's code. Is there some clean way to do that?

In GStreamer, e.g., there is a bus on which all modules can communicate with each other. Maybe something like that?

Thanks!

Best,
Konstantin

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 10:43
by Jean-Baptiste Kempf
You mean a VLC plugin?

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 10:48
by kostyan
Yes, exactly. An access plugin, to be more precise.

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 11:03
by Jean-Baptiste Kempf
What do you want to be able to do?

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 11:23
by kostyan
Thanks for the fast replies.

I have developed an access plugin implementing the MPEG DASH streaming format. In order to implement some extra functionality, I would like to be able to pause the playback and eventually resume it later at a different position. I could stop delivering data to the read() function for some time but then the content of the post-decoder buffers would probably still be played out. Instead, I would like to immediately pause the playback and, if possible, even discard the content of all buffers/caches along the demuxer/decoder/output chain.

Another desired functionality would be to set the playback to PAUSE from inside the plugin before the playback has started BUT at the same time to already fill the buffers/caches along the playback chain so that once I want to start the playback, the delay is minimized.

Background: As his master thesis, a student is developing an extension to my DASH plugin that will support changing the playback device during a streaming session (e.g., watching video on smartphone -> detected big screen in proximity -> playback synchronously starts on the big screen).

Thanks!

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 12:05
by Jean-Baptiste Kempf
You do know that there is a Dash module in VLC, right?
Anyway, you probably need to access the main playlist (mother of the input) and there you can play/pause.

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 14:18
by kostyan
Yes, I know. I prefer to have my own code to make it easier to experiment with it. Further, my plugin will support peer-to-peer streaming over DASH.
Thanks for the hint, the playlist_Pause() function works for me. Now I need to find out if it is possible to pre-fill the post-decoder caches while in paused state and to empty them on demand.

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 15:29
by RĂ©mi Denis-Courmont
You're not supposed to control the playlist from the access. That's going to cause lots of problems.

You're on your own.

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 15:47
by kostyan
If I understand you correctly, there is no "clean" way to pause playback from an access module?

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 17:02
by Jean-Baptiste Kempf
If I understand you correctly, there is no "clean" way to pause playback from an access module?
I doubt there is.

Re: Control VLC from inside a plugin

Posted: 12 Sep 2012 17:27
by kostyan
Ok, thanks!