I am listening for the events libvlc_MediaParsedChanged and libvlc_MediaMetaChanged (trying both for now until I can get this). Inside the events I am trying two approaches to get the size, the first is:
Code: Select all
libvlc_media_track_info_t * tracks = NULL;
libvlc_media_get_tracks_info(media, &tracks);
if( tracks )
{
int width = tracks->u.video.i_width;
int height = tracks->u.video.i_height;
print( "%d x %d", width, height);
free(tracks);
}
else
{
print("tracks is NULL"); <-- this is what happens.
}
Code: Select all
libvlc_video_get_size(player, 0, &width, &height);
print("%d x %d", width, height); <-- "0 x 0" is what gets printed
For some background I am trying to get the video size so that I can create my OpenGL textures to the appropriate size for the video to be rendered into as opposed to having libvlc scale the video (which I am trying to avoid).
Thanks.