Control VLC from inside a plugin

This forum is about all development around libVLC.
kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 10:00

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
Konstantin Miller
Technische Universität Berlin

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Control VLC from inside a plugin

Postby Jean-Baptiste Kempf » 12 Sep 2012 10:43

You mean a VLC plugin?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Re: Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 10:48

Yes, exactly. An access plugin, to be more precise.
Konstantin Miller
Technische Universität Berlin

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Control VLC from inside a plugin

Postby Jean-Baptiste Kempf » 12 Sep 2012 11:03

What do you want to be able to do?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Re: Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 11:23

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!
Konstantin Miller
Technische Universität Berlin

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Control VLC from inside a plugin

Postby Jean-Baptiste Kempf » 12 Sep 2012 12:05

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.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Re: Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 14:18

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.
Konstantin Miller
Technische Universität Berlin

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Control VLC from inside a plugin

Postby Rémi Denis-Courmont » 12 Sep 2012 15:29

You're not supposed to control the playlist from the access. That's going to cause lots of problems.

You're on your own.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Re: Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 15:47

If I understand you correctly, there is no "clean" way to pause playback from an access module?
Konstantin Miller
Technische Universität Berlin

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Control VLC from inside a plugin

Postby Jean-Baptiste Kempf » 12 Sep 2012 17:02

If I understand you correctly, there is no "clean" way to pause playback from an access module?
I doubt there is.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kostyan
Blank Cone
Blank Cone
Posts: 34
Joined: 15 Jun 2012 12:07
VLC version: 2.1.0-git
Operating System: Linux
Location: Berlin, Germany

Re: Control VLC from inside a plugin

Postby kostyan » 12 Sep 2012 17:27

Ok, thanks!
Konstantin Miller
Technische Universität Berlin


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests