1 /*****************************************************************************
2 * logo.c : logo video plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2003-2004 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@videolan.org>
8 * Simon Latapie <garf@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
34 #include "vlc_filter.h"
35 #include "filter_common.h"
36 #include "vlc_image.h"
43 /*****************************************************************************
45 *****************************************************************************/
46 static int Create ( vlc_object_t * );
47 static void Destroy ( vlc_object_t * );
49 static int Init ( vout_thread_t * );
50 static void End ( vout_thread_t * );
51 static void Render ( vout_thread_t *, picture_t * );
53 static int SendEvents( vlc_object_t *, char const *,
54 vlc_value_t, vlc_value_t, void * );
55 static int MouseEvent( vlc_object_t *, char const *,
56 vlc_value_t , vlc_value_t , void * );
57 static int Control ( vout_thread_t *, int, va_list );
59 static int CreateFilter ( vlc_object_t * );
60 static void DestroyFilter( vlc_object_t * );
62 static int LogoCallback( vlc_object_t *, char const *,
63 vlc_value_t, vlc_value_t, void * );
65 /*****************************************************************************
67 *****************************************************************************/
68 #define FILE_TEXT N_("Logo filename")
69 #define FILE_LONGTEXT N_("Full path of the PNG file to use.")
70 #define POSX_TEXT N_("X coordinate of the logo")
71 #define POSX_LONGTEXT N_("You can move the logo by left-clicking on it." )
72 #define POSY_TEXT N_("Y coordinate of the logo")
73 #define POSY_LONGTEXT N_("You can move the logo by left-clicking on it." )
74 #define TRANS_TEXT N_("Transparency of the logo")
75 #define TRANS_LONGTEXT N_("You can set the logo transparency value here " \
76 "(from 0 for full transparency to 255 for full opacity)." )
77 #define POS_TEXT N_("Logo position")
78 #define POS_LONGTEXT N_( \
79 "You can enforce the logo position on the video " \
80 "(0=center, 1=left, 2=right, 4=top, 8=bottom, you can " \
81 "also use combinations of these values).")
83 static int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
84 static char *ppsz_pos_descriptions[] =
85 { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
86 N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
89 set_description( _("Logo video filter") );
90 set_capability( "video filter", 0 );
91 set_shortname( N_("Logo overlay") );
92 set_category( CAT_VIDEO );
93 set_subcategory( SUBCAT_VIDEO_SUBPIC );
94 add_shortcut( "logo" );
95 set_callbacks( Create, Destroy );
97 add_file( "logo-file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, VLC_FALSE );
98 add_integer( "logo-x", -1, NULL, POSX_TEXT, POSX_LONGTEXT, VLC_TRUE );
99 add_integer( "logo-y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, VLC_TRUE );
100 add_integer_with_range( "logo-transparency", 255, 0, 255, NULL,
101 TRANS_TEXT, TRANS_LONGTEXT, VLC_FALSE );
102 add_integer( "logo-position", 6, NULL, POS_TEXT, POS_LONGTEXT, VLC_FALSE );
103 change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 );
105 /* subpicture filter submodule */
107 set_capability( "sub filter", 0 );
108 set_callbacks( CreateFilter, DestroyFilter );
109 set_description( _("Logo sub filter") );
110 add_shortcut( "logo" );
113 /*****************************************************************************
114 * LoadImage: loads the logo image into memory
115 *****************************************************************************/
116 static picture_t *LoadImage( vlc_object_t *p_this, char *psz_filename )
119 image_handler_t *p_image;
120 video_format_t fmt_in = {0}, fmt_out = {0};
122 fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
123 p_image = image_HandlerCreate( p_this );
124 p_pic = image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
125 image_HandlerDelete( p_image );
130 /*****************************************************************************
131 * vout_sys_t: logo video output method descriptor
132 *****************************************************************************
133 * This structure is part of the video output thread descriptor.
134 * It describes the Invert specific properties of an output thread.
135 *****************************************************************************/
138 vout_thread_t *p_vout;
143 int i_width, i_height;
149 /*****************************************************************************
150 * Create: allocates logo video thread output method
151 *****************************************************************************/
152 static int Create( vlc_object_t *p_this )
154 vout_thread_t *p_vout = (vout_thread_t *)p_this;
158 /* Allocate structure */
159 p_sys = p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
162 msg_Err( p_vout, "out of memory" );
166 p_vout->pf_init = Init;
167 p_vout->pf_end = End;
168 p_vout->pf_manage = NULL;
169 p_vout->pf_render = Render;
170 p_vout->pf_display = NULL;
171 p_vout->pf_control = Control;
173 p_sys->psz_filename = var_CreateGetString( p_this , "logo-file" );
174 if( !p_sys->psz_filename || !*p_sys->psz_filename )
176 msg_Err( p_this, "logo file not specified" );
180 var_Create( p_this, "logo-position", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
181 var_Get( p_this, "logo-position", &val );
182 p_sys->pos = val.i_int;
183 var_Create( p_this, "logo-x", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
184 var_Get( p_this, "logo-x", &val );
185 p_sys->posx = val.i_int;
186 var_Create( p_this, "logo-y", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
187 var_Get( p_this, "logo-y", &val );
188 p_sys->posy = val.i_int;
189 var_Create(p_this, "logo-transparency", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT);
190 var_Get( p_this, "logo-transparency", &val );
191 p_sys->i_trans = __MAX( __MIN( val.i_int, 255 ), 0 );
193 p_sys->p_pic = LoadImage( p_this, p_sys->psz_filename );
200 p_sys->i_width = p_sys->p_pic->p[Y_PLANE].i_visible_pitch;
201 p_sys->i_height = p_sys->p_pic->p[Y_PLANE].i_visible_lines;
206 /*****************************************************************************
207 * Init: initialize logo video thread output method
208 *****************************************************************************/
209 static int Init( vout_thread_t *p_vout )
211 vout_sys_t *p_sys = p_vout->p_sys;
214 video_format_t fmt = {0};
216 I_OUTPUTPICTURES = 0;
218 /* Initialize the output structure */
219 p_vout->output.i_chroma = p_vout->render.i_chroma;
220 p_vout->output.i_width = p_vout->render.i_width;
221 p_vout->output.i_height = p_vout->render.i_height;
222 p_vout->output.i_aspect = p_vout->render.i_aspect;
224 fmt.i_width = fmt.i_visible_width = p_vout->render.i_width;
225 fmt.i_height = fmt.i_visible_height = p_vout->render.i_height;
226 fmt.i_x_offset = fmt.i_y_offset = 0;
227 fmt.i_chroma = p_vout->render.i_chroma;
228 fmt.i_aspect = p_vout->render.i_aspect;
229 fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
230 fmt.i_sar_den = VOUT_ASPECT_FACTOR;
232 /* Load the video blending filter */
233 p_sys->p_blend = vlc_object_create( p_vout, sizeof(filter_t) );
234 vlc_object_attach( p_sys->p_blend, p_vout );
235 p_sys->p_blend->fmt_out.video.i_x_offset =
236 p_sys->p_blend->fmt_out.video.i_y_offset = 0;
237 p_sys->p_blend->fmt_in.video.i_x_offset =
238 p_sys->p_blend->fmt_in.video.i_y_offset = 0;
239 p_sys->p_blend->fmt_out.video.i_aspect = p_vout->render.i_aspect;
240 p_sys->p_blend->fmt_out.video.i_chroma = p_vout->output.i_chroma;
241 p_sys->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','A');
242 p_sys->p_blend->fmt_in.video.i_aspect = VOUT_ASPECT_FACTOR;
243 p_sys->p_blend->fmt_in.video.i_width =
244 p_sys->p_blend->fmt_in.video.i_visible_width =
245 p_sys->p_pic->p[Y_PLANE].i_visible_pitch;
246 p_sys->p_blend->fmt_in.video.i_height =
247 p_sys->p_blend->fmt_in.video.i_visible_height =
248 p_sys->p_pic->p[Y_PLANE].i_visible_lines;
249 p_sys->p_blend->fmt_out.video.i_width =
250 p_sys->p_blend->fmt_out.video.i_visible_width =
251 p_vout->output.i_width;
252 p_sys->p_blend->fmt_out.video.i_height =
253 p_sys->p_blend->fmt_out.video.i_visible_height =
254 p_vout->output.i_height;
256 p_sys->p_blend->p_module =
257 module_Need( p_sys->p_blend, "video blending", 0, 0 );
258 if( !p_sys->p_blend->p_module )
260 msg_Err( p_vout, "can't open blending filter, aborting" );
261 vlc_object_detach( p_sys->p_blend );
262 vlc_object_destroy( p_sys->p_blend );
266 if( p_sys->posx < 0 || p_sys->posy < 0 )
268 p_sys->posx = 0; p_sys->posy = 0;
270 if( p_sys->pos & SUBPICTURE_ALIGN_BOTTOM )
272 p_sys->posy = p_vout->render.i_height - p_sys->i_height;
274 else if ( !(p_sys->pos & SUBPICTURE_ALIGN_TOP) )
276 p_sys->posy = p_vout->render.i_height / 2 - p_sys->i_height / 2;
279 if( p_sys->pos & SUBPICTURE_ALIGN_RIGHT )
281 p_sys->posx = p_vout->render.i_width - p_sys->i_width;
283 else if ( !(p_sys->pos & SUBPICTURE_ALIGN_LEFT) )
285 p_sys->posx = p_vout->render.i_width / 2 - p_sys->i_width / 2;
289 /* Try to open the real video output */
290 msg_Dbg( p_vout, "spawning the real video output" );
292 p_sys->p_vout = vout_Create( p_vout, &fmt );
294 /* Everything failed */
295 if( p_sys->p_vout == NULL )
297 msg_Err( p_vout, "can't open vout, aborting" );
301 var_AddCallback( p_sys->p_vout, "mouse-x", MouseEvent, p_vout);
302 var_AddCallback( p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
304 ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
305 ADD_CALLBACKS( p_sys->p_vout, SendEvents );
306 ADD_PARENT_CALLBACKS( SendEventsToChild );
311 /*****************************************************************************
312 * End: terminate logo video thread output method
313 *****************************************************************************/
314 static void End( vout_thread_t *p_vout )
316 vout_sys_t *p_sys = p_vout->p_sys;
319 /* Free the fake output buffers we allocated */
320 for( i_index = I_OUTPUTPICTURES ; i_index ; )
323 free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
326 var_DelCallback( p_sys->p_vout, "mouse-x", MouseEvent, p_vout);
327 var_DelCallback( p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
331 DEL_CALLBACKS( p_sys->p_vout, SendEvents );
332 vlc_object_detach( p_sys->p_vout );
333 vout_Destroy( p_sys->p_vout );
336 if( p_sys->p_blend->p_module )
337 module_Unneed( p_sys->p_blend, p_sys->p_blend->p_module );
338 vlc_object_detach( p_sys->p_blend );
339 vlc_object_destroy( p_sys->p_blend );
342 /*****************************************************************************
343 * Destroy: destroy logo video thread output method
344 *****************************************************************************/
345 static void Destroy( vlc_object_t *p_this )
347 vout_thread_t *p_vout = (vout_thread_t *)p_this;
348 vout_sys_t *p_sys = p_vout->p_sys;
350 DEL_PARENT_CALLBACKS( SendEventsToChild );
352 if( p_sys->p_pic ) p_sys->p_pic->pf_release( p_sys->p_pic );
356 /*****************************************************************************
357 * Render: render the logo onto the video
358 *****************************************************************************/
359 static void Render( vout_thread_t *p_vout, picture_t *p_pic )
361 vout_sys_t *p_sys = p_vout->p_sys;
364 /* This is a new frame. Get a structure from the video_output. */
365 while( !(p_outpic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 )) )
367 if( p_vout->b_die || p_vout->b_error ) return;
368 msleep( VOUT_OUTMEM_SLEEP );
371 vout_CopyPicture( p_vout, p_outpic, p_pic );
372 vout_DatePicture( p_sys->p_vout, p_outpic, p_pic->date );
374 p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic, p_outpic,
375 p_sys->p_pic, p_sys->posx, p_sys->posy,
378 vout_DisplayPicture( p_sys->p_vout, p_outpic );
381 /*****************************************************************************
382 * SendEvents: forward mouse and keyboard events to the parent p_vout
383 *****************************************************************************/
384 static int SendEvents( vlc_object_t *p_this, char const *psz_var,
385 vlc_value_t oldval, vlc_value_t newval, void *p_data )
387 var_Set( (vlc_object_t *)p_data, psz_var, newval );
391 /*****************************************************************************
392 * MouseEvent: callback for mouse events
393 *****************************************************************************/
394 static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
395 vlc_value_t oldval, vlc_value_t newval, void *p_data )
397 vout_thread_t *p_vout = (vout_thread_t*)p_data;
398 vout_sys_t *p_sys = p_vout->p_sys;
402 var_Get( p_vout->p_sys->p_vout, "mouse-button-down", &valb );
404 i_delta = newval.i_int - oldval.i_int;
406 if( (valb.i_int & 0x1) == 0 )
411 if( psz_var[6] == 'x' )
414 var_Get( p_vout->p_sys->p_vout, "mouse-y", &valy );
415 if( newval.i_int >= (int)p_sys->posx &&
416 valy.i_int >= (int)p_sys->posy &&
417 newval.i_int <= (int)(p_sys->posx + p_sys->i_width) &&
418 valy.i_int <= (int)(p_sys->posy + p_sys->i_height) )
420 p_sys->posx = __MIN( __MAX( p_sys->posx + i_delta, 0 ),
421 p_vout->output.i_width - p_sys->i_width );
424 else if( psz_var[6] == 'y' )
427 var_Get( p_vout->p_sys->p_vout, "mouse-x", &valx );
428 if( valx.i_int >= (int)p_sys->posx &&
429 newval.i_int >= (int)p_sys->posy &&
430 valx.i_int <= (int)(p_sys->posx + p_sys->i_width) &&
431 newval.i_int <= (int)(p_sys->posy + p_sys->i_height) )
433 p_sys->posy = __MIN( __MAX( p_sys->posy + i_delta, 0 ),
434 p_vout->output.i_height - p_sys->i_height );
441 /*****************************************************************************
442 * Control: control facility for the vout (forwards to child vout)
443 *****************************************************************************/
444 static int Control( vout_thread_t *p_vout, int i_query, va_list args )
446 return vout_vaControl( p_vout->p_sys->p_vout, i_query, args );
449 /*****************************************************************************
450 * SendEventsToChild: forward events to the child/children vout
451 *****************************************************************************/
452 static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
453 vlc_value_t oldval, vlc_value_t newval, void *p_data )
455 vout_thread_t *p_vout = (vout_thread_t *)p_this;
456 var_Set( p_vout->p_sys->p_vout, psz_var, newval );
460 /*****************************************************************************
461 * filter_sys_t: logo filter descriptor
462 *****************************************************************************/
467 int i_width, i_height;
472 vlc_bool_t b_absolute;
476 /* On the fly control variable */
477 vlc_bool_t b_need_update;
478 vlc_bool_t b_new_image;
481 static subpicture_t *Filter( filter_t *, mtime_t );
483 /*****************************************************************************
484 * CreateFilter: allocates logo video filter
485 *****************************************************************************/
486 static int CreateFilter( vlc_object_t *p_this )
488 filter_t *p_filter = (filter_t *)p_this;
490 vlc_object_t *p_input;
492 /* Allocate structure */
493 p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
496 msg_Err( p_filter, "out of memory" );
500 /* Hook used for callback variables */
501 p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
508 p_sys->psz_filename =
509 var_CreateGetString( p_input->p_libvlc , "logo-file" );
510 if( !p_sys->psz_filename || !*p_sys->psz_filename )
512 msg_Err( p_this, "logo file not specified" );
513 vlc_object_release( p_input );
514 if( p_sys->psz_filename ) free( p_sys->psz_filename );
519 p_sys->posx = var_CreateGetInteger( p_input->p_libvlc , "logo-x" );
520 p_sys->posy = var_CreateGetInteger( p_input->p_libvlc , "logo-y" );
521 p_sys->pos = var_CreateGetInteger( p_input->p_libvlc , "logo-position" );
523 var_CreateGetInteger( p_input->p_libvlc, "logo-transparency");
524 p_sys->i_trans = __MAX( __MIN( p_sys->i_trans, 255 ), 0 );
526 var_AddCallback( p_input->p_libvlc, "logo-file", LogoCallback, p_sys );
527 var_AddCallback( p_input->p_libvlc, "logo-x", LogoCallback, p_sys );
528 var_AddCallback( p_input->p_libvlc, "logo-y", LogoCallback, p_sys );
529 var_AddCallback( p_input->p_libvlc, "logo-position", LogoCallback, p_sys );
530 var_AddCallback( p_input->p_libvlc, "logo-transparency", LogoCallback, p_sys );
531 vlc_object_release( p_input );
533 p_sys->p_pic = LoadImage( p_this, p_sys->psz_filename );
537 msg_Err( p_this, "couldn't load logo file" );
542 p_filter->pf_sub_filter = Filter;
543 p_sys->i_width = p_sys->p_pic->p[Y_PLANE].i_visible_pitch;
544 p_sys->i_height = p_sys->p_pic->p[Y_PLANE].i_visible_lines;
545 p_sys->b_need_update = VLC_TRUE;
546 p_sys->b_new_image = VLC_FALSE;
547 p_sys->i_last_date = 0;
552 /*****************************************************************************
553 * DestroyFilter: destroy logo video filter
554 *****************************************************************************/
555 static void DestroyFilter( vlc_object_t *p_this )
557 filter_t *p_filter = (filter_t *)p_this;
558 filter_sys_t *p_sys = p_filter->p_sys;
559 vlc_object_t *p_input;
561 if( p_sys->p_pic ) p_sys->p_pic->pf_release( p_sys->p_pic );
562 if( p_sys->psz_filename ) free( p_sys->psz_filename );
565 /* Delete the logo variables from INPUT */
566 p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
567 if( !p_input ) return;
569 var_Destroy( p_input->p_libvlc , "logo-file" );
570 var_Destroy( p_input->p_libvlc , "logo-x" );
571 var_Destroy( p_input->p_libvlc , "logo-y" );
572 var_Destroy( p_input->p_libvlc , "logo-position" );
573 var_Destroy( p_input->p_libvlc , "logo-transparency" );
574 vlc_object_release( p_input );
577 /*****************************************************************************
578 * Filter: the whole thing
579 *****************************************************************************
580 * This function outputs subpictures at regular time intervals.
581 *****************************************************************************/
582 static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
584 filter_sys_t *p_sys = p_filter->p_sys;
586 subpicture_region_t *p_region;
589 if( !p_sys->b_need_update && p_sys->i_last_date +5000000 > date ) return 0;
591 if( p_sys->b_new_image )
593 if( p_sys->p_pic ) p_sys->p_pic->pf_release( p_sys->p_pic );
595 p_sys->p_pic = LoadImage( VLC_OBJECT(p_filter), p_sys->psz_filename );
598 p_sys->i_width = p_sys->p_pic->p[Y_PLANE].i_visible_pitch;
599 p_sys->i_height = p_sys->p_pic->p[Y_PLANE].i_visible_lines;
602 p_sys->b_new_image = VLC_FALSE;
605 p_sys->b_need_update = VLC_FALSE;
607 /* Allocate the subpicture internal data. */
608 p_spu = p_filter->pf_sub_buffer_new( p_filter );
609 if( !p_spu ) return NULL;
611 p_spu->b_absolute = p_sys->b_absolute;
612 p_spu->i_start = p_sys->i_last_date = date;
614 p_spu->b_ephemer = VLC_TRUE;
616 p_sys->b_need_update = VLC_FALSE;
618 if( !p_sys->p_pic || !p_sys->i_trans )
620 /* Send an empty subpicture to clear the display */
624 /* Create new SPU region */
625 memset( &fmt, 0, sizeof(video_format_t) );
626 fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
627 fmt.i_aspect = VOUT_ASPECT_FACTOR;
628 fmt.i_sar_num = fmt.i_sar_den = 1;
629 fmt.i_width = fmt.i_visible_width = p_sys->i_width;
630 fmt.i_height = fmt.i_visible_height = p_sys->i_height;
631 fmt.i_x_offset = fmt.i_y_offset = 0;
632 p_region = p_spu->pf_create_region( VLC_OBJECT(p_filter), &fmt );
635 msg_Err( p_filter, "cannot allocate SPU region" );
636 p_filter->pf_sub_buffer_del( p_filter, p_spu );
640 vout_CopyPicture( p_filter, &p_region->picture, p_sys->p_pic );
642 /* where to locate the logo: */
643 if( p_sys->posx < 0 || p_sys->posy < 0 )
644 { /* set to one of the 9 relative locations */
645 p_spu->i_flags = p_sys->pos;
648 p_spu->b_absolute = VLC_FALSE;
651 { /* set to an absolute xy, referenced to upper left corner */
652 p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
653 p_spu->i_x = p_sys->posx;
654 p_spu->i_y = p_sys->posy;
655 p_spu->b_absolute = VLC_TRUE;
658 p_spu->p_region = p_region;
659 p_spu->i_alpha = p_sys->i_trans;
664 /*****************************************************************************
665 * Callback to update params on the fly
666 *****************************************************************************/
667 static int LogoCallback( vlc_object_t *p_this, char const *psz_var,
668 vlc_value_t oldval, vlc_value_t newval, void *p_data )
670 filter_sys_t *p_sys = (filter_sys_t *)p_data;
672 if( !strncmp( psz_var, "logo-file", 6 ) )
674 if( p_sys->psz_filename ) free( p_sys->psz_filename );
675 p_sys->psz_filename = strdup( newval.psz_string );
676 p_sys->b_new_image = VLC_TRUE;
678 else if ( !strncmp( psz_var, "logo-x", 6 ) )
680 p_sys->posx = newval.i_int;
682 else if ( !strncmp( psz_var, "logo-y", 6 ) )
684 p_sys->posy = newval.i_int;
686 else if ( !strncmp( psz_var, "logo-position", 12 ) )
688 p_sys->pos = newval.i_int;
690 else if ( !strncmp( psz_var, "logo-transparency", 9 ) )
692 p_sys->i_trans = __MAX( __MIN( newval.i_int, 255 ), 0 );
694 p_sys->b_need_update = VLC_TRUE;