Commit 13ed2b54 authored by Rafaël Carré's avatar Rafaël Carré

libvlc_video_take_snapshot(): specify snapshot's height and width

parent 01e7e3eb
...@@ -822,11 +822,15 @@ VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, l ...@@ -822,11 +822,15 @@ VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, l
/** /**
* Take a snapshot of the current video window * Take a snapshot of the current video window
* If i_width AND i_height is 0, original size is used
* if i_width XOR i_height is 0, original aspect-ratio is preserved
* \param p_input the input * \param p_input the input
* \param psz_filepath the path where to save the screenshot to * \param psz_filepath the path where to save the screenshot to
* \param i_width the snapshot's width
* \param i_height the snapshot's height
* \param p_exception an initialized exception * \param p_exception an initialized exception
*/ */
VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * ); VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *); VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
......
...@@ -127,7 +127,7 @@ void libvlc_toggle_fullscreen( libvlc_media_instance_t *p_mi, ...@@ -127,7 +127,7 @@ void libvlc_toggle_fullscreen( libvlc_media_instance_t *p_mi,
void void
libvlc_video_take_snapshot( libvlc_media_instance_t *p_mi, char *psz_filepath, libvlc_video_take_snapshot( libvlc_media_instance_t *p_mi, char *psz_filepath,
libvlc_exception_t *p_e ) unsigned int i_width, unsigned int i_height, libvlc_exception_t *p_e )
{ {
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
...@@ -144,6 +144,8 @@ libvlc_video_take_snapshot( libvlc_media_instance_t *p_mi, char *psz_filepath, ...@@ -144,6 +144,8 @@ libvlc_video_take_snapshot( libvlc_media_instance_t *p_mi, char *psz_filepath,
return; return;
} }
var_SetInteger( p_vout, "snapshot-width", i_width );
var_SetInteger( p_vout, "snapshot-height", i_height );
p_input_thread = (input_thread_t*)vlc_object_get( p_input_thread = (input_thread_t*)vlc_object_get(
p_mi->p_libvlc_instance->p_libvlc_int, p_mi->p_libvlc_instance->p_libvlc_int,
......
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