type
stringclasses
5 values
content
stringlengths
9
163k
main
int main(int argc, char **argv) { int inx; bool showhelp = FALSE; bool showvers = FALSE; char *option = NULL; int retval = EXIT_SUCCESS; init_nls(); registry_module_init(); init_character_encodings(FC_DEFAULT_DATA_ENCODING, FALSE); /* Set the default log level. */ srvarg.loglevel = LOG_NORMAL; ...
includes
#include <vlc_common.h>
includes
#include <vlc_plugin.h>
includes
#include <vlc_osd.h>
includes
#include <vlc_filter.h>
includes
#include <vlc_stream.h>
includes
#include <vlc_xml.h>
includes
#include <vlc_input.h>
includes
#include <vlc_strings.h>
includes
#include <vlc_dialog.h>
includes
#include <vlc_memory.h>
includes
#include <math.h>
includes
#include <ft2build.h>
includes
#include <freetype/ftsynth.h>
includes
#include <fribidi/fribidi.h>
includes
#include <fontconfig/fontconfig.h>
includes
#include <assert.h>
defines
#define FT_FLOOR(X) ((X & -64) >> 6)
defines
#define FT_CEIL(X) (((X + 63) & -64) >> 6)
defines
#define FT_MulFix(v, s) (((v)*(s))>>16)
defines
#define DEFAULT_FONT "/Library/Fonts/Arial Black.ttf"
defines
#define FC_DEFAULT_FONT "Arial Black"
defines
#define DEFAULT_FONT "/boot/beos/etc/fonts/ttfonts/Swiss721.ttf"
defines
#define FC_DEFAULT_FONT "Swiss"
defines
#define DEFAULT_FONT "" /* Default font found at run-time */
defines
#define FC_DEFAULT_FONT "Arial"
defines
#define DEFAULT_FONT "/usr/share/fonts/nokia/nosnb.ttf"
defines
#define FC_DEFAULT_FONT "Nokia Sans Bold"
defines
#define DEFAULT_FONT "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
defines
#define FC_DEFAULT_FONT "Serif Bold"
defines
#define DEFAULT_FONT FC_DEFAULT_FONT
defines
#define FONT_TEXT N_("Font")
defines
#define FONT_LONGTEXT N_("Font family for the font you want to use")
defines
#define FONT_LONGTEXT N_("Fontfile for the font you want to use")
defines
#define FONTSIZE_TEXT N_("Font size in pixels")
defines
#define FONTSIZE_LONGTEXT N_("This is the default size of the fonts " \
defines
#define OPACITY_TEXT N_("Opacity")
defines
#define OPACITY_LONGTEXT N_("The opacity (inverse of transparency) of the " \
defines
#define COLOR_TEXT N_("Text default color")
defines
#define COLOR_LONGTEXT N_("The color of the text that will be rendered on "\
defines
#define FONTSIZER_TEXT N_("Relative font size")
defines
#define FONTSIZER_LONGTEXT N_("This is the relative default size of the " \
defines
#define YUVP_TEXT N_("Use YUVP renderer")
defines
#define YUVP_LONGTEXT N_("This renders the font using \"paletized YUV\". " \
defines
#define EFFECT_TEXT N_("Font Effect")
defines
#define EFFECT_LONGTEXT N_("It is possible to apply effects to the rendered " \
defines
#define EFFECT_BACKGROUND 1
defines
#define EFFECT_OUTLINE 2
defines
#define EFFECT_OUTLINE_FAT 3
defines
#define UCHAR uint32_t
defines
#define TR_DEFAULT_FONT p_sys->psz_fontfamily
defines
#define TR_FONT_STYLE_PTR ft_style_t *
defines
#define face p_sys->p_face
defines
#define glyph face->glyph
structs
struct line_desc_t { /** NULL-terminated list of glyphs making the string */ FT_BitmapGlyph *pp_glyphs; /** list of relative positions for the glyphs */ FT_Vector *p_glyph_pos; /** list of RGB information for styled text * -- if the rendering mode supports it (RenderYUVA) and * b_new...
structs
struct filter_sys_t { FT_Library p_library; /* handle to library */ FT_Face p_face; /* handle to face object */ bool i_use_kerning; uint8_t i_font_opacity; int i_font_color; int i_font_size; int i_effect; int i...
functions
int Create( vlc_object_t *p_this ) { filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys; char *psz_fontfile=NULL; char *psz_fontfamily=NULL; int i_error,fontindex; #ifdef HAVE_FONTCONFIG FcPattern *fontpattern = NULL, *fontmatch = NULL; /* In...
functions
else if( i_error ) { msg_Err( p_filter, "failed to load font file %s", psz_fontfile ? psz_fontfile : "(null)" ); goto error; }
functions
void Destroy( vlc_object_t *p_this ) { filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys = p_filter->p_sys; if( p_sys->pp_font_attachments ) { int k; for( k = 0; k < p_sys->i_font_attachments; k++ ) vlc_input_attachment_Delete( p_sys->pp_font_attachments[k] ); ...
functions
int LoadFontsFromAttachments( filter_t *p_filter ) { filter_sys_t *p_sys = p_filter->p_sys; input_thread_t *p_input; input_attachment_t **pp_attachments; int i_attachments_cnt; int k; int rv = VLC_SUCCESS; p_input = (input...
functions
int Render( filter_t *p_filter, subpicture_region_t *p_region, line_desc_t *p_line, int i_width, int i_height ) { VLC_UNUSED(p_filter); static const uint8_t pi_gamma[16] = {0x00, 0x52, 0x84, 0x96, 0xb8, 0xca, 0xdc, 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
functions
void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_ul_next_char, FT_BitmapGlyph p_this_glyph, FT_Vector *p_this_glyph_pos, FT_BitmapGlyph p_next_glyph, FT_Vector *p_next_glyph_pos, int i_glyph_tmax, i...
functions
void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_region, int xoffset, int yoffset ) { uint8_t *p_dst = p_region->p_picture->A_PIXELS; int i_pitch = p_region->p_picture->A_PITCH; int x,y; for( ; p_line != NULL; p_line = p_line->p_next ) { int i_glyph_tmax=0, i = 0; ...
functions
int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region, line_desc_t *p_line, int i_width, int i_height ) { uint8_t *p_dst_y,*p_dst_u,*p_dst_v,*p_dst_a; video_format_t fmt; int i, x, y, i_pitch, i_alpha; uint8_t i_y, i_u, i_v; /* YUV values, derived from incoming RGB */ ...
functions
int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, subpicture_region_t *p_region_in ) { filter_sys_t *p_sys = p_filter->p_sys; line_desc_t *p_lines = NULL, *p_line = NULL, *p_next = NULL, *p_prev = NULL; int i, i_pen_y, i_pen_x, i_error, i_glyph_index, i_previous;...
functions
if defined(HAVE_FRIBIDI) { uint32_t *p_fribidi_string; int32_t start_pos, pos = 0; p_fribidi_string = malloc( (i_string_length + 1) * sizeof(uint32_t) ); if( !p_fribidi_string ) goto error; /* Do bidi conversion line-by-line */ while( pos < i_string_leng...
functions
void DeleteStyle( ft_style_t *p_style ) { if( p_style ) { free( p_style->psz_fontname ); free( p_style ); }
functions
bool StyleEquals( ft_style_t *s1, ft_style_t *s2 ) { if( !s1 || !s2 ) return false; if( s1 == s2 ) return true; if(( s1->i_font_size == s2->i_font_size ) && ( s1->i_font_color == s2->i_font_color ) && ( s1->b_italic == s2->b_italic ) && ( s1->b_through == s2->b_...
functions
void IconvText( filter_t *p_filter, const char *psz_string, uint32_t *i_string_length, uint32_t **ppsz_unicode ) { vlc_iconv_t iconv_handle = (vlc_iconv_t)(-1); /* If memory hasn't been allocated for our output string, allocate it here * - the calling function must now be responsibl...
functions
int RenderTag( filter_t *p_filter, FT_Face p_face, int i_font_color, bool b_uline, bool b_through, bool b_bold, bool b_italic, int i_karaoke_bgcolor, line_desc_t *p_line, uint32_t *psz_unicode, int *pi_pen_x, int i_pen_y, int *pi_st...
functions
else if( psz_unicode > psz_unicode_start ) { for( i=0; psz_unicode[ i ]; i++ ) psz_unicode_start[ i ] = psz_unicode[ i ]; psz_unicode_start[ i ] = '\0'; }
functions
void SetupLine( filter_t *p_filter, const char *psz_text_in, uint32_t **psz_text_out, uint32_t *pi_runs, uint32_t **ppi_run_lengths, ft_style_t ***ppp_styles, ft_style_t *p_style ) { uint32_t i_string_length = 0; IconvText( p_filter, psz...
functions
else if( *pi_runs == 1 ) { *ppp_styles = malloc( *pi_runs * sizeof( ft_style_t * ) ); }
functions
else if( *pi_runs == 1 ) { *ppi_run_lengths = (uint32_t *) malloc( *pi_runs * sizeof( uint32_t ) ); }
functions
int CheckForEmbeddedFont( filter_sys_t *p_sys, FT_Face *pp_face, ft_style_t *p_style ) { int k; for( k=0; k < p_sys->i_font_attachments; k++ ) { input_attachment_t *p_attach = p_sys->pp_font_attachments[k]; int i_font_idx = 0; FT_Face p_face = NULL; ...
functions
int ProcessLines( filter_t *p_filter, uint32_t *psz_text, int i_len, uint32_t i_runs, uint32_t *pi_run_lengths, ft_style_t **pp_styles, line_desc_t **pp_lines, ...
functions
if defined(HAVE_FRIBIDI) { ft_style_t **pp_char_styles_new; int *p_old_positions; uint32_t *p_fribidi_string; int start_pos, pos = 0; pp_char_styles_new = (ft_style_t **) malloc( i_len * sizeof( ft_style_t * )); p_fribidi_string = (uint32_t ...
functions
else if( i_elapsed < i_last_duration ) { /* Haven't got up to this segment yet - * render it completely in karaoke BG mode */ fraction = 0.0; }
functions
endif if( p_line ) { p_result->x = __MAX( p_result->x, tmp_result.x ); p_result->y += tmp_result.y; }
functions
int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, subpicture_region_t *p_region_in ) { int rv = VLC_SUCCESS; stream_t *p_sub = NULL; xml_reader_t *p_xml_reader = NULL; if( !p_region_in || !p_region_in->psz_html ) return VLC_EGENERIC; ...
functions
void SetupLine( filter_t *p_filter, const char *psz_text_in, uint32_t **psz_text_out, uint32_t *pi_runs, uint32_t **ppi_run_lengths, ft_style_t ***ppp_styles, ft_style_t *p_style ) { VLC_UNUSED(p_filter); VLC_UNUSED(psz_text_in); ...
functions
void FreeLine( line_desc_t *p_line ) { unsigned int i; for( i = 0; p_line->pp_glyphs[ i ] != NULL; i++ ) { FT_Done_Glyph( (FT_Glyph)p_line->pp_glyphs[ i ] ); }
functions
void FreeLines( line_desc_t *p_lines ) { line_desc_t *p_line, *p_next; if( !p_lines ) return; for( p_line = p_lines; p_line != NULL; p_line = p_next ) { p_next = p_line->p_next; FreeLine( p_line ); }
functions
int GetFontSize( filter_t *p_filter ) { filter_sys_t *p_sys = p_filter->p_sys; vlc_value_t val; int i_size = 0; if( p_sys->i_default_font_size ) { if( VLC_SUCCESS == var_Get( p_filter, "scale", &val )) i_size = p_sys->i_default_font_size * val.i_int / 1000; e...
functions
int SetFontSize( filter_t *p_filter, int i_size ) { filter_sys_t *p_sys = p_filter->p_sys; if( !i_size ) { i_size = GetFontSize( p_filter ); msg_Dbg( p_filter, "using fontsize: %i", i_size ); }
functions
void YUVFromRGB( uint32_t i_argb, uint8_t *pi_y, uint8_t *pi_u, uint8_t *pi_v ) { int i_red = ( i_argb & 0x00ff0000 ) >> 16; int i_green = ( i_argb & 0x0000ff00 ) >> 8; int i_blue = ( i_argb & 0x000000ff ); *pi_y = (uint8_t)__MIN(abs( 2104 * i_red + 4130 * i_green + ...
includes
#include <stdio.h>
includes
#include <ctype.h>
includes
#include <string.h>
includes
#include <unistd.h>
defines
#define ARGEXT "argument"
defines
#define NFILES 7
defines
#define TABSIZE 4
functions
void reinitialize (void) { memset (curline, 0, MAXLINESIZE); where = curline; linenum = 0; defined = NULL; }
functions
int streq (const char *a, const char *b) { return strcmp (a, b) == 0; }
functions
void storeval (list **lstp, definition *val) { list **l; list *lst; for (l = lstp; *l != NULL; l = (list **) & (*l)->next); lst = ALLOC (list); lst->val = val; lst->next = NULL; *l = lst; }
functions
int findit (const definition * def, const char *type) { return streq (def->def_name, type); }
functions
void ptype (const char *prefix, const char *type, int follow) { if (prefix != NULL) { if (streq (prefix, "enum")) { f_print (fout, "enum "); }
functions
int typedefed (const definition * def, const char *type) { if (def->def_kind != DEF_TYPEDEF || def->def.ty.old_prefix != NULL) { return 0; }
functions
int isvectordef (const char *type, relation rel) { definition *def; for (;;) { switch (rel) { case REL_VECTOR: return !streq (type, "string"); case REL_ARRAY: return 0; case REL_POINTER: return 0; case REL_ALIAS: def = findval (defined, type, typedefed); if (def == NULL) { ...