Modifying the display callback API

This forum is about all development around libVLC.
ryantheseer
Blank Cone
Blank Cone
Posts: 15
Joined: 16 Feb 2017 20:19

Modifying the display callback API

Postby ryantheseer » 09 Mar 2017 22:55

I'm trying to modify the display callback API, starting from lib/media_player.c and its libvlc_video_set_callbacks(...) method, branching the code from the 2.2.4 tag (commit 888b7e89). I'm currently building LibVLC cross-platform for 64-bit Windows, and hooking in through Java in Eclipse. I want to modify the display callback so that it provides the image frame's time stamp. The callback type is defined as below in include/vlc/libvlc_media_player.h:

Code: Select all

/** * Callback prototype to display a picture. * * When the video frame needs to be shown, as determined by the media playback * clock, the display callback is invoked. * * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN] * \param picture private pointer returned from the @ref libvlc_video_lock_cb * callback [IN] */ typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
Then, when libvlc_video_set_callbacks(...) is called, the only implementation I can find is in lib/media_player.c:

Code: Select all

void libvlc_video_set_callbacks( libvlc_media_player_t *mp, void *(*lock_cb) (void *, void **), void (*unlock_cb) (void *, void *, void *const *), void (*display_cb) (void *, void *), void *opaque ) { var_SetAddress( mp, "vmem-lock", lock_cb ); var_SetAddress( mp, "vmem-unlock", unlock_cb ); var_SetAddress( mp, "vmem-display", display_cb ); var_SetAddress( mp, "vmem-data", opaque ); var_SetString( mp, "vout", "vmem" ); var_SetString( mp, "avcodec-hw", "none" ); }
After that, I lose the trail and can't find which implementation of display_cb is being called - and when I receive the callback, both of the pointers are NULL. Can anyone help me?

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: Modifying the display callback API

Postby chouquette » 13 Mar 2017 09:32

To my knowledge, the only place which uses the display callbacks is the vmem module

ryantheseer
Blank Cone
Blank Cone
Posts: 15
Joined: 16 Feb 2017 20:19

Re: Modifying the display callback API

Postby ryantheseer » 14 Mar 2017 15:30

That's right. I solved the issue, which was that I had an environment variable pointing to the wrong location of my built binaries. Oops!

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: Modifying the display callback API

Postby chouquette » 15 Mar 2017 10:11

Glad you fixed it!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests