// Preamble
//////////////////////////////////////////////////////////////////////////////
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_osd.h>
#include <vlc_block.h>
ATSUStyle *pp_styles );
static ATSUStyle CreateStyle( char *psz_fontname, int i_font_size,
uint32_t i_font_color,
- vlc_bool_t b_bold, vlc_bool_t b_italic,
- vlc_bool_t b_uline );
+ bool b_bold, bool b_italic,
+ bool b_uline );
//////////////////////////////////////////////////////////////////////////////
// Module descriptor
//////////////////////////////////////////////////////////////////////////////
// override the fallback font selection used when this style information is
// absent.
vlc_module_begin();
- set_shortname( _("Mac Text renderer"));
- set_description( _("Quartz font renderer") );
+ set_shortname( N_("Mac Text renderer"));
+ set_description( N_("Quartz font renderer") );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_SUBPIC );
// Allocate structure
p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
if( !p_sys )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
p_sys->psz_font_name = strdup( DEFAULT_FONT );
p_sys->i_font_opacity = 255;
p_sys->i_font_color = DEFAULT_FONT_COLOR;
free( p_sys->p_fonts );
}
- if( p_sys->psz_font_name ) free( p_sys->psz_font_name );
-
+ free( p_sys->psz_font_name );
free( p_sys );
}
ATSUStyle p_style = CreateStyle( p_sys->psz_font_name, i_font_size,
(i_font_color & 0xffffff) |
((i_font_alpha & 0xff) << 24),
- VLC_FALSE, VLC_FALSE, VLC_FALSE );
+ false, false, false );
if( p_style )
{
RenderYUVA( p_filter, p_region_out, psz_utf16_str, i_string_length,
static ATSUStyle CreateStyle( char *psz_fontname, int i_font_size, uint32_t i_font_color,
- vlc_bool_t b_bold, vlc_bool_t b_italic, vlc_bool_t b_uline )
+ bool b_bold, bool b_italic, bool b_uline )
{
ATSUStyle p_style;
OSStatus status;
}
static ATSUStyle GetStyleFromFontStack( filter_sys_t *p_sys,
- font_stack_t **p_fonts, vlc_bool_t b_bold, vlc_bool_t b_italic,
- vlc_bool_t b_uline )
+ font_stack_t **p_fonts, bool b_bold, bool b_italic,
+ bool b_uline )
{
ATSUStyle p_style = NULL;
{
if( !strcasecmp( "face", psz_name ) )
{
- if( psz_fontname ) free( psz_fontname );
+ free( psz_fontname );
psz_fontname = strdup( psz_value );
}
else if( !strcasecmp( "size", psz_name ) )
char *psz_node = NULL;
- vlc_bool_t b_italic = VLC_FALSE;
- vlc_bool_t b_bold = VLC_FALSE;
- vlc_bool_t b_uline = VLC_FALSE;
+ bool b_italic = false;
+ bool b_bold = false;
+ bool b_uline = false;
if( VLC_SUCCESS == var_Get( p_filter, "scale", &val ))
i_scale = val.i_int;
((p_font_style->i_font_alpha & 0xff) << 24) );
if( p_font_style->i_style_flags & STYLE_BOLD )
- b_bold = VLC_TRUE;
+ b_bold = true;
if( p_font_style->i_style_flags & STYLE_ITALIC )
- b_italic = VLC_TRUE;
+ b_italic = true;
if( p_font_style->i_style_flags & STYLE_UNDERLINE )
- b_uline = VLC_TRUE;
+ b_uline = true;
}
else
{
if( !strcasecmp( "font", psz_node ) )
PopFont( &p_fonts );
else if( !strcasecmp( "b", psz_node ) )
- b_bold = VLC_FALSE;
+ b_bold = false;
else if( !strcasecmp( "i", psz_node ) )
- b_italic = VLC_FALSE;
+ b_italic = false;
else if( !strcasecmp( "u", psz_node ) )
- b_uline = VLC_FALSE;
+ b_uline = false;
free( psz_node );
}
if( !strcasecmp( "font", psz_node ) )
rv = HandleFontAttributes( p_xml_reader, &p_fonts, i_scale );
else if( !strcasecmp( "b", psz_node ) )
- b_bold = VLC_TRUE;
+ b_bold = true;
else if( !strcasecmp( "i", psz_node ) )
- b_italic = VLC_TRUE;
+ b_italic = true;
else if( !strcasecmp( "u", psz_node ) )
- b_uline = VLC_TRUE;
+ b_uline = true;
else if( !strcasecmp( "br", psz_node ) )
{
uint32_t i_string_length;
p_sub = stream_MemoryNew( VLC_OBJECT(p_filter),
(uint8_t *) p_region_in->psz_html,
strlen( p_region_in->psz_html ),
- VLC_TRUE );
+ true );
if( p_sub )
{
p_xml = xml_Create( p_filter );
if( p_xml )
{
- vlc_bool_t b_karaoke = VLC_FALSE;
+ bool b_karaoke = false;
p_xml_reader = xml_ReaderCreate( p_xml, p_sub );
if( p_xml_reader )
/* We're going to have to render the text a number
* of times to show the progress marker on the text.
*/
- var_SetBool( p_filter, "text-rerender", VLC_TRUE );
- b_karaoke = VLC_TRUE;
+ var_SetBool( p_filter, "text-rerender", true );
+ b_karaoke = true;
}
else if( !strcasecmp( "text", psz_node ) )
{
- b_karaoke = VLC_FALSE;
+ b_karaoke = false;
}
else
{
// you move down the page
y -= ascent;
- // Set the outlining for this line to be dependant on the size of the line -
+ // Set the outlining for this line to be dependent on the size of the line -
// make it about 5% of the ascent, with a minimum at 1.0
float f_thickness = FixedToFloat( ascent ) * 0.05;
CGContextSetLineWidth( p_context, (( f_thickness > 1.0 ) ? 1.0 : f_thickness ));