]> git.sesse.net Git - vlc/commitdiff
Merge branch 1.0-bugfix
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 13 May 2009 18:57:34 +0000 (21:57 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 13 May 2009 18:57:34 +0000 (21:57 +0300)
Conflicts:
include/vlc/deprecated.h
src/control/video.c
src/libvlc.sym

include/vlc/deprecated.h
include/vlc/libvlc.h
src/control/video.c
src/libvlc.sym

index 6ec4161b9473d899c522af018b20b7fc7f2c9eb2..93053490ec6c97ca53f7f33fb25a711b68ac0b16 100644 (file)
@@ -58,7 +58,7 @@ extern "C" {
  *        should render its video
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
+VLC_DEPRECATED_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
 
 /**
  * Get the drawable where the media player should render its video output
@@ -68,7 +68,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *,
  * \return the libvlc_drawable_t where the media player
  *         should render its video
  */
-VLC_PUBLIC_API libvlc_drawable_t
+VLC_DEPRECATED_API libvlc_drawable_t
                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /*****************************************************************************
index 87e7275046f3a9807fddaeb19b2e576ba3eee5ff..c4038a6ee91a9d41ae1f0545bf601108272d1f29 100644 (file)
@@ -886,6 +886,31 @@ VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exce
  */
 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
 
+/**
+ * Get the current video scaling factor.
+ * See also libvlc_video_set_scale().
+ *
+ * \param p_mediaplayer the media player
+ * \return the currently configured zoom factor, or 0. if the video is set
+ * to fit to the output window/drawable automatically.
+ */
+VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *,
+                                             libvlc_exception_t *p_e );
+
+/**
+ * Set the video scaling factor. That is the ratio of the number of pixels on
+ * screen to the number of pixels in the original decoded video in each
+ * dimension. Zero is a special value; it will adjust the video to the output
+ * window/drawable (in windowed mode) or the entire screen.
+ *
+ * Note that not all video outputs support scaling.
+ *
+ * \param p_mediaplayer the media player
+ * \param i_factor the scaling factor, or zero
+ */
+VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float,
+                                            libvlc_exception_t *p_e );
+
 /**
  * Get current video aspect ratio.
  *
index d07a69284b6ff4ce53212ecfccb65859ae4cb612..fd62e005a72deb7e165116d887fa2994e2d7b3f9 100644 (file)
 static vout_thread_t *GetVout( libvlc_media_player_t *p_mi,
                                libvlc_exception_t *p_exception )
 {
-    input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_exception );
+    input_thread_t *p_input = libvlc_get_input_thread( p_mi, p_exception );
     vout_thread_t *p_vout = NULL;
 
-    if( p_input_thread )
+    if( p_input )
     {
-        p_vout = input_GetVout( p_input_thread );
+        p_vout = input_GetVout( p_input );
         if( !p_vout )
         {
             libvlc_exception_raise( p_exception, "No active video output" );
         }
-        vlc_object_release( p_input_thread );
+        vlc_object_release( p_input );
     }
     return p_vout;
 }
@@ -187,6 +187,33 @@ int libvlc_media_player_has_vout( libvlc_media_player_t *p_mi,
     return has_vout;
 }
 
+float libvlc_video_get_scale( libvlc_media_player_t *p_mp,
+                              libvlc_exception_t *p_e )
+{
+    vout_thread_t *p_vout = GetVout( p_mp, p_e );
+    if( !p_vout )
+        return 0.;
+
+    float f_scale = var_GetFloat( p_vout, "scale" );
+    if( var_GetBool( p_vout, "autoscale" ) )
+        f_scale = 0.;
+    vlc_object_release( p_vout );
+    return f_scale;
+}
+
+void libvlc_video_set_scale( libvlc_media_player_t *p_mp, float f_scale,
+                             libvlc_exception_t *p_e )
+{
+    vout_thread_t *p_vout = GetVout( p_mp, p_e );
+    if( !p_vout )
+        return;
+
+    if( f_scale != 0. )
+        var_SetFloat( p_vout, "scale", f_scale );
+    var_SetBool( p_vout, "autoscale", f_scale != 0. );
+    vlc_object_release( p_vout );
+}
+
 char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi,
                                      libvlc_exception_t *p_e )
 {
index b1b5117e8e16d25093617b0dfd042c8f208780c2..c8c489b4c042927fc5966a641f959dc4e203d6b9 100644 (file)
@@ -179,6 +179,7 @@ libvlc_video_get_aspect_ratio
 libvlc_video_get_chapter_description
 libvlc_video_get_crop_geometry
 libvlc_video_get_height
+libvlc_video_get_scale
 libvlc_video_get_spu
 libvlc_video_get_spu_count
 libvlc_video_get_spu_description
@@ -190,6 +191,7 @@ libvlc_video_get_track_description
 libvlc_video_get_width
 libvlc_video_set_aspect_ratio
 libvlc_video_set_crop_geometry
+libvlc_video_set_scale
 libvlc_video_set_spu
 libvlc_video_set_subtitle_file
 libvlc_video_set_teletext