Page 1 of 1

Modifying the display callback API

Posted: 09 Mar 2017 22:55
by ryantheseer
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?

Re: Modifying the display callback API

Posted: 13 Mar 2017 09:32
by chouquette
To my knowledge, the only place which uses the display callbacks is the vmem module

Re: Modifying the display callback API

Posted: 14 Mar 2017 15:30
by ryantheseer
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!

Re: Modifying the display callback API

Posted: 15 Mar 2017 10:11
by chouquette
Glad you fixed it!