Modifying the display callback API
Posted: 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:
Then, when libvlc_video_set_callbacks(...) is called, the only implementation I can find is in lib/media_player.c:
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?
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);
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" );
}