Get current media for a snapshot

This forum is about all development around libVLC.
Vaselinessa
Blank Cone
Blank Cone
Posts: 48
Joined: 03 Apr 2011 02:26
Location: Sacramento, CA

Get current media for a snapshot

Postby Vaselinessa » 05 Jul 2012 03:44

I'm trying to take a snapshot from the current media. I see that the LIBVLC_API function libvlc_video_take_snapshot is available to me, but I don't know how to get a hold of a pointer to the current media player (it's a param for the function). I see that I could (or should?) create a new media player using the LIBVLC_API function libvlc_media_player_new_from_media, but I don't know how to get a pointer to the current media.

Can anyone help me figure this out?

(Actually, I really want to create a QPixmap from the current media. If there's a shorter way of doing this, I could use an outline.)

Thomas_Lerman
New Cone
New Cone
Posts: 3
Joined: 03 Jul 2012 07:56

Re: Get current media for a snapshot

Postby Thomas_Lerman » 05 Jul 2012 07:23

I presume you are using something like the LibVLC SampleCode Qt? In any case, you probably have in your constructor a call to

Code: Select all

_mp = libvlc_media_player_new (_vlcinstance, &_vlcexcep);
This is the same variable that is passed into the function you are asking about. It is actually the same variable used in many other functions too. I hope this helps.

Vaselinessa
Blank Cone
Blank Cone
Posts: 48
Joined: 03 Apr 2011 02:26
Location: Sacramento, CA

Re: Get current media for a snapshot

Postby Vaselinessa » 06 Jul 2012 04:17

I suppose I am using something like that (I'm using the Qt gui, which loads by default). However I can't find any calls to libvlc_media_player_new among its files, though I have searched any number of times.

I do, however find a few calls in doc/libvlc/wx_player.cpp and doc/libvlc/qtk_player.c. Furthermore, I find a pointer to a libvlc_media_player_t in doc/libvlc/QtPlayer; however, the files in that directory are not part of the application (or apparently not, at least). Have you found any calls to libvlc_media_player_new in the Qt files or at least in the main application and not part of the Wx or Gtk interfaces? (And not in vlc-thumb.c.)

I'm working with the 2.X source.


Return to “Development around libVLC”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests