Commit b64f5e0b authored by Mark Lee's avatar Mark Lee Committed by Rémi Denis-Courmont

libvlc: add API to control display of the video title

parent 3e454fd4
......@@ -120,6 +120,22 @@ typedef enum libvlc_navigate_mode_t
libvlc_navigate_right
} libvlc_navigate_mode_t;
/**
* Enumeration of values used to set position (e.g. of video title).
*/
typedef enum libvlc_position_t {
libvlc_position_disable=-1,
libvlc_position_center,
libvlc_position_left,
libvlc_position_right,
libvlc_position_top,
libvlc_position_top_left,
libvlc_position_top_right,
libvlc_position_bottom,
libvlc_position_bottom_left,
libvlc_position_bottom_right
} libvlc_position_t;
/**
* Create an empty Media Player object
*
......@@ -823,6 +839,16 @@ LIBVLC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
LIBVLC_API void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
unsigned navigate );
/**
* Set if, and how, the video title will be shown when media is played.
*
* \param p_mi the media player
* \param position position at which to display the title, or libvlc_position_disable to prevent the title from being displayed
* \param timeout title display timeout in milliseconds (ignored if libvlc_position_disable)
* \version libVLC 2.1.0 or later
*/
LIBVLC_API void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned int timeout );
/**
* Release (free) libvlc_track_description_t
*
......
......@@ -164,6 +164,7 @@ libvlc_media_player_set_xwindow
libvlc_media_player_stop
libvlc_media_player_will_play
libvlc_media_player_navigate
libvlc_media_player_set_video_title_display
libvlc_media_release
libvlc_media_retain
libvlc_media_save_meta
......
......@@ -457,6 +457,11 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create (mp, "amem-rate", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
var_Create (mp, "amem-channels", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
/* Video Title */
var_Create (mp, "video-title-show", VLC_VAR_BOOL);
var_Create (mp, "video-title-position", VLC_VAR_INTEGER);
var_Create (mp, "video-title-timeout", VLC_VAR_INTEGER);
mp->p_md = NULL;
mp->state = libvlc_NothingSpecial;
mp->p_libvlc_instance = instance;
......@@ -1385,3 +1390,17 @@ void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi )
vlc_object_release( p_input_thread );
}
}
void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned timeout )
{
if ( position != libvlc_position_disable )
{
var_SetBool( p_mi, "video-title-show", true );
var_SetInteger( p_mi, "video-title-position", position );
var_SetInteger( p_mi, "video-title-timeout", timeout );
}
else
{
var_SetBool( p_mi, "video-title-show", false );
}
}
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