Commit 33983554 authored by Filippo Carone's avatar Filippo Carone

* added video height/width getters in libvlc

* libvlc playlist play uses locking
parent 840f845c
...@@ -270,8 +270,6 @@ vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *); ...@@ -270,8 +270,6 @@ vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *);
float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *); float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *);
vlc_bool_t libvlc_input_will_play( libvlc_input_t *, libvlc_exception_t *); vlc_bool_t libvlc_input_will_play( libvlc_input_t *, libvlc_exception_t *);
/** @} */ /** @} */
/** defgroup libvlc_video Video /** defgroup libvlc_video Video
...@@ -303,7 +301,28 @@ void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * ); ...@@ -303,7 +301,28 @@ void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * );
*/ */
int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * ); int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
/**
* Get current video height
* \param p_input the input
* \param p_exception an initialized exception
* \return the video height
*/
int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * );
/**
* Get current video width
* \param p_input the input
* \param p_exception an initialized exception
* \return the video width
*/
int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * );
/**
* Take a snapshot of the current video window
* \param p_input the input
* \param psz_filepath the path where to save the screenshot to
* \param p_exception an initialized exception
*/
void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * ); void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
......
...@@ -46,7 +46,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id, ...@@ -46,7 +46,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
libvlc_exception_raise( p_exception, "Unable to find item " ); libvlc_exception_raise( p_exception, "Unable to find item " );
return; return;
} }
playlist_Control( p_instance->p_playlist, PLAYLIST_VIEWPLAY, playlist_LockControl( p_instance->p_playlist, PLAYLIST_VIEWPLAY,
p_instance->p_playlist->status.p_node, p_item ); p_instance->p_playlist->status.p_node, p_item );
} }
else else
......
...@@ -125,7 +125,7 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input, ...@@ -125,7 +125,7 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input,
} }
void void
libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
vout_thread_t *p_vout = GetVout( p_input, p_e ); vout_thread_t *p_vout = GetVout( p_input, p_e );
...@@ -148,7 +148,7 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, ...@@ -148,7 +148,7 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
return NULL; return NULL;
} }
snprintf( path, 255, "%s", filepath ); snprintf( path, 255, "%s", psz_filepath );
var_SetString( p_vout, "snapshot-path", path ); var_SetString( p_vout, "snapshot-path", path );
var_SetString( p_vout, "snapshot-format", "png" ); var_SetString( p_vout, "snapshot-format", "png" );
...@@ -158,3 +158,27 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath, ...@@ -158,3 +158,27 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
return; return;
} }
int libvlc_video_get_height( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout1 = GetVout( p_input, p_e );
if( !p_vout1 )
return 0;
vlc_object_release( p_vout1 );
return p_vout1->i_window_height;
}
int libvlc_video_get_width( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout1 = GetVout( p_input, p_e );
if( !p_vout1 )
return 0;
vlc_object_release( p_vout1 );
return p_vout1->i_window_width;
}
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