Commit eb95c577 authored by Laurent Aimar's avatar Laurent Aimar

Used a vout object for vout_OSDMessage/OSDSlider/OSDIcon.

It reduces the number of executed vlc_object_find.
Some macosx calls have been commented out.
parent 26d4cf78
...@@ -55,10 +55,7 @@ VLC_EXPORT( int, vout_OSDEpg, ( vout_thread_t *, input_item_t * ) ); ...@@ -55,10 +55,7 @@ VLC_EXPORT( int, vout_OSDEpg, ( vout_thread_t *, input_item_t * ) );
* \param i_channel Subpicture channel * \param i_channel Subpicture channel
* \param psz_format printf style formatting * \param psz_format printf style formatting
**/ **/
VLC_EXPORT( void, vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) LIBVLC_FORMAT( 3, 4 ) ); VLC_EXPORT( void, vout_OSDMessage, ( vout_thread_t *, int, const char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
#define vout_OSDMessage( obj, chan, ...) \
vout_OSDMessage( VLC_OBJECT(obj), chan, __VA_ARGS__ )
/** /**
* Display a slider on the video output. * Display a slider on the video output.
...@@ -68,7 +65,7 @@ VLC_EXPORT( void, vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) L ...@@ -68,7 +65,7 @@ VLC_EXPORT( void, vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) L
* \param i_type Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER. * \param i_type Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
* @see vlc_osd.h * @see vlc_osd.h
*/ */
VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int, int , short ) ); VLC_EXPORT( void, vout_OSDSlider, ( vout_thread_t *, int, int , short ) );
/** /**
* Display an Icon on the video output. * Display an Icon on the video output.
...@@ -77,7 +74,7 @@ VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int, int , short ) ); ...@@ -77,7 +74,7 @@ VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int, int , short ) );
* \param i_type Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON * \param i_type Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
* @see vlc_osd.h * @see vlc_osd.h
*/ */
VLC_EXPORT( void, vout_OSDIcon, ( vlc_object_t *, int, short ) ); VLC_EXPORT( void, vout_OSDIcon, ( vout_thread_t *, int, short ) );
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -661,6 +661,14 @@ static int Position( vlc_object_t *p_this, char const *psz_cmd, ...@@ -661,6 +661,14 @@ static int Position( vlc_object_t *p_this, char const *psz_cmd,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
#include <vlc_vout.h>
#define OSDMessage(dec, fmt, ...) do { \
vout_thread_t *p_vout = vlc_object_find( dec, VLC_OBJECT_VOUT, FIND_ANYWHERE ); \
if( p_vout ) { \
vout_OSDMessage( p_vout, fmt, __VA_ARGS__ ); \
vlc_object_release( p_vout ); \
} } while(0)
static int EventKey( vlc_object_t *p_this, char const *psz_cmd, static int EventKey( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
...@@ -683,7 +691,7 @@ static int EventKey( vlc_object_t *p_this, char const *psz_cmd, ...@@ -683,7 +691,7 @@ static int EventKey( vlc_object_t *p_this, char const *psz_cmd,
if ( !vbi_bcd_digits_greater( p_sys->i_wanted_subpage, 0x00 ) || vbi_bcd_digits_greater( p_sys->i_wanted_subpage, 0x99 ) ) if ( !vbi_bcd_digits_greater( p_sys->i_wanted_subpage, 0x00 ) || vbi_bcd_digits_greater( p_sys->i_wanted_subpage, 0x99 ) )
p_sys->i_wanted_subpage = VBI_ANY_SUBNO; p_sys->i_wanted_subpage = VBI_ANY_SUBNO;
else else
vout_OSDMessage( p_this, SPU_DEFAULT_CHANNEL, "%s: %d", _("Subpage"), vbi_bcd2dec( p_sys->i_wanted_subpage) ); OSDMessage( p_this, SPU_DEFAULT_CHANNEL, "%s: %d", _("Subpage"), vbi_bcd2dec( p_sys->i_wanted_subpage) );
p_sys->b_update = true; p_sys->b_update = true;
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
...@@ -697,7 +705,7 @@ static int EventKey( vlc_object_t *p_this, char const *psz_cmd, ...@@ -697,7 +705,7 @@ static int EventKey( vlc_object_t *p_this, char const *psz_cmd,
p_sys->i_key[0] = p_sys->i_key[1]; p_sys->i_key[0] = p_sys->i_key[1];
p_sys->i_key[1] = p_sys->i_key[2]; p_sys->i_key[1] = p_sys->i_key[2];
p_sys->i_key[2] = (int)(newval.i_int - '0'); p_sys->i_key[2] = (int)(newval.i_int - '0');
vout_OSDMessage( p_this, SPU_DEFAULT_CHANNEL, "%s: %c%c%c", _("Page"), (char)(p_sys->i_key[0]+'0'), (char)(p_sys->i_key[1]+'0'), (char)(p_sys->i_key[2]+'0') ); OSDMessage( p_this, SPU_DEFAULT_CHANNEL, "%s: %c%c%c", _("Page"), (char)(p_sys->i_key[0]+'0'), (char)(p_sys->i_key[1]+'0'), (char)(p_sys->i_key[2]+'0') );
int i_new_page = 0; int i_new_page = 0;
......
...@@ -71,10 +71,15 @@ static void PlayBookmark( intf_thread_t *, int ); ...@@ -71,10 +71,15 @@ static void PlayBookmark( intf_thread_t *, int );
static void SetBookmark ( intf_thread_t *, int ); static void SetBookmark ( intf_thread_t *, int );
static void DisplayPosition( intf_thread_t *, vout_thread_t *, input_thread_t * ); static void DisplayPosition( intf_thread_t *, vout_thread_t *, input_thread_t * );
static void DisplayVolume ( intf_thread_t *, vout_thread_t *, audio_volume_t ); static void DisplayVolume ( intf_thread_t *, vout_thread_t *, audio_volume_t );
static void DisplayRate ( input_thread_t *, float ); static void DisplayRate ( vout_thread_t *, float );
static float AdjustRateFine( input_thread_t *, const int ); static float AdjustRateFine( input_thread_t *, const int );
static void ClearChannels ( intf_thread_t *, vout_thread_t * ); static void ClearChannels ( intf_thread_t *, vout_thread_t * );
#define DisplayMessage(vout, fmt, ...) \
do { if(vout) vout_OSDMessage(vout, fmt, __VA_ARGS__); } while(0)
#define DisplayIcon(vout, icon) \
do { if(vout) vout_OSDIcon(vout, SPU_DEFAULT_CHANNEL, icon); } while(0)
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -175,7 +180,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -175,7 +180,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
libvlc_Quit( p_intf->p_libvlc ); libvlc_Quit( p_intf->p_libvlc );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Quit" ) ); DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _( "Quit" ) );
break; break;
/* Volume and audio actions */ /* Volume and audio actions */
...@@ -204,8 +209,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -204,8 +209,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( i_newvol == 0 ) if( i_newvol == 0 )
{ {
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDIcon( VLC_OBJECT( p_intf ), SPU_DEFAULT_CHANNEL, DisplayIcon( p_vout, OSD_MUTE_ICON );
OSD_MUTE_ICON );
} }
else else
DisplayVolume( p_intf, p_vout, i_newvol ); DisplayVolume( p_intf, p_vout, i_newvol );
...@@ -298,14 +302,12 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -298,14 +302,12 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
int state = var_GetInteger( p_input, "state" ); int state = var_GetInteger( p_input, "state" );
if( state != PAUSE_S ) if( state != PAUSE_S )
{ {
vout_OSDIcon( VLC_OBJECT( p_intf ), SPU_DEFAULT_CHANNEL, DisplayIcon( p_vout, OSD_PAUSE_ICON );
OSD_PAUSE_ICON );
state = PAUSE_S; state = PAUSE_S;
} }
else else
{ {
vout_OSDIcon( VLC_OBJECT( p_intf ), SPU_DEFAULT_CHANNEL, DisplayIcon( p_vout, OSD_PLAY_ICON );
OSD_PLAY_ICON );
state = PLAYING_S; state = PLAYING_S;
} }
var_SetInteger( p_input, "state", state ); var_SetInteger( p_input, "state", state );
...@@ -321,8 +323,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -321,8 +323,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else else
{ {
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDIcon( VLC_OBJECT( p_intf ), SPU_DEFAULT_CHANNEL, DisplayIcon( p_vout, OSD_PLAY_ICON );
OSD_PLAY_ICON );
playlist_Play( p_playlist ); playlist_Play( p_playlist );
} }
break; break;
...@@ -369,9 +370,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -369,9 +370,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
list.p_list->p_values[i+1] ); list.p_list->p_values[i+1] );
i++; i++;
} }
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Audio Device: %s"), _("Audio Device: %s"),
list2.p_list->p_values[i].psz_string); list2.p_list->p_values[i].psz_string);
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
break; break;
...@@ -391,8 +392,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -391,8 +392,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( var_GetInteger( p_input, "state" ) != PAUSE_S ) if( var_GetInteger( p_input, "state" ) != PAUSE_S )
{ {
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDIcon( VLC_OBJECT( p_intf ), SPU_DEFAULT_CHANNEL, DisplayIcon( p_vout, OSD_PAUSE_ICON );
OSD_PAUSE_ICON );
var_SetInteger( p_input, "state", PAUSE_S ); var_SetInteger( p_input, "state", PAUSE_S );
} }
} }
...@@ -466,9 +466,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -466,9 +466,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else else
i++; i++;
var_Set( p_input, "audio-es", list.p_list->p_values[i] ); var_Set( p_input, "audio-es", list.p_list->p_values[i] );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Audio track: %s"), _("Audio track: %s"),
list2.p_list->p_values[i].psz_string ); list2.p_list->p_values[i].psz_string );
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
...@@ -483,8 +483,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -483,8 +483,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
i_count = list.p_list->i_count; i_count = list.p_list->i_count;
if( i_count <= 1 ) if( i_count <= 1 )
{ {
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Subtitle track: %s"), _("N/A") ); _("Subtitle track: %s"), _("N/A") );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
goto cleanup_and_continue; goto cleanup_and_continue;
} }
...@@ -507,9 +507,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -507,9 +507,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else else
i++; i++;
var_Set( p_input, "spu-es", list.p_list->p_values[i] ); var_Set( p_input, "spu-es", list.p_list->p_values[i] );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Subtitle track: %s"), _("Subtitle track: %s"),
list2.p_list->p_values[i].psz_string ); list2.p_list->p_values[i].psz_string );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
else if( i_action == ACTIONID_ASPECT_RATIO && p_vout ) else if( i_action == ACTIONID_ASPECT_RATIO && p_vout )
...@@ -532,9 +532,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -532,9 +532,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( i == val_list.p_list->i_count ) i = 0; if( i == val_list.p_list->i_count ) i = 0;
var_SetString( p_vout, "aspect-ratio", var_SetString( p_vout, "aspect-ratio",
val_list.p_list->p_values[i].psz_string ); val_list.p_list->p_values[i].psz_string );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Aspect ratio: %s"), _("Aspect ratio: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -560,9 +560,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -560,9 +560,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( i == val_list.p_list->i_count ) i = 0; if( i == val_list.p_list->i_count ) i = 0;
var_SetString( p_vout, "crop", var_SetString( p_vout, "crop",
val_list.p_list->p_values[i].psz_string ); val_list.p_list->p_values[i].psz_string );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Crop: %s"), _("Crop: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -574,19 +574,19 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -574,19 +574,19 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if ( f_scalefactor != 1.0 ) if ( f_scalefactor != 1.0 )
{ {
var_SetFloat( p_vout, "scale", 1.0 ); var_SetFloat( p_vout, "scale", 1.0 );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("Zooming reset") ); "%s", _("Zooming reset") );
} }
else else
{ {
bool b_autoscale = !var_GetBool( p_vout, "autoscale" ); bool b_autoscale = !var_GetBool( p_vout, "autoscale" );
var_SetBool( p_vout, "autoscale", b_autoscale ); var_SetBool( p_vout, "autoscale", b_autoscale );
if( b_autoscale ) if( b_autoscale )
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("Scaled to screen") ); "%s", _("Scaled to screen") );
else else
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("Original Size") ); "%s", _("Original Size") );
} }
} }
else if( i_action == ACTIONID_SCALE_UP && p_vout ) else if( i_action == ACTIONID_SCALE_UP && p_vout )
...@@ -613,8 +613,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -613,8 +613,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( i_deinterlace != 0 ) if( i_deinterlace != 0 )
{ {
var_SetInteger( p_vout, "deinterlace", 0 ); var_SetInteger( p_vout, "deinterlace", 0 );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("Deinterlace off") ); "%s", _("Deinterlace off") );
} }
else else
{ {
...@@ -633,8 +633,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -633,8 +633,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
break; break;
} }
} }
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s (%s)", _("Deinterlace on"), psz_text ? psz_text : psz_mode ); "%s (%s)", _("Deinterlace on"), psz_text ? psz_text : psz_mode );
var_FreeList( &vlist, &tlist ); var_FreeList( &vlist, &tlist );
} }
...@@ -666,9 +666,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -666,9 +666,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
if( i == -1 ) i = val_list.p_list->i_count-1; if( i == -1 ) i = val_list.p_list->i_count-1;
var_SetFloat( p_vout, "zoom", var_SetFloat( p_vout, "zoom",
val_list.p_list->p_values[i].f_float ); val_list.p_list->p_values[i].f_float );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Zoom mode: %s"), _("Zoom mode: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -692,13 +692,13 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -692,13 +692,13 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else if( i_action == ACTIONID_NEXT ) else if( i_action == ACTIONID_NEXT )
{ {
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, "%s", _("Next") ); DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Next") );
playlist_Next( p_playlist ); playlist_Next( p_playlist );
} }
else if( i_action == ACTIONID_PREV ) else if( i_action == ACTIONID_PREV )
{ {
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, "%s", DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s",
_("Previous") ); _("Previous") );
playlist_Prev( p_playlist ); playlist_Prev( p_playlist );
} }
else if( i_action == ACTIONID_STOP ) else if( i_action == ACTIONID_STOP )
...@@ -708,24 +708,24 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -708,24 +708,24 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else if( i_action == ACTIONID_FRAME_NEXT ) else if( i_action == ACTIONID_FRAME_NEXT )
{ {
var_TriggerCallback( p_input, "frame-next" ); var_TriggerCallback( p_input, "frame-next" );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("Next frame") ); "%s", _("Next frame") );
} }
else if( i_action == ACTIONID_RATE_NORMAL ) else if( i_action == ACTIONID_RATE_NORMAL )
{ {
var_SetFloat( p_input, "rate", 1. ); var_SetFloat( p_input, "rate", 1. );
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s", _("1.00x") ); "%s", _("1.00x") );
} }
else if( i_action == ACTIONID_FASTER ) else if( i_action == ACTIONID_FASTER )
{ {
var_TriggerCallback( p_input, "rate-faster" ); var_TriggerCallback( p_input, "rate-faster" );
DisplayRate( p_input, var_GetFloat( p_input, "rate" ) ); DisplayRate( p_vout, var_GetFloat( p_input, "rate" ) );
} }
else if( i_action == ACTIONID_SLOWER ) else if( i_action == ACTIONID_SLOWER )
{ {
var_TriggerCallback( p_input, "rate-slower" ); var_TriggerCallback( p_input, "rate-slower" );
DisplayRate( p_input, var_GetFloat( p_input, "rate" ) ); DisplayRate( p_vout, var_GetFloat( p_input, "rate" ) );
} }
else if( i_action == ACTIONID_RATE_FASTER_FINE || else if( i_action == ACTIONID_RATE_FASTER_FINE ||
i_action == ACTIONID_RATE_SLOWER_FINE ) i_action == ACTIONID_RATE_SLOWER_FINE )
...@@ -734,7 +734,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -734,7 +734,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
float f_newrate = AdjustRateFine( p_input, i_dir ); float f_newrate = AdjustRateFine( p_input, i_dir );
var_SetFloat( p_input, "rate", f_newrate ); var_SetFloat( p_input, "rate", f_newrate );
DisplayRate( p_input, f_newrate ); DisplayRate( p_vout, f_newrate );
} }
else if( i_action == ACTIONID_POSITION ) else if( i_action == ACTIONID_POSITION )
{ {
...@@ -769,9 +769,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -769,9 +769,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
i_delay -= 50000; /* 50 ms */ i_delay -= 50000; /* 50 ms */
var_SetTime( p_input, "spu-delay", i_delay ); var_SetTime( p_input, "spu-delay", i_delay );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Subtitle delay %i ms" ), _( "Subtitle delay %i ms" ),
(int)(i_delay/1000) ); (int)(i_delay/1000) );
} }
else if( i_action == ACTIONID_SUBDELAY_UP ) else if( i_action == ACTIONID_SUBDELAY_UP )
{ {
...@@ -779,7 +779,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -779,7 +779,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
i_delay += 50000; /* 50 ms */ i_delay += 50000; /* 50 ms */
var_SetTime( p_input, "spu-delay", i_delay ); var_SetTime( p_input, "spu-delay", i_delay );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Subtitle delay %i ms" ), _( "Subtitle delay %i ms" ),
(int)(i_delay/1000) ); (int)(i_delay/1000) );
} }
...@@ -789,7 +789,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -789,7 +789,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
--i_pos; --i_pos;
var_SetInteger( p_input, "sub-margin", i_pos ); var_SetInteger( p_input, "sub-margin", i_pos );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Subtitle position %i px" ), _( "Subtitle position %i px" ),
(int)(i_pos) ); (int)(i_pos) );
} }
...@@ -799,7 +799,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -799,7 +799,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
++i_pos; ++i_pos;
var_SetInteger( p_input, "sub-margin", i_pos ); var_SetInteger( p_input, "sub-margin", i_pos );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Subtitle position %i px" ), _( "Subtitle position %i px" ),
(int)(i_pos) ); (int)(i_pos) );
} }
...@@ -809,7 +809,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -809,7 +809,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
i_delay -= 50000; /* 50 ms */ i_delay -= 50000; /* 50 ms */
var_SetTime( p_input, "audio-delay", i_delay ); var_SetTime( p_input, "audio-delay", i_delay );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Audio delay %i ms" ), _( "Audio delay %i ms" ),
(int)(i_delay/1000) ); (int)(i_delay/1000) );
} }
...@@ -819,7 +819,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -819,7 +819,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
i_delay += 50000; /* 50 ms */ i_delay += 50000; /* 50 ms */
var_SetTime( p_input, "audio-delay", i_delay ); var_SetTime( p_input, "audio-delay", i_delay );
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_( "Audio delay %i ms" ), _( "Audio delay %i ms" ),
(int)(i_delay/1000) ); (int)(i_delay/1000) );
} }
...@@ -858,9 +858,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -858,9 +858,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
const bool b_record = var_ToggleBool( p_input, "record" ); const bool b_record = var_ToggleBool( p_input, "record" );
if( b_record ) if( b_record )
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _("Recording") ); DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Recording") );
else else
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _("Recording done") ); DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Recording done") );
} }
} }
} }
...@@ -1008,18 +1008,18 @@ static void DisplayPosition( intf_thread_t *p_intf, vout_thread_t *p_vout, ...@@ -1008,18 +1008,18 @@ static void DisplayPosition( intf_thread_t *p_intf, vout_thread_t *p_vout,
if( time.i_time > 0 ) if( time.i_time > 0 )
{ {
secstotimestr( psz_duration, time.i_time / 1000000 ); secstotimestr( psz_duration, time.i_time / 1000000 );
vout_OSDMessage( p_input, POSITION_TEXT_CHAN, "%s / %s", DisplayMessage( p_vout, POSITION_TEXT_CHAN, "%s / %s",
psz_time, psz_duration ); psz_time, psz_duration );
} }
else if( i_seconds > 0 ) else if( i_seconds > 0 )
{ {
vout_OSDMessage( p_input, POSITION_TEXT_CHAN, "%s", psz_time ); DisplayMessage( p_vout, POSITION_TEXT_CHAN, "%s", psz_time );
} }
if( var_GetBool( p_vout, "fullscreen" ) ) if( var_GetBool( p_vout, "fullscreen" ) )
{ {
var_Get( p_input, "position", &pos ); var_Get( p_input, "position", &pos );
vout_OSDSlider( VLC_OBJECT( p_input ), POSITION_WIDGET_CHAN, vout_OSDSlider( p_vout, POSITION_WIDGET_CHAN,
pos.f_float * 100, OSD_HOR_SLIDER ); pos.f_float * 100, OSD_HOR_SLIDER );
} }
} }
...@@ -1035,19 +1035,19 @@ static void DisplayVolume( intf_thread_t *p_intf, vout_thread_t *p_vout, ...@@ -1035,19 +1035,19 @@ static void DisplayVolume( intf_thread_t *p_intf, vout_thread_t *p_vout,
if( var_GetBool( p_vout, "fullscreen" ) ) if( var_GetBool( p_vout, "fullscreen" ) )
{ {
vout_OSDSlider( VLC_OBJECT( p_vout ), VOLUME_WIDGET_CHAN, vout_OSDSlider( p_vout, VOLUME_WIDGET_CHAN,
i_vol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER ); i_vol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
} }
else else
{ {
vout_OSDMessage( p_vout, VOLUME_TEXT_CHAN, _( "Volume %d%%" ), DisplayMessage( p_vout, VOLUME_TEXT_CHAN, _( "Volume %d%%" ),
i_vol*400/AOUT_VOLUME_MAX ); i_vol*400/AOUT_VOLUME_MAX );
} }
} }
static void DisplayRate( input_thread_t *p_input, float f_rate ) static void DisplayRate( vout_thread_t *p_vout, float f_rate )
{ {
vout_OSDMessage( VLC_OBJECT(p_input), SPU_DEFAULT_CHANNEL, _("Speed: %.2fx"), f_rate ); DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, _("Speed: %.2fx"), f_rate );
} }
static float AdjustRateFine( input_thread_t *p_input, const int i_dir ) static float AdjustRateFine( input_thread_t *p_input, const int i_dir )
......
...@@ -211,12 +211,12 @@ ...@@ -211,12 +211,12 @@
var_Set( p_playlist, "random", val ); var_Set( p_playlist, "random", val );
if( val.b_bool ) if( val.b_bool )
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Random On" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Random On" ) );
config_PutInt( p_playlist, "random", 1 ); config_PutInt( p_playlist, "random", 1 );
} }
else else
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Random Off" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Random Off" ) );
config_PutInt( p_playlist, "random", 0 ); config_PutInt( p_playlist, "random", 0 );
} }
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
config_PutInt( p_playlist, "loop", 0 ); config_PutInt( p_playlist, "loop", 0 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat One" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat One" ) );
} }
else if( repeating.b_bool && !looping.b_bool ) else if( repeating.b_bool && !looping.b_bool )
{ {
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
config_PutInt( p_playlist, "loop", 1 ); config_PutInt( p_playlist, "loop", 1 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat All" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat All" ) );
} }
else else
{ {
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
config_PutInt( p_playlist, "loop", 0 ); config_PutInt( p_playlist, "loop", 0 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) );
} }
/* communicate with core and the main intf loop */ /* communicate with core and the main intf loop */
...@@ -336,12 +336,12 @@ ...@@ -336,12 +336,12 @@
var_Set( p_playlist, "repeat", val ); var_Set( p_playlist, "repeat", val );
if( val.b_bool ) if( val.b_bool )
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat One" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat One" ) );
config_PutInt( p_playlist, "repeat", 1 ); config_PutInt( p_playlist, "repeat", 1 );
} }
else else
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) );
config_PutInt( p_playlist, "repeat", 0 ); config_PutInt( p_playlist, "repeat", 0 );
} }
...@@ -364,12 +364,12 @@ ...@@ -364,12 +364,12 @@
var_Set( p_playlist, "loop", val ); var_Set( p_playlist, "loop", val );
if( val.b_bool ) if( val.b_bool )
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat All" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat All" ) );
config_PutInt( p_playlist, "loop", 1 ); config_PutInt( p_playlist, "loop", 1 );
} }
else else
{ {
vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) ); //vout_OSDMessage( p_intf, SPU_DEFAULT_CHANNEL, "%s", _( "Repeat Off" ) );
config_PutInt( p_playlist, "loop", 0 ); config_PutInt( p_playlist, "loop", 0 );
} }
......
...@@ -36,8 +36,15 @@ ...@@ -36,8 +36,15 @@
void CmdQuit::execute() void CmdQuit::execute()
{ {
// Stop the playlist if( getIntf()->p_sys->p_input )
vout_OSDMessage( getIntf(), SPU_DEFAULT_CHANNEL, "%s", _( "Quit" ) ); {
vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input );
if( pVout )
{
vout_OSDMessage( pVout, SPU_DEFAULT_CHANNEL, "%s", _( "Quit" ) );
vlc_object_release( pVout );
}
}
// Kill libvlc // Kill libvlc
libvlc_Quit( getIntf()->p_libvlc ); libvlc_Quit( getIntf()->p_libvlc );
......
...@@ -75,7 +75,13 @@ static int vlclua_osd_icon( lua_State *L ) ...@@ -75,7 +75,13 @@ static int vlclua_osd_icon( lua_State *L )
else else
{ {
vlc_object_t *p_this = vlclua_get_this( L ); vlc_object_t *p_this = vlclua_get_this( L );
vout_OSDIcon( p_this, i_chan, i_icon ); vout_thread_t *p_vout = vlc_object_find( p_this, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout )
{
vout_OSDIcon( p_vout, i_chan, i_icon );
vlc_object_release( p_vout );
}
return 0; return 0;
} }
} }
...@@ -85,7 +91,13 @@ static int vlclua_osd_message( lua_State *L ) ...@@ -85,7 +91,13 @@ static int vlclua_osd_message( lua_State *L )
const char *psz_message = luaL_checkstring( L, 1 ); const char *psz_message = luaL_checkstring( L, 1 );
int i_chan = luaL_optint( L, 2, SPU_DEFAULT_CHANNEL ); int i_chan = luaL_optint( L, 2, SPU_DEFAULT_CHANNEL );
vlc_object_t *p_this = vlclua_get_this( L ); vlc_object_t *p_this = vlclua_get_this( L );
vout_OSDMessage( p_this, i_chan, "%s", psz_message ); vout_thread_t *p_vout = vlc_object_find( p_this, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout )
{
vout_OSDMessage( p_vout, i_chan, "%s", psz_message );
vlc_object_release( p_vout );
}
return 0; return 0;
} }
...@@ -120,7 +132,13 @@ static int vlclua_osd_slider( lua_State *L ) ...@@ -120,7 +132,13 @@ static int vlclua_osd_slider( lua_State *L )
else else
{ {
vlc_object_t *p_this = vlclua_get_this( L ); vlc_object_t *p_this = vlclua_get_this( L );
vout_OSDSlider( p_this, i_chan, i_position, i_type ); vout_thread_t *p_vout = vlc_object_find( p_this, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout )
{
vout_OSDSlider( p_vout, i_chan, i_position, i_type );
vlc_object_release( p_vout );
}
return 0; return 0;
} }
} }
......
...@@ -851,19 +851,15 @@ static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string) ...@@ -851,19 +851,15 @@ static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string)
vlc_assert_locked(&vout->p->change_lock); vlc_assert_locked(&vout->p->change_lock);
const mtime_t start = mdate(); if (vout->p->title.timeout > 0)
const mtime_t stop = start + vout_ShowTextRelative(vout, SPU_DEFAULT_CHANNEL,
INT64_C(1000) * vout->p->title.timeout;
if (stop > start)
vout_ShowTextAbsolute(vout, SPU_DEFAULT_CHANNEL,
string, NULL, string, NULL,
vout->p->title.position, vout->p->title.position,
30 + vout->p->fmt_in.i_width 30 + vout->p->fmt_in.i_width
- vout->p->fmt_in.i_visible_width - vout->p->fmt_in.i_visible_width
- vout->p->fmt_in.i_x_offset, - vout->p->fmt_in.i_x_offset,
20 + vout->p->fmt_in.i_y_offset, 20 + vout->p->fmt_in.i_y_offset,
start, stop); INT64_C(1000) * vout->p->title.timeout);
} }
static void ThreadChangeFilters(vout_thread_t *vout, const char *filters) static void ThreadChangeFilters(vout_thread_t *vout, const char *filters)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "vout_internal.h" #include "vout_internal.h"
/** /**
* \brief Show text on the video for some time * \brief Show text on the video from a given start date to a given end date
* \param p_vout pointer to the vout the text is to be showed on * \param p_vout pointer to the vout the text is to be showed on
* \param i_channel Subpicture channel * \param i_channel Subpicture channel
* \param psz_string The text to be shown * \param psz_string The text to be shown
...@@ -47,35 +47,9 @@ ...@@ -47,35 +47,9 @@
* \param i_duration Amount of time the text is to be shown. * \param i_duration Amount of time the text is to be shown.
*/ */
int vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel, int vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel,
char *psz_string, const text_style_t *p_style,
int i_flags, int i_hmargin, int i_vmargin,
mtime_t i_duration )
{
mtime_t i_now = mdate();
return vout_ShowTextAbsolute( p_vout, i_channel, psz_string,
p_style, i_flags, i_hmargin, i_vmargin,
i_now, i_now + i_duration );
}
/**
* \brief Show text on the video from a given start date to a given end date
* \param p_vout pointer to the vout the text is to be showed on
* \param i_channel Subpicture channel
* \param psz_string The text to be shown
* \param p_style Pointer to a struct with text style info (it is duplicated if non NULL)
* \param i_flags flags for alignment and such
* \param i_hmargin horizontal margin in pixels
* \param i_vmargin vertical margin in pixels
* \param i_start the time when this string is to appear on the video
* \param i_stop the time when this string should stop to be displayed
* if this is 0 the string will be shown untill the next string
* is about to be shown
*/
int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
const char *psz_string, const text_style_t *p_style, const char *psz_string, const text_style_t *p_style,
int i_flags, int i_hmargin, int i_vmargin, int i_flags, int i_hmargin, int i_vmargin,
mtime_t i_start, mtime_t i_stop ) mtime_t i_duration )
{ {
subpicture_t *p_spu; subpicture_t *p_spu;
video_format_t fmt; video_format_t fmt;
...@@ -87,8 +61,8 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel, ...@@ -87,8 +61,8 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
return VLC_EGENERIC; return VLC_EGENERIC;
p_spu->i_channel = i_channel; p_spu->i_channel = i_channel;
p_spu->i_start = i_start; p_spu->i_start = mdate();
p_spu->i_stop = i_stop; p_spu->i_stop = p_spu->i_start + i_duration;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
p_spu->b_absolute = false; p_spu->b_absolute = false;
p_spu->b_fade = true; p_spu->b_fade = true;
...@@ -119,7 +93,6 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel, ...@@ -119,7 +93,6 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
#undef vout_OSDMessage
/** /**
* \brief Write an informative message at the default location, * \brief Write an informative message at the default location,
* for the default duration and only if the OSD option is enabled. * for the default duration and only if the OSD option is enabled.
...@@ -127,31 +100,26 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel, ...@@ -127,31 +100,26 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
* \param i_channel Subpicture channel * \param i_channel Subpicture channel
* \param psz_format printf style formatting * \param psz_format printf style formatting
**/ **/
void vout_OSDMessage( vlc_object_t *p_caller, int i_channel, void vout_OSDMessage( vout_thread_t *p_vout, int i_channel,
const char *psz_format, ... ) const char *psz_format, ... )
{ {
vout_thread_t *p_vout; if( !var_InheritBool( p_vout, "osd" ) )
char *psz_string = NULL; return;
va_list args;
if( !var_InheritBool( p_caller, "osd" ) ) return; va_list args;
va_start( args, psz_format );
p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT, FIND_ANYWHERE ); char *psz_string;
if( p_vout ) if( vasprintf( &psz_string, psz_format, args ) != -1 )
{ {
va_start( args, psz_format ); vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL,
if( vasprintf( &psz_string, psz_format, args ) != -1 ) SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_RIGHT,
{ 30 + p_vout->p->fmt_in.i_width
vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL, - p_vout->p->fmt_in.i_visible_width
SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_RIGHT, - p_vout->p->fmt_in.i_x_offset,
30 + p_vout->p->fmt_in.i_width 20 + p_vout->p->fmt_in.i_y_offset, 1000000 );
- p_vout->p->fmt_in.i_visible_width free( psz_string );
- p_vout->p->fmt_in.i_x_offset,
20 + p_vout->p->fmt_in.i_y_offset, 1000000 );
free( psz_string );
}
vlc_object_release( p_vout );
va_end( args );
} }
va_end( args );
} }
...@@ -42,47 +42,36 @@ ...@@ -42,47 +42,36 @@
* Displays an OSD slider. * Displays an OSD slider.
* Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER. * Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
*****************************************************************************/ *****************************************************************************/
void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position, void vout_OSDSlider( vout_thread_t *p_vout, int i_channel, int i_position,
short i_type ) short i_type )
{ {
vout_thread_t *p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT, if( !var_InheritBool( p_vout, "osd" ) || i_position < 0 )
FIND_ANYWHERE ); return;
if( p_vout && ( var_InheritBool( p_caller, "osd" ) && ( i_position >= 0 ) ) ) osd_Slider( VLC_OBJECT( p_vout ), vout_GetSpu( p_vout ),
{ p_vout->p->fmt_render.i_width,
osd_Slider( p_caller, vout_GetSpu( p_vout ), p_vout->p->fmt_render.i_height,
p_vout->p->fmt_render.i_width, p_vout->p->fmt_in.i_x_offset,
p_vout->p->fmt_render.i_height, p_vout->p->fmt_in.i_height - p_vout->p->fmt_in.i_visible_height
p_vout->p->fmt_in.i_x_offset, - p_vout->p->fmt_in.i_y_offset,
p_vout->p->fmt_in.i_height - p_vout->p->fmt_in.i_visible_height i_channel, i_position, i_type );
- p_vout->p->fmt_in.i_y_offset,
i_channel, i_position, i_type );
}
vlc_object_release( p_vout );
} }
/***************************************************************************** /*****************************************************************************
* Displays an OSD icon. * Displays an OSD icon.
* Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON * Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
*****************************************************************************/ *****************************************************************************/
void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type ) void vout_OSDIcon( vout_thread_t *p_vout, int i_channel, short i_type )
{ {
vout_thread_t *p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT, if( !var_InheritBool( p_vout, "osd" ) )
FIND_ANYWHERE ); return;
osd_Icon( VLC_OBJECT( p_vout ),
if( !p_vout ) return; vout_GetSpu( p_vout ),
p_vout->p->fmt_render.i_width,
if( var_InheritBool( p_caller, "osd" ) ) p_vout->p->fmt_render.i_height,
{ p_vout->p->fmt_in.i_width - p_vout->p->fmt_in.i_visible_width
osd_Icon( p_caller, - p_vout->p->fmt_in.i_x_offset,
vout_GetSpu( p_vout ), p_vout->p->fmt_in.i_y_offset,
p_vout->p->fmt_render.i_width, i_channel, i_type );
p_vout->p->fmt_render.i_height,
p_vout->p->fmt_in.i_width - p_vout->p->fmt_in.i_visible_width
- p_vout->p->fmt_in.i_x_offset,
p_vout->p->fmt_in.i_y_offset,
i_channel, i_type );
}
vlc_object_release( p_vout );
} }
...@@ -170,9 +170,7 @@ void vout_DisplayWrapper(vout_thread_t *, picture_t *); ...@@ -170,9 +170,7 @@ void vout_DisplayWrapper(vout_thread_t *, picture_t *);
int spu_ProcessMouse(spu_t *, const vlc_mouse_t *, const video_format_t *); int spu_ProcessMouse(spu_t *, const vlc_mouse_t *, const video_format_t *);
/* */ /* */
int vout_ShowTextRelative( vout_thread_t *, int, char *, const text_style_t *, int, int, int, mtime_t ); int vout_ShowTextRelative( vout_thread_t *, int, const char *, const text_style_t *, int, int, int, mtime_t );
int vout_ShowTextAbsolute( vout_thread_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t );
#endif #endif
...@@ -395,7 +395,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -395,7 +395,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic )
static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char *psz_filename ) static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char *psz_filename )
{ {
msg_Dbg( p_vout, "snapshot taken (%s)", psz_filename ); msg_Dbg( p_vout, "snapshot taken (%s)", psz_filename );
vout_OSDMessage( VLC_OBJECT( p_vout ), SPU_DEFAULT_CHANNEL, "%s", psz_filename ); vout_OSDMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", psz_filename );
if( var_GetBool( p_vout, "snapshot-preview" ) ) if( var_GetBool( p_vout, "snapshot-preview" ) )
{ {
......
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