X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Flogo.c;h=6fcedca0213adf294ff7eb4e6eacf00a26d12590;hb=17365ad04c4fecd14bc904bd1e664a0d88159f91;hp=24325febf326d46be9b7f468403815e066727a65;hpb=a78e273ec53ff8a6c3993f3deda0b893f8dd709a;p=vlc diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c index 24325febf3..6fcedca021 100644 --- a/modules/video_filter/logo.c +++ b/modules/video_filter/logo.c @@ -30,7 +30,8 @@ # include "config.h" #endif -#include +#include +#include #include #include "vlc_filter.h" @@ -94,39 +95,39 @@ static int LogoCallback( vlc_object_t *, char const *, #define CFG_PREFIX "logo-" -static int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; -static const char *ppsz_pos_descriptions[] = +static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; +static const char *const ppsz_pos_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; vlc_module_begin(); - set_description( _("Logo video filter") ); + set_description( N_("Logo video filter") ); set_capability( "video filter", 0 ); - set_shortname( _("Logo overlay") ); + set_shortname( N_("Logo overlay") ); set_category( CAT_VIDEO ); set_subcategory( SUBCAT_VIDEO_SUBPIC ); add_shortcut( "logo" ); set_callbacks( Create, Destroy ); - add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, VLC_FALSE ); - add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, VLC_TRUE ); - add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, VLC_TRUE ); + add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false ); + add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true ); + add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, true ); /* default to 1000 ms per image, continuously cycle through them */ - add_integer( CFG_PREFIX "delay", 1000, NULL, DELAY_TEXT, DELAY_LONGTEXT, VLC_TRUE ); - add_integer( CFG_PREFIX "repeat", -1, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE ); + add_integer( CFG_PREFIX "delay", 1000, NULL, DELAY_TEXT, DELAY_LONGTEXT, true ); + add_integer( CFG_PREFIX "repeat", -1, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, true ); add_integer_with_range( CFG_PREFIX "transparency", 255, 0, 255, NULL, - TRANS_TEXT, TRANS_LONGTEXT, VLC_FALSE ); - add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, VLC_FALSE ); + TRANS_TEXT, TRANS_LONGTEXT, false ); + add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, false ); change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 ); /* subpicture filter submodule */ add_submodule(); set_capability( "sub filter", 0 ); set_callbacks( CreateFilter, DestroyFilter ); - set_description( _("Logo sub filter") ); + set_description( N_("Logo sub filter") ); vlc_module_end(); -static const char *ppsz_filter_options[] = { +static const char *const ppsz_filter_options[] = { "file", "x", "y", "delay", "repeat", "transparency", "position", NULL }; @@ -488,12 +489,9 @@ static void End( vout_thread_t *p_vout ) var_DelCallback( p_sys->p_vout, "mouse-x", MouseEvent, p_vout); var_DelCallback( p_sys->p_vout, "mouse-y", MouseEvent, p_vout); - if( p_sys->p_vout ) - { - DEL_CALLBACKS( p_sys->p_vout, SendEvents ); - vlc_object_detach( p_sys->p_vout ); - vout_Destroy( p_sys->p_vout ); - } + DEL_CALLBACKS( p_sys->p_vout, SendEvents ); + vlc_object_detach( p_sys->p_vout ); + vlc_object_release( p_sys->p_vout ); if( p_sys->p_blend->p_module ) module_Unneed( p_sys->p_blend, p_sys->p_blend->p_module ); @@ -689,11 +687,11 @@ struct filter_sys_t int pos, posx, posy; - vlc_bool_t b_absolute; + bool b_absolute; mtime_t i_last_date; /* On the fly control variable */ - vlc_bool_t b_need_update; + bool b_need_update; }; static subpicture_t *Filter( filter_t *, mtime_t ); @@ -753,7 +751,7 @@ static int CreateFilter( vlc_object_t *p_this ) var_AddCallback( p_filter, "logo-transparency", LogoCallback, p_sys ); var_AddCallback( p_filter, "logo-repeat", LogoCallback, p_sys ); - vlc_mutex_init( p_filter, &p_logo_list->lock ); + vlc_mutex_init( &p_logo_list->lock ); vlc_mutex_lock( &p_logo_list->lock ); LoadLogoList( p_this, p_logo_list ); @@ -762,7 +760,7 @@ static int CreateFilter( vlc_object_t *p_this ) /* Misc init */ p_filter->pf_sub_filter = Filter; - p_sys->b_need_update = VLC_TRUE; + p_sys->b_need_update = true; p_sys->i_last_date = 0; @@ -838,9 +836,9 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) p_spu->b_absolute = p_sys->b_absolute; p_spu->i_start = p_sys->i_last_date = date; p_spu->i_stop = 0; - p_spu->b_ephemer = VLC_TRUE; + p_spu->b_ephemer = true; - p_sys->b_need_update = VLC_FALSE; + p_sys->b_need_update = false; p_logo_list->i_next_pic = date + ( p_logo->i_delay != -1 ? p_logo->i_delay : p_logo_list->i_delay ) * 1000; @@ -887,12 +885,12 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) if( p_sys->pos < 0 ) { /* set to an absolute xy */ p_region->i_align = OSD_ALIGN_RIGHT | OSD_ALIGN_TOP; - p_spu->b_absolute = VLC_TRUE; + p_spu->b_absolute = true; } else { /* set to one of the 9 relative locations */ p_region->i_align = p_sys->pos; - p_spu->b_absolute = VLC_FALSE; + p_spu->b_absolute = false; } p_spu->i_x = p_sys->posx; @@ -923,7 +921,7 @@ static int LogoCallback( vlc_object_t *p_this, char const *psz_var, p_logo_list->psz_filename = strdup( newval.psz_string ); LoadLogoList( p_this, p_logo_list ); vlc_mutex_unlock( &p_logo_list->lock ); - p_sys->b_need_update = VLC_TRUE; + p_sys->b_need_update = true; } else if ( !strncmp( psz_var, "logo-x", 6 ) ) { @@ -949,6 +947,6 @@ static int LogoCallback( vlc_object_t *p_this, char const *psz_var, p_logo_list->i_repeat = newval.i_int; vlc_mutex_unlock( &p_logo_list->lock ); } - p_sys->b_need_update = VLC_TRUE; + p_sys->b_need_update = true; return VLC_SUCCESS; }