* \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)
*****************************************************************************/
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 )
{