]> 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

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

index 6ec4161b9473d899c522af018b20b7fc7f2c9eb2,2cb82e11034c42b79115efd043f41fdfd06aa1eb..93053490ec6c97ca53f7f33fb25a711b68ac0b16
@@@ -68,9 -68,91 +68,9 @@@ VLC_DEPRECATED_API void libvlc_media_pl
   * \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 * );
  
 -/**
 - * Set the default video output's parent.
 - *
 - * This setting will be used as default for any video output.
 - *
 - * \param p_instance libvlc instance
 - * \param drawable the new parent window
 - *                 (see libvlc_media_player_set_drawable() for details)
 - * \param p_e an initialized exception pointer
 - * @deprecated Use libvlc_media_player_set_drawable
 - */
 -VLC_DEPRECATED_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
 -
 -/**
 - * Set the default video output parent.
 - *
 - * This setting will be used as default for all video outputs.
 - *
 - * \param p_instance libvlc instance
 - * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
 - * \param p_e an initialized exception pointer
 - * @deprecated Use libvlc_media_player_get_drawable
 - */
 -VLC_DEPRECATED_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
 -
 -/**
 - * Does nothing. Do not use this function.
 - */
 -VLC_DEPRECATED_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
 -
 -/**
 - * Resize the current video output window.
 - * This might crash. Please use libvlc_video_set_scale() instead.
 - *
 - * \param p_mi media player instance
 - * \param width new width for video output window
 - * \param height new height for video output window
 - * \param p_e an initialized exception pointer
 - * \return the success status (boolean)
 - */
 -VLC_DEPRECATED_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
 -
 -/**
 - * Tell windowless video output to redraw rectangular area (MacOS X only).
 - * This might crash. Do not use this function.
 - *
 - * \param p_mi media player instance
 - * \param area coordinates within video drawable
 - * \param p_e an initialized exception pointer
 - */
 -VLC_DEPRECATED_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
 -
 -/**
 - * Set the default video output size.
 - * This setting will be used as default for all video outputs.
 - *
 - * \param p_instance libvlc instance
 - * \param width new width for video drawable
 - * \param height new height for video drawable
 - * \param p_e an initialized exception pointer
 - */
 -VLC_DEPRECATED_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
 -
 -/**
 - * Set the default video output viewport for a windowless video output
 - * (MacOS X only). This might crash. Do not use this function.
 - *
 - * This setting will be used as default for all video outputs.
 - *
 - * \param p_instance libvlc instance
 - * \param p_mi media player instance
 - * \param view coordinates within video drawable
 - * \param clip coordinates within video drawable
 - * \param p_e an initialized exception pointer
 - */
 -VLC_DEPRECATED_API void libvlc_video_set_viewport( libvlc_instance_t *, libvlc_media_player_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
 -
 -/*
 - * This function shall not be used at all. It may lead to crash and race condition.
 - */
 -VLC_DEPRECATED_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
 -
  /*****************************************************************************
   * Playlist (Deprecated)
   *****************************************************************************/
index d07a69284b6ff4ce53212ecfccb65859ae4cb612,7904aa29fbef50b98b403968a3eee65da7e62fb3..fd62e005a72deb7e165116d887fa2994e2d7b3f9
@@@ -187,6 -187,184 +187,33 @@@ int libvlc_media_player_has_vout( libvl
      return has_vout;
  }
  
 -int libvlc_video_reparent( libvlc_media_player_t *p_mi, libvlc_drawable_t d,
 -                           libvlc_exception_t *p_e )
 -{
 -    (void) p_mi; (void) d;
 -    libvlc_exception_raise(p_e, "Reparenting not supported");
 -    return -1;
 -}
 -
 -void libvlc_video_resize( libvlc_media_player_t *p_mi, int width, int height, libvlc_exception_t *p_e )
 -{
 -    vout_thread_t *p_vout = GetVout( p_mi, p_e );
 -    if( p_vout )
 -    {
 -        vout_Control( p_vout, VOUT_SET_SIZE, width, height );
 -        vlc_object_release( p_vout );
 -    }
 -}
 -
 -void libvlc_video_redraw_rectangle( libvlc_media_player_t *p_mi,
 -                           const libvlc_rectangle_t *area,
 -                           libvlc_exception_t *p_e )
 -{
 -#ifdef __APPLE__
 -    if( (NULL != area)
 -     && ((area->bottom - area->top) > 0)
 -     && ((area->right - area->left) > 0) )
 -    {
 -        vout_thread_t *p_vout = GetVout( p_mi, p_e );
 -        if( p_vout )
 -        {
 -            /* tell running vout to redraw area */
 -            vout_Control( p_vout , VOUT_REDRAW_RECT,
 -                               area->top, area->left, area->bottom, area->right );
 -            vlc_object_release( p_vout );
 -        }
 -    }
 -#else
 -    (void) p_mi; (void) area; (void) p_e;
 -#endif
 -}
 -
 -/* global video settings */
 -
 -/* Deprecated use libvlc_media_player_set_drawable() */
 -void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
 -                              libvlc_exception_t *p_e )
 -{
 -    /* set as default for future vout instances */
 -#ifdef WIN32
 -    vlc_value_t val;
 -
 -    if( sizeof(HWND) > sizeof(libvlc_drawable_t) )
 -        return; /* BOOM! we told you not to use this function! */
 -    val.p_address = (void *)(uintptr_t)d;
 -    var_Set( p_instance->p_libvlc_int, "drawable-hwnd", val );
 -#elif defined(__APPLE__)
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-agl", d );
 -#else
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-xid", d );
 -#endif
 -
 -    libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
 -    if( p_mi )
 -    {
 -        libvlc_media_player_set_drawable( p_mi, d, p_e );
 -        libvlc_media_player_release(p_mi);
 -    }
 -}
 -
 -/* Deprecated use libvlc_media_player_get_drawable() */
 -libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
 -{
 -    VLC_UNUSED(p_e);
 -
 -#ifdef WIN32
 -    vlc_value_t val;
 -
 -    if( sizeof(HWND) > sizeof(libvlc_drawable_t) )
 -        return 0;
 -    var_Get( p_instance->p_libvlc_int, "drawable-hwnd", &val );
 -    return (uintptr_t)val.p_address;
 -#elif defined(__APPLE__)
 -    return var_GetInteger( p_instance->p_libvlc_int, "drawable-agl" );
 -#else
 -    return var_GetInteger( p_instance->p_libvlc_int, "drawable-xid" );
 -#endif
 -}
 -
 -void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
 -                           libvlc_exception_t *p_e )
 -{
 -    /* set as default for future vout instances */
 -    config_PutInt(p_instance->p_libvlc_int, "width", width);
 -    config_PutInt(p_instance->p_libvlc_int, "height", height);
 -
 -    libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
 -    if( p_mi )
 -    {
 -        vout_thread_t *p_vout = GetVout( p_mi, p_e );
 -        if( p_vout )
 -        {
 -            /* tell running vout to re-size */
 -            vout_Control( p_vout , VOUT_SET_SIZE, width, height);
 -            vlc_object_release( p_vout );
 -        }
 -        libvlc_media_player_release(p_mi);
 -    }
 -}
 -
 -void libvlc_video_set_viewport( libvlc_instance_t *p_instance, libvlc_media_player_t *p_mi,
 -                            const libvlc_rectangle_t *view, const libvlc_rectangle_t *clip,
 -                           libvlc_exception_t *p_e )
 -{
 -#ifdef __APPLE__
 -    if( !view )
 -    {
 -        libvlc_exception_raise( p_e, "viewport is NULL" );
 -        return;
 -    }
 -
 -    /* if clip is NULL, then use view rectangle as clip */
 -    if( !clip )
 -        clip = view;
 -
 -    /* set as default for future vout instances */
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-top", view->top );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-left", view->left );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-bottom", view->bottom );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-right", view->right );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-top", clip->top );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-left", clip->left );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-bottom", clip->bottom );
 -    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-right", clip->right );
 -
 -    if( p_mi )
 -    {
 -        vout_thread_t *p_vout = GetVout( p_mi, p_e );
 -        if( p_vout )
 -        {
 -            /* change viewport for running vout */
 -            vout_Control( p_vout, VOUT_SET_VIEWPORT,
 -                               view->top, view->left, view->bottom, view->right,
 -                               clip->top, clip->left, clip->bottom, clip->right );
 -            vlc_object_release( p_vout );
 -        }
 -    }
 -#else
 -    (void) p_instance; (void) view; (void) clip; (void) p_e;
 -#endif
 -}
 -
+ 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 )
  {
diff --cc src/libvlc.sym
index b1b5117e8e16d25093617b0dfd042c8f208780c2,8da4a03fe3eeceaff94622b89b1c2c957c21f121..c8c489b4c042927fc5966a641f959dc4e203d6b9
@@@ -179,6 -198,8 +179,7 @@@ libvlc_video_get_aspect_rati
  libvlc_video_get_chapter_description
  libvlc_video_get_crop_geometry
  libvlc_video_get_height
 -libvlc_video_get_parent
+ libvlc_video_get_scale
  libvlc_video_get_spu
  libvlc_video_get_spu_count
  libvlc_video_get_spu_description
@@@ -188,8 -209,14 +189,9 @@@ libvlc_video_get_trac
  libvlc_video_get_track_count
  libvlc_video_get_track_description
  libvlc_video_get_width
 -libvlc_video_redraw_rectangle
 -libvlc_video_reparent
 -libvlc_video_resize
  libvlc_video_set_aspect_ratio
  libvlc_video_set_crop_geometry
 -libvlc_video_set_parent
+ libvlc_video_set_scale
 -libvlc_video_set_size
  libvlc_video_set_spu
  libvlc_video_set_subtitle_file
  libvlc_video_set_teletext