libvlc_video_take_snapshot(): specify snapshot's height and width
authorRafaël Carré <funman@videolan.org>
Tue, 4 Dec 2007 20:01:07 +0000 (20:01 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 4 Dec 2007 20:01:07 +0000 (20:01 +0000)
include/vlc/libvlc.h
src/control/video.c

index 24ba614..64c17ba 100644 (file)
@@ -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
+ * 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 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
  */
-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 *);
 
index fbe1ee8..ba9d3b6 100644 (file)
@@ -127,7 +127,7 @@ void libvlc_toggle_fullscreen( libvlc_media_instance_t *p_mi,
 
 void
 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 );
     input_thread_t *p_input_thread;
@@ -144,6 +144,8 @@ libvlc_video_take_snapshot( libvlc_media_instance_t *p_mi, char *psz_filepath,
         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_mi->p_libvlc_instance->p_libvlc_int,