From: Filippo Carone Date: Sun, 4 Jun 2006 19:26:55 +0000 (+0000) Subject: * added video height/width getters in libvlc X-Git-Tag: 0.9.0-test0~11071 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=33983554b25e79aad349e6703573449f7799e672;p=vlc * added video height/width getters in libvlc * libvlc playlist play uses locking --- diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h index a7c0dbe6e0..d3ffa42d21 100644 --- a/include/vlc/libvlc.h +++ b/include/vlc/libvlc.h @@ -269,8 +269,6 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *); vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *); float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *); vlc_bool_t libvlc_input_will_play( libvlc_input_t *, libvlc_exception_t *); - - /** @} */ @@ -302,8 +300,29 @@ void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * ); * \return the fullscreen status (boolean) */ int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * ); + +/** + * Get current video height + * \param p_input the input + * \param p_exception an initialized exception + * \return the video height + */ +int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * ); +/** + * Get current video width + * \param p_input the input + * \param p_exception an initialized exception + * \return the video width + */ +int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * ); +/** + * Take a snapshot of the current video window + * \param p_input the input + * \param psz_filepath the path where to save the screenshot to + * \param p_exception an initialized exception + */ void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * ); diff --git a/src/control/playlist.c b/src/control/playlist.c index dc93eb4ffa..89d35c151d 100644 --- a/src/control/playlist.c +++ b/src/control/playlist.c @@ -46,7 +46,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id, libvlc_exception_raise( p_exception, "Unable to find item " ); return; } - playlist_Control( p_instance->p_playlist, PLAYLIST_VIEWPLAY, + playlist_LockControl( p_instance->p_playlist, PLAYLIST_VIEWPLAY, p_instance->p_playlist->status.p_node, p_item ); } else diff --git a/src/control/video.c b/src/control/video.c index 4c924a3053..0f09c6ab3a 100644 --- a/src/control/video.c +++ b/src/control/video.c @@ -125,7 +125,7 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input, } void -libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, +libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath, libvlc_exception_t *p_e ) { vout_thread_t *p_vout = GetVout( p_input, p_e ); @@ -148,7 +148,7 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, return NULL; } - snprintf( path, 255, "%s", filepath ); + snprintf( path, 255, "%s", psz_filepath ); var_SetString( p_vout, "snapshot-path", path ); var_SetString( p_vout, "snapshot-format", "png" ); @@ -158,3 +158,27 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, return; } + +int libvlc_video_get_height( libvlc_input_t *p_input, + libvlc_exception_t *p_e ) +{ + vout_thread_t *p_vout1 = GetVout( p_input, p_e ); + if( !p_vout1 ) + return 0; + + vlc_object_release( p_vout1 ); + + return p_vout1->i_window_height; +} + +int libvlc_video_get_width( libvlc_input_t *p_input, + libvlc_exception_t *p_e ) +{ + vout_thread_t *p_vout1 = GetVout( p_input, p_e ); + if( !p_vout1 ) + return 0; + + vlc_object_release( p_vout1 ); + + return p_vout1->i_window_width; +}