Commit a24c6166 authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Baptiste Kempf

Implement libvlc_video_get_size(), close #3679

(cherry picked from commit 8cf35578)
(cherry picked from commit e64c71e8)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d5983f30
...@@ -161,18 +161,24 @@ libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num, ...@@ -161,18 +161,24 @@ libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num, int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
unsigned *restrict px, unsigned *restrict py ) unsigned *restrict px, unsigned *restrict py )
{ {
#if 0 libvlc_media_track_info_t *info;
vout_thread_t *p_vout = GetVout (p_mi, num); int ret = -1;
if (p_vout == NULL) if (!p_mi->p_md)
return -1; return ret;
int infos = libvlc_media_get_tracks_info(p_mi->p_md, &info);
if (infos <= 0)
return ret;
for (int i = 0; i < infos; i++)
if (info[i].i_type == libvlc_track_video && num-- == 0) {
*px = info[i].u.video.i_width;
*py = info[i].u.video.i_height;
ret = 0;
break;
}
*px = p_vout->i_window_height; free(info);
*py = p_vout->i_window_width; return ret;
vlc_object_release (p_vout);
return 0;
#else
return -1;
#endif
} }
int libvlc_video_get_height( libvlc_media_player_t *p_mi ) int libvlc_video_get_height( libvlc_media_player_t *p_mi )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment