X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Fdynamicoverlay%2Fdynamicoverlay.c;h=02e9a56cd3dbc7a9b5691a81260185462c5b0a8f;hb=688f0a8d8913f20ac5d3e27bf4f2bbe35c9f5de7;hp=cee5c5c4165ca6b38e225aac14081ab2ccd2795c;hpb=2357ced8cd030854a8215ed03da6cf316d201b1f;p=vlc diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c index cee5c5c416..02e9a56cd3 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 the VideoLAN team * $Id$ * - * Author: Søren Bøg + * Author: Soren Bog * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ # include "config.h" #endif -#include +#include +#include #include #include #include @@ -61,22 +62,22 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var, #define OUTPUT_LONGTEXT N_("FIFO which will be written to for responses") vlc_module_begin(); - set_description( _("Dynamic video overlay") ); - set_shortname( _("Overlay" )); + set_description( N_("Dynamic video overlay") ); + set_shortname( N_("Overlay" )); set_category( CAT_VIDEO ); set_subcategory( SUBCAT_VIDEO_VFILTER ); set_capability( "sub filter", 0 ); add_file( "overlay-input", NULL, NULL, INPUT_TEXT, INPUT_LONGTEXT, - VLC_FALSE ); + false ); add_file( "overlay-output", NULL, NULL, OUTPUT_TEXT, OUTPUT_LONGTEXT, - VLC_FALSE ); + false ); add_shortcut( "overlay" ); set_callbacks( Create, Destroy ); vlc_module_end(); -static const char *ppsz_filter_options[] = { +static const char *const ppsz_filter_options[] = { "input", "output", NULL }; @@ -93,10 +94,7 @@ static int Create( vlc_object_t *p_this ) /* Allocate structure */ p_filter->p_sys = malloc( sizeof( filter_sys_t ) ); if( p_filter->p_sys == NULL ) - { - msg_Err( p_filter, "out of memory" ); return VLC_ENOMEM; - } p_sys = p_filter->p_sys; BufferInit( &p_sys->input ); @@ -108,8 +106,8 @@ static int Create( vlc_object_t *p_this ) p_sys->i_inputfd = -1; p_sys->i_outputfd = -1; - p_sys->b_updated = VLC_TRUE; - p_sys->b_atomic = VLC_FALSE; + p_sys->b_updated = true; + p_sys->b_atomic = false; p_filter->pf_sub_filter = Filter; @@ -228,7 +226,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) p_sys->input.i_length ) ) ) { commanddesc_t *p_cur = NULL; - vlc_bool_t b_found = VLC_FALSE; + bool b_found = false; size_t i_index = 0; *p_end = '\0'; @@ -241,7 +239,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) if( !strncmp( p_cur->psz_command, p_cmd, strlen(p_cur->psz_command) ) ) { p_cmd[strlen(p_cur->psz_command)] = '\0'; - b_found = VLC_TRUE; + b_found = true; break; } } @@ -265,8 +263,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) p_cmddesc->p_command->pf_parser( p_cmd, p_end, &p_cmddesc->params ); - if( ( p_cmddesc->p_command->b_atomic == VLC_TRUE ) && - ( p_sys->b_atomic == VLC_TRUE ) ) + if( ( p_cmddesc->p_command->b_atomic == true ) && + ( p_sys->b_atomic == true ) ) QueueEnqueue( &p_sys->atomic, p_cmddesc ); else QueueEnqueue( &p_sys->pending, p_cmddesc ); @@ -326,7 +324,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) } } - if( p_sys->b_updated == VLC_FALSE ) + if( p_sys->b_updated == false ) return NULL; subpicture_t *p_spu = NULL; @@ -342,10 +340,10 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; p_spu->i_x = 0; p_spu->i_y = 0; - p_spu->b_absolute = VLC_TRUE; + p_spu->b_absolute = true; p_spu->i_start = date; p_spu->i_stop = 0; - p_spu->b_ephemer = VLC_TRUE; + p_spu->b_ephemer = true; subpicture_region_t **pp_region = &p_spu->p_region; while( (p_overlay = ListWalk( &p_sys->overlays )) ) @@ -368,9 +366,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) *pp_region = NULL; break; } - p_filter->p_libvlc->pf_memcpy( (*pp_region)->p_style, - &p_overlay->fontstyle, - sizeof(struct text_style_t) ); + vlc_memcpy( (*pp_region)->p_style, &p_overlay->fontstyle, + sizeof(struct text_style_t) ); } else { @@ -401,7 +398,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) pp_region = &(*pp_region)->p_next; } - p_sys->b_updated = VLC_FALSE; + p_sys->b_updated = false; return p_spu; }