};
static const text_style_t default_text_style = { 22, 0xffffff, VLC_FALSE, VLC_FALSE, VLC_FALSE };
-VLC_EXPORT( subpicture_t *, vout_ShowTextRelative, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t ) );
-VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
-VLC_EXPORT( void, __vout_OSDMessage, ( vlc_object_t *, char *, ... ) );
+VLC_EXPORT( subpicture_t *, vout_ShowTextRelative, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
+VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
+VLC_EXPORT( void, __vout_OSDMessage, ( vlc_object_t *, int, char *, ... ) );
/**
* Same as __vlc_OSDMessage() but with automatic casting
*/
#if defined(HAVE_VARIADIC_MACROS)
-# define vout_OSDMessage( obj, fmt, args...) __vout_OSDMessage( VLC_OBJECT(obj), fmt, ## args )
+# define vout_OSDMessage( obj, chan, fmt, args...) __vout_OSDMessage( VLC_OBJECT(obj), chan, fmt, ## args )
#else
# define vout_OSDMessage __vout_OSDMessage
#endif
-VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int , short ) );
+VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int, int , short ) );
VLC_EXPORT( void, vout_OSDIcon, ( vlc_object_t *, short ) );
picture_t p_picture[2*VOUT_MAX_PICTURES]; /**< pictures */
subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /**< subpictures */
- subpicture_t * p_last_osd_message;
-
/* Statistics */
count_t c_loops;
count_t c_pictures, c_late_pictures;
the text renderer */
module_t * p_text_renderer_module; /**< text renderer module */
/** callback used when a new string needs to be shown on the vout */
- subpicture_t * ( *pf_add_string ) ( vout_thread_t *, char *, text_style_t *, int,
- int, int, mtime_t, mtime_t );
+ subpicture_t * ( *pf_add_string ) ( vout_thread_t *, int, char *,
+ text_style_t *, int, int, int, mtime_t,
+ mtime_t );
};
#define I_OUTPUTPICTURES p_vout->output.i_pictures
* \addtogroup subpicture
* @{
*/
-VLC_EXPORT( subpicture_t *, vout_CreateSubPicture, ( vout_thread_t *, int ) );
+VLC_EXPORT( subpicture_t *, vout_CreateSubPicture, ( vout_thread_t *, int, int, int ) );
VLC_EXPORT( void, vout_DestroySubPicture, ( vout_thread_t *, subpicture_t * ) );
VLC_EXPORT( void, vout_DisplaySubPicture, ( vout_thread_t *, subpicture_t * ) );
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vlc_video.h,v 1.9 2004/01/25 18:17:08 zorglub Exp $
+ * $Id$
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*/
struct subpicture_t
{
+ /** \name Channel and content type */
+ /**@{*/
+ int i_channel; /**< subpicture channel */
+ int i_content; /**< content type */
+ /**@}*/
+
/** \name Type and flags
Should NOT be modified except by the vout thread */
/**@{*/
#define RESERVED_SUBPICTURE 1 /* allocated and reserved */
#define READY_SUBPICTURE 2 /* ready for display */
+/* Subpicture channel */
+#define SUBT1_CHAN 1
+#define SUBT2_CHAN 2
+#define BEGIN_EXCLUSIVE_CHAN 3 /* exclusive subpic-channels list */
+#define POSITION_CHAN 3
+#define VOLUME_CHAN 4
+#define SOLO_CHAN 5
+#define END_EXCLUSIVE_CHAN 5 /*end of list */
+
+/* Subpicture content type */
+#define TEXT_CONTENT 0
+#define GRAPH_CONTENT 1 /* used for OSD icon, slider... */
+
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* TODO: p_subpicture doesn't have the proper i_x and i_y
* coordinates. Need to look at the subpicture display system to
* work out why. */
- if ( vout_ShowTextAbsolute( p_vout,
- psz_anchor_description, p_style, OSD_ALIGN_BOTTOM,
+ if ( vout_ShowTextAbsolute( p_vout, SOLO_CHAN,
+ psz_anchor_description, p_style, OSD_ALIGN_BOTTOM,
i_margin_h, i_margin_v, i_now, 0 ) == VLC_SUCCESS )
{
/* Displayed successfully */
/* Allocate the subpicture internal data. */
dvbsub->p_spu[j] =
- vout_CreateSubPicture( p_vout, MEMORY_SUBPICTURE );
+ vout_CreateSubPicture( p_vout, SUBT1_CHAN, TEXT_CONTENT,
+ MEMORY_SUBPICTURE );
if( dvbsub->p_spu[j] == NULL )
{
msg_Err(p_vout, "Unable to allocate memory, skipping");
* parse.c: Philips OGT (SVCD subtitle) packet parser
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
- * $Id: cvd_parse.c,v 1.14 2004/01/22 04:46:19 rocky Exp $
+ * $Id$
*
* Authors: Rocky Bernstein
* based on code from:
dbg_print( (DECODE_DBG_CALL|DECODE_DBG_EXT) , "");
/* Allocate the subpicture internal data. */
- p_spu = vout_CreateSubPicture( p_sys->p_vout, MEMORY_SUBPICTURE );
+ p_spu = vout_CreateSubPicture( p_sys->p_vout, SUBT1_CHAN, TEXT_CONTENT,
+ MEMORY_SUBPICTURE );
if( p_spu == NULL )
{
return;
* Philips OGT (SVCD subtitle) packet parser
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
- * $Id: ogt_parse.c,v 1.12 2004/01/22 04:46:19 rocky Exp $
+ * $Id$
*
* Author: Rocky Bernstein
* based on code from:
dbg_print( (DECODE_DBG_CALL|DECODE_DBG_EXT) , "");
/* Allocate the subpicture internal data. */
- p_spu = vout_CreateSubPicture( p_sys->p_vout, MEMORY_SUBPICTURE );
+ p_spu = vout_CreateSubPicture( p_sys->p_vout, SUBT1_CHAN, TEXT_CONTENT,
+ MEMORY_SUBPICTURE );
if( p_spu == NULL )
{
return;
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: parse.c,v 1.17 2004/01/27 22:51:39 hartman Exp $
+ * $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Laurent Aimar <fenrir@via.ecp.fr>
subpicture_t *p_spu;
/* Allocate the subpicture internal data. */
- p_spu = vout_CreateSubPicture( p_sys->p_vout, MEMORY_SUBPICTURE );
+ p_spu = vout_CreateSubPicture( p_sys->p_vout, SUBT1_CHAN, TEXT_CONTENT,
+ MEMORY_SUBPICTURE );
if( p_spu == NULL )
{
return;
}
}
StripTags( psz_subtitle );
- vout_ShowTextAbsolute( p_vout, psz_subtitle, NULL,
+ vout_ShowTextAbsolute( p_vout, SUBT1_CHAN, psz_subtitle, NULL,
OSD_ALIGN_BOTTOM | p_sys->i_align, i_align_h,
i_align_v, p_block->i_pts,
p_block->i_length ? p_block->i_pts + p_block->i_length : 0 );
if( i_action == ACTIONID_QUIT )
{
p_intf->p_vlc->b_die = VLC_TRUE;
- vout_OSDMessage( p_intf, _( "Quit" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Quit" ) );
continue;
}
else if( i_action == ACTIONID_VOL_UP )
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), VOLUME_CHAN,
i_newvol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, "Vol %d%%",
+ vout_OSDMessage( p_intf, VOLUME_CHAN, "Vol %d%%",
2*i_newvol*100/AOUT_VOLUME_MAX );
}
}
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), VOLUME_CHAN,
i_newvol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, "Vol %d%%",
+ vout_OSDMessage( p_intf, VOLUME_CHAN, "Vol %d%%",
2*i_newvol*100/AOUT_VOLUME_MAX );
}
}
{
if( i_newvol == 0 )
{
- vout_OSDMessage( p_intf, _( "Mute" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Mute" ) );
vout_OSDIcon( VLC_OBJECT( p_intf ), OSD_MUTE_ICON );
}
else
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), VOLUME_CHAN,
i_newvol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, "Vol %d%%",
+ vout_OSDMessage( p_intf, VOLUME_CHAN, "Vol %d%%",
i_newvol * 100 / AOUT_VOLUME_MAX );
}
}
{
i_delay--;
input_Control( p_input, INPUT_SET_SUBDELAY, i_delay );
- vout_OSDMessage( p_intf, "Subtitle delay %i ms", i_delay*100);
+ vout_OSDMessage( p_intf, SOLO_CHAN, "Subtitle delay %i ms",
+ i_delay*100);
}
}
else if( i_action == ACTIONID_SUBDELAY_UP )
{
i_delay++;
input_Control( p_input, INPUT_SET_SUBDELAY, i_delay );
- vout_OSDMessage( p_intf, "Subtitle delay %i ms", i_delay*100);
+ vout_OSDMessage( p_intf, SOLO_CHAN, "Subtitle delay %i ms",
+ i_delay*100);
}
}
else if( i_action == ACTIONID_FULLSCREEN && p_vout )
if( i_action == ACTIONID_PAUSE )
{
- vout_OSDMessage( p_intf, _( "Pause" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
var_Set( p_input, "time-offset", val );
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump -10 seconds" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN,
+ _( "Jump -10 seconds" ) );
}
}
else if( i_action == ACTIONID_JUMP_FORWARD_10SEC && b_seekable )
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) );
+ vout_OSDMessage( p_intf, POSITION_CHAN,
+ _( "Jump +10 seconds" ) );
}
}
}
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump -1 minute" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN,
+ _( "Jump -1 minute" ) );
}
}
}
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump +1 minute" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN,
+ _( "Jump +1 minute" ) );
}
}
}
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN,
+ _( "Jump -5 minutes" ) );
}
}
}
{
if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
{
- vout_OSDSlider( VLC_OBJECT( p_intf ),
+ vout_OSDSlider( VLC_OBJECT( p_intf ), POSITION_CHAN,
GetPosition( p_intf ), OSD_HOR_SLIDER );
}
else
{
- vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN,
+ _( "Jump +5 minutes" ) );
}
}
}
if( time.i_time > 0 )
{
secstotimestr( psz_duration, time.i_time / 1000000 );
- vout_OSDMessage( p_input, "%s / %s",
+ vout_OSDMessage( p_input, POSITION_CHAN, "%s / %s",
psz_time, psz_duration );
}
else if( i_seconds > 0 )
{
- vout_OSDMessage( p_input, psz_time );
+ vout_OSDMessage( p_input, POSITION_CHAN, psz_time );
}
}
else if( i_action >= ACTIONID_PLAY_BOOKMARK1 &&
if( !strcmp( c, "QUIT" ) )
{
p_intf->p_vlc->b_die = VLC_TRUE;
- vout_OSDMessage( p_intf, _("Quit" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _("Quit" ) );
continue;
}
else if( !strcmp( c, "VOL_UP" ) )
{
audio_volume_t i_newvol;
aout_VolumeUp( p_intf, 1, &i_newvol );
- vout_OSDMessage( p_intf, _("Vol %%%d"),
+ vout_OSDMessage( p_intf, SOLO_CHAN, _("Vol %%%d"),
i_newvol * 100 / AOUT_VOLUME_MAX );
}
else if( !strcmp( c, "VOL_DOWN" ) )
{
audio_volume_t i_newvol;
aout_VolumeDown( p_intf, 1, &i_newvol );
- vout_OSDMessage( p_intf, _("Vol %%%d"),
+ vout_OSDMessage( p_intf, SOLO_CHAN, _("Vol %%%d"),
i_newvol * 100 / AOUT_VOLUME_MAX );
}
else if( !strcmp( c, "MUTE" ) )
aout_VolumeMute( p_intf, &i_newvol );
if( i_newvol == 0 )
{
- vout_OSDMessage( p_intf, _( "Mute" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Mute" ) );
}
else
{
- vout_OSDMessage( p_intf, _("Vol %d%%"),
+ vout_OSDMessage( p_intf, SOLO_CHAN, _("Vol %d%%"),
i_newvol * 100 / AOUT_VOLUME_MAX );
}
}
}
if( p_input && val.i_int != PAUSE_S )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
+ vout_OSDMessage( VLC_OBJECT(p_intf), SOLO_CHAN,
+ _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
- vout_OSDMessage( p_intf, _( "Play" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Play" ) );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
list.p_list->p_values[i+1] );
i++;
}
- vout_OSDMessage( VLC_OBJECT(p_input), _("Audio track: %s"),
+ vout_OSDMessage( VLC_OBJECT(p_input), SOLO_CHAN,
+ _("Audio track: %s"),
list2.p_list->p_values[i].psz_string );
}
else if( !strcmp( c, "SUBTITLE_TRACK" ) )
var_Set( p_input, "spu-es", list.p_list->p_values[i+1] );
i = i + 1;
}
- vout_OSDMessage( VLC_OBJECT(p_input), _("Subtitle track: %s"), list2.p_list->p_values[i].psz_string );
+ vout_OSDMessage( VLC_OBJECT(p_input), SOLO_CHAN,
+ _("Subtitle track: %s"),
+ list2.p_list->p_values[i].psz_string );
}
else if( !strcmp( c, "PAUSE" ) )
{
vlc_value_t val;
- vout_OSDMessage( p_intf, _( "Pause" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
}
if( p_input && val.i_int != PAUSE_S )
{
- vout_OSDMessage( p_intf, _( "Pause" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
- vout_OSDMessage( p_intf, _( "Play" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Play" ) );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
FIND_ANYWHERE );
if( p_playlist != NULL )
{
- vout_OSDMessage( p_intf, _( "Stop" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Stop" ) );
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
}
vlc_value_t val; val.b_bool = VLC_TRUE;
var_Set( p_input, "rate-faster", val );
- vout_OSDMessage( p_intf, _( "Faster" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Faster" ) );
vlc_object_release( p_input );
}
}
vlc_value_t val; val.b_bool = VLC_TRUE;
var_Set( p_input, "rate-slower", val );
- vout_OSDMessage( p_intf, _( "Slower" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Slower" ) );
vlc_object_release( p_input );
}
}
{
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
- vout_OSDMessage( p_intf, _( "Previous" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Previous" ) );
}
}
{
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
- vout_OSDMessage( p_intf, _( "Next" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Next" ) );
}
}
var_Set( p_playlist, "random", val );
if( val.b_bool )
{
- vout_OSDMessage( p_intf, _( "Random On" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Random On" ) );
}
else
{
- vout_OSDMessage( p_intf, _( "Random Off" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Random Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
var_Set( p_playlist, "repeat", val );
if( val.b_bool )
{
- vout_OSDMessage( p_intf, _( "Repeat All" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat All" ) );
}
else
{
- vout_OSDMessage( p_intf, _( "Repeat Off" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
var_Set( p_playlist, "loop", val );
if( val.b_bool )
{
- vout_OSDMessage( p_intf, _( "Repeat One" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat One" ) );
}
else
{
- vout_OSDMessage( p_intf, _( "Repeat Off" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
vlc_value_t time;
time.i_time = 10 * 1000000;
var_Set( p_input, "time-offset", time );
- vout_OSDMessage( p_intf, _( "Jump +10 Seconds" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Jump +10 Seconds" ) );
vlc_object_release( p_input );
}
}
vlc_value_t time;
time.i_time = -10 * 1000000;
var_Set( p_input, "time-offset", time );
- vout_OSDMessage( p_intf, _( "Jump -10 Seconds" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Jump -10 Seconds" ) );
vlc_object_release( p_input );
}
}
[o_volumeslider setFloatValue: (float)(i_volume / AOUT_VOLUME_STEP)];
- vout_OSDMessage( p_intf, "Vol %d%%", i_volume*100/AOUT_VOLUME_MAX );
+ vout_OSDMessage( p_intf, SOLO_CHAN, "Vol %d%%",
+ i_volume*100/AOUT_VOLUME_MAX );
}
- (IBAction)windowAction:(id)sender
var_Set( p_playlist, "loop", val1 );
val1.b_bool = 1;
var_Set( p_playlist, "repeat", val1 );
- vout_OSDMessage( p_intf, _( "Repeat One" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat One" ) );
break;
case 2:
var_Set( p_playlist, "repeat", val1 );
val1.b_bool = 1;
var_Set( p_playlist, "loop", val1 );
- vout_OSDMessage( p_intf, _( "Repeat All" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat All" ) );
break;
default:
val1.b_bool = 0;
var_Set( p_playlist, "repeat", val1 );
var_Set( p_playlist, "loop", val1 );
- vout_OSDMessage( p_intf, _( "Repeat Off" ) );
+ vout_OSDMessage( p_intf, SOLO_CHAN, _( "Repeat Off" ) );
}
break;
}
* renderer.c : dummy text rendering functions
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: renderer.c,v 1.4 2003/12/08 17:48:13 yoann Exp $
+ * $Id$
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
#include <vlc/vlc.h>
#include <vlc/vout.h>
-static subpicture_t * AddText ( vout_thread_t *, char *, text_style_t *, int,
- int, int, mtime_t, mtime_t );
+static subpicture_t * AddText( vout_thread_t *, int, char *, text_style_t *,
+ int, int, int, mtime_t, mtime_t );
int E_(OpenRenderer)( vlc_object_t *p_this )
{
return VLC_SUCCESS;
}
-static subpicture_t * AddText ( vout_thread_t *p_vout, char *psz_string,
- text_style_t *p_style , int i_flags, int i_x_margin,
- int i_y_margin, mtime_t i_start, mtime_t i_stop )
+static subpicture_t * AddText( vout_thread_t *p_vout, int i_channel,
+ char *psz_string, text_style_t *p_style , int i_flags,
+ int i_x_margin, int i_y_margin, mtime_t i_start,
+ mtime_t i_stop )
{
return VLC_SUCCESS;
}
const subpicture_t * );
static void RenderRV32( vout_thread_t *, picture_t *,
const subpicture_t * );
-static subpicture_t *AddText ( vout_thread_t *, char *, text_style_t *, int,
- int, int, mtime_t, mtime_t );
+static subpicture_t *AddText ( vout_thread_t *, int, char *, text_style_t *,
+ int, int, int, mtime_t, mtime_t );
static void FreeString( subpicture_t * );
* needed glyphs into memory. It is used as pf_add_string callback in
* the vout method by this module
*/
-static subpicture_t *AddText ( vout_thread_t *p_vout, char *psz_string,
- text_style_t *p_style, int i_flags, int i_hmargin,
- int i_vmargin, mtime_t i_start, mtime_t i_stop )
+static subpicture_t *AddText ( vout_thread_t *p_vout, int i_channel,
+ char *psz_string, text_style_t *p_style, int i_flags,
+ int i_hmargin, int i_vmargin, mtime_t i_start,
+ mtime_t i_stop )
{
subpicture_sys_t *p_string;
int i, i_pen_y, i_pen_x, i_error, i_glyph_index, i_previous;
p_subpic = 0;
/* Create and initialize a subpicture */
- p_subpic = vout_CreateSubPicture( p_vout, MEMORY_SUBPICTURE );
+ p_subpic = vout_CreateSubPicture( p_vout, i_channel, TEXT_CONTENT,
+ MEMORY_SUBPICTURE );
if ( p_subpic == NULL )
{
return NULL;
/**
* \brief Show text on the video for some time
* \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
* \param i_flags flags for alignment and such
* \param i_vmargin vertical margin in pixels
* \param i_duration Amount of time the text is to be shown.
*/
-subpicture_t *vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string,
- text_style_t *p_style, int i_flags,
- int i_hmargin, int i_vmargin,
+subpicture_t *vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel,
+ char *psz_string, text_style_t *p_style,
+ int i_flags, int i_hmargin, int i_vmargin,
mtime_t i_duration )
{
subpicture_t *p_subpic = NULL;
if ( p_vout->pf_add_string )
{
- p_subpic = p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags,
- i_hmargin, i_vmargin, i_now, i_now + i_duration );
+ p_subpic = p_vout->pf_add_string( p_vout, i_channel, psz_string,
+ p_style, i_flags, i_hmargin, i_vmargin, i_now, i_now + i_duration );
}
else
{
/**
* \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
* \param i_flags flags for alignment and such
* 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, char *psz_string,
- text_style_t *p_style, int i_flags,
- int i_hmargin, int i_vmargin, mtime_t i_start,
- mtime_t i_stop )
+int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
+ char *psz_string, text_style_t *p_style,
+ int i_flags, int i_hmargin, int i_vmargin,
+ mtime_t i_start, mtime_t i_stop )
{
if ( p_vout->pf_add_string )
{
- p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags,
+ p_vout->pf_add_string( p_vout, i_channel, psz_string, p_style, i_flags,
i_hmargin, i_vmargin, i_start, i_stop );
return VLC_SUCCESS;
}
* \brief Write an informative message at the default location,
* for the default duration and only if the OSD option is enabled.
* \param p_caller The object that called the function.
+ * \param i_channel Subpicture channel
* \param psz_format printf style formatting
**/
-void __vout_OSDMessage( vlc_object_t *p_caller, char *psz_format, ... )
+void __vout_OSDMessage( vlc_object_t *p_caller, int i_channel,
+ char *psz_format, ... )
{
vout_thread_t *p_vout;
char *psz_string;
{
va_start( args, psz_format );
vasprintf( &psz_string, psz_format, args );
- vlc_mutex_lock( &p_vout->change_lock );
- if( p_vout->p_last_osd_message )
- {
- vout_DestroySubPicture( p_vout, p_vout->p_last_osd_message );
- }
-
- p_vout->p_last_osd_message = vout_ShowTextRelative( p_vout, psz_string,
- NULL, OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,1000000 );
-
- vlc_mutex_unlock( &p_vout->change_lock );
+ vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL,
+ OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,1000000 );
vlc_object_release( p_vout );
free( psz_string );
int );
static void RenderRV32( vout_thread_t *, picture_t *, const subpicture_t *,
int );
-static subpicture_t *vout_CreateWidget( vout_thread_t * );
+static subpicture_t *vout_CreateWidget( vout_thread_t *, int );
static void FreeWidget( subpicture_t * );
/**
}
/*****************************************************************************
- * Render: place string in picture
+ * Render: place widget in picture
*****************************************************************************
- * This function merges the previously rendered freetype glyphs into a picture
+ * This function merges the previously drawn widget into a picture
*****************************************************************************/
static void Render( vout_thread_t *p_vout, picture_t *p_pic,
const subpicture_t *p_subpic )
/*****************************************************************************
* Creates and initializes an OSD widget.
*****************************************************************************/
-subpicture_t *vout_CreateWidget( vout_thread_t *p_vout )
+subpicture_t *vout_CreateWidget( vout_thread_t *p_vout, int i_channel )
{
subpicture_t *p_subpic;
subpicture_sys_t *p_widget;
p_widget = 0;
/* Create and initialize a subpicture */
- p_subpic = vout_CreateSubPicture( p_vout, MEMORY_SUBPICTURE );
+ p_subpic = vout_CreateSubPicture( p_vout, i_channel, GRAPH_CONTENT,
+ MEMORY_SUBPICTURE );
if( p_subpic == NULL )
{
return NULL;
* Displays an OSD slider.
* Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
*****************************************************************************/
-void vout_OSDSlider( vlc_object_t *p_caller, int i_position, short i_type )
+void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position,
+ short i_type )
{
vout_thread_t *p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
return;
}
- p_subpic = vout_CreateWidget( p_vout );
+ p_subpic = vout_CreateWidget( p_vout, i_channel );
if( p_subpic == NULL )
{
return;
p_widget->i_height - 1, STYLE_EMPTY );
}
- vlc_mutex_lock( &p_vout->change_lock );
-
- if( p_vout->p_last_osd_message )
- {
- vout_DestroySubPicture( p_vout, p_vout->p_last_osd_message );
- }
- p_vout->p_last_osd_message = p_subpic;
vout_DisplaySubPicture( p_vout, p_subpic );
- vlc_mutex_unlock( &p_vout->change_lock );
-
vlc_object_release( p_vout );
return;
}
FIND_ANYWHERE );
subpicture_t *p_subpic;
subpicture_sys_t *p_widget;
- int i_x_margin, i_y_margin;
+ int i_x_margin, i_y_margin, i_channel;
if( p_vout == NULL || !config_GetInt( p_caller, "osd" ) )
{
return;
}
- p_subpic = vout_CreateWidget( p_vout );
+ switch( i_type )
+ {
+ case OSD_SPEAKER_ICON:
+ i_channel = VOLUME_CHAN;
+ break;
+ default:
+ i_channel = SOLO_CHAN;
+ break;
+ }
+
+ p_subpic = vout_CreateWidget( p_vout, i_channel );
if( p_subpic == NULL )
{
return;
}
}
- vlc_mutex_lock( &p_vout->change_lock );
-
- if( p_vout->p_last_osd_message )
- {
- vout_DestroySubPicture( p_vout, p_vout->p_last_osd_message );
- }
- p_vout->p_last_osd_message = p_subpic;
vout_DisplaySubPicture( p_vout, p_subpic );
- vlc_mutex_unlock( &p_vout->change_lock );
-
vlc_object_release( p_vout );
return;
}
* \param i_type the type of the subpicture
* \return NULL on error, a reserved subpicture otherwise
*/
-subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type )
+subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_channel,
+ int i_content, int i_type )
{
int i_subpic; /* subpicture index */
subpicture_t * p_subpic = NULL; /* first free subpicture */
/* Get lock */
vlc_mutex_lock( &p_vout->subpicture_lock );
+ /*
+ * Destroy all subpics which are not in the correct channel and
+ * subpics which are in the right channel and have the same content type
+ * (only concerns exclusive channels)
+ */
+ if( i_channel >= BEGIN_EXCLUSIVE_CHAN )
+ {
+ for( i_subpic = 0; i_subpic < VOUT_MAX_SUBPICTURES; i_subpic++ )
+ {
+ p_subpic = &p_vout->p_subpicture[i_subpic];
+ if( p_subpic->i_status == FREE_SUBPICTURE
+ || ( p_subpic->i_status != RESERVED_SUBPICTURE
+ && p_subpic->i_status != READY_SUBPICTURE ) )
+ {
+ continue;
+ }
+ if( ( p_subpic->i_channel != i_channel
+ && p_subpic->i_channel >= BEGIN_EXCLUSIVE_CHAN )
+ || ( p_subpic->i_channel == i_channel
+ && p_subpic->i_content == i_content ) )
+ {
+ if( p_subpic->pf_destroy )
+ {
+ p_subpic->pf_destroy( p_subpic );
+ }
+ p_subpic->i_status = FREE_SUBPICTURE;
+ }
+ }
+ }
+
/*
* Look for an empty place
*/
+ p_subpic = NULL;
for( i_subpic = 0; i_subpic < VOUT_MAX_SUBPICTURES; i_subpic++ )
{
if( p_vout->p_subpicture[i_subpic].i_status == FREE_SUBPICTURE )
}
/* Copy subpicture information, set some default values */
+ p_subpic->i_channel = i_channel;
+ p_subpic->i_content = i_content;
+
p_subpic->i_type = i_type;
p_subpic->i_status = RESERVED_SUBPICTURE;
p_subpic->pf_destroy( p_subpic );
}
- if( p_subpic == p_vout->p_last_osd_message )
- {
- p_vout->p_last_osd_message = NULL;
- }
-
p_subpic->i_status = FREE_SUBPICTURE;
vlc_mutex_unlock( &p_vout->subpicture_lock );