Commit a2d6f90b authored by Damien Fouilleul's avatar Damien Fouilleul

- added libvlc_video_set/get_crop_geometry() api

parent 4ce5cc27
......@@ -290,8 +290,24 @@ int libvlc_input_get_state ( libvlc_input_t *, libvlc_exception_t *
* @{
*/
/**
* Downcast to this general type as placeholder for a platform specific one, such as:
* Drawable on X11,
* CGrafPort on MacOSX,
* HWND on win32
*/
typedef int libvlc_drawable_t;
/**
* Rectangle type for video geometry
*/
typedef struct
{
int top, left;
int bottom, right;
}
libvlc_rectangle_t;
/**
* Does this input have a video output ?
* \param p_input the input
......@@ -355,6 +371,22 @@ char *libvlc_video_get_aspect_ratio( libvlc_input_t *, libvlc_exception_t * );
*/
void libvlc_video_set_aspect_ratio( libvlc_input_t *, char *, libvlc_exception_t * );
/**
* Get current crop filter geometry
* \param p_input the input
* \param p_exception an initialized exception
* \return the crop filter geometry
*/
char *libvlc_video_get_crop_geometry( libvlc_input_t *, libvlc_exception_t * );
/**
* Set new crop filter geometry
* \param p_input the input
* \param psz_geometry new crop filter geometry
* \param p_exception an initialized exception
*/
void libvlc_video_set_crop_geometry( libvlc_input_t *, char *, libvlc_exception_t * );
/**
* Take a snapshot of the current video window
* \param p_input the input
......@@ -375,13 +407,6 @@ int libvlc_video_destroy( libvlc_input_t *, libvlc_exception_t *);
*/
void libvlc_video_resize( libvlc_input_t *, int, int, libvlc_exception_t *);
/**
* Downcast to this general type as placeholder for a platform specific one, such as:
* Drawable on X11,
* CGrafPort on MacOSX,
* HWND on win32
*/
/**
* change the parent for the current the video output
* \param p_instance libvlc instance
......@@ -410,19 +435,6 @@ void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exc
*/
void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
/**
* Downcast to this general type as placeholder for a platform specific one, such as:
* Drawable on X11,
* CGrafPort on MacOSX,
* HWND on win32
*/
typedef struct
{
int top, left;
int bottom, right;
}
libvlc_rectangle_t;
/**
* Set the default video output viewport for a windowless video output (MacOS X only)
* this settings will be used as default for all video outputs
......
......@@ -357,6 +357,37 @@ void libvlc_video_set_aspect_ratio( libvlc_input_t *p_input,
vlc_object_release( p_vout );
}
char *libvlc_video_get_crop_geometry( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
char *psz_geometry = 0;
vout_thread_t *p_vout = GetVout( p_input, p_e );
if( !p_vout )
return 0;
psz_geometry = var_GetString( p_vout, "crop" );
vlc_object_release( p_vout );
return psz_geometry;
}
void libvlc_video_set_crop_geometry( libvlc_input_t *p_input,
char *psz_geometry, libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
int i_ret = -1;
if( !p_vout )
return;
i_ret = var_SetString( p_vout, "crop", psz_geometry );
if( i_ret )
libvlc_exception_raise( p_e,
"Unexpected error while setting crop geometry" );
vlc_object_release( p_vout );
}
int libvlc_video_destroy( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
......
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