]> git.sesse.net Git - vlc/blob - modules/video_filter/wall.c
For consistency, remove references to vlc from libvlc
[vlc] / modules / video_filter / wall.c
1 /*****************************************************************************
2  * wall.c : Wall video plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000, 2001, 2002, 2003 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <stdlib.h>                                      /* malloc(), free() */
28 #include <string.h>
29
30 #include <vlc/vlc.h>
31 #include <vlc/vout.h>
32
33 #include "filter_common.h"
34
35 /*****************************************************************************
36  * Local prototypes
37  *****************************************************************************/
38 static int  Create    ( vlc_object_t * );
39 static void Destroy   ( vlc_object_t * );
40
41 static int  Init      ( vout_thread_t * );
42 static void End       ( vout_thread_t * );
43 static void Render    ( vout_thread_t *, picture_t * );
44
45 static void RemoveAllVout  ( vout_thread_t *p_vout );
46
47 static int  SendEvents( vlc_object_t *, char const *,
48                         vlc_value_t, vlc_value_t, void * );
49
50 /*****************************************************************************
51  * Module descriptor
52  *****************************************************************************/
53 #define COLS_TEXT N_("Number of columns")
54 #define COLS_LONGTEXT N_("Number of horizontal windows in " \
55     "which to split the video.")
56
57 #define ROWS_TEXT N_("Number of rows")
58 #define ROWS_LONGTEXT N_("Number of vertical windows in " \
59     "which to split the video.")
60
61 #define ACTIVE_TEXT N_("Active windows")
62 #define ACTIVE_LONGTEXT N_("Comma-separated list of active windows, " \
63     "defaults to all")
64
65 #define ASPECT_TEXT N_("Element aspect ratio")
66 #define ASPECT_LONGTEXT N_("Aspect ratio of the individual displays " \
67    "building the wall.")
68
69 vlc_module_begin();
70     set_description( _("Wall video filter") );
71     set_shortname( N_("Image wall" ));
72     set_capability( "video filter", 0 );
73     set_category( CAT_VIDEO );
74     set_subcategory( SUBCAT_VIDEO_VFILTER );
75
76     add_integer( "wall-cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT, VLC_FALSE );
77     add_integer( "wall-rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT, VLC_FALSE );
78     add_string( "wall-active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT,
79                  VLC_TRUE );
80     add_string( "wall-element-aspect", "4:3", NULL, ASPECT_TEXT, ASPECT_LONGTEXT, VLC_FALSE );
81
82     add_shortcut( "wall" );
83     set_callbacks( Create, Destroy );
84 vlc_module_end();
85
86 /*****************************************************************************
87  * vout_sys_t: Wall video output method descriptor
88  *****************************************************************************
89  * This structure is part of the video output thread descriptor.
90  * It describes the Wall specific properties of an output thread.
91  *****************************************************************************/
92 struct vout_sys_t
93 {
94     int    i_col;
95     int    i_row;
96     int    i_vout;
97     struct vout_list_t
98     {
99         vlc_bool_t b_active;
100         int i_width;
101         int i_height;
102         int i_left;
103         int i_top;
104         vout_thread_t *p_vout;
105     } *pp_vout;
106 };
107
108 /*****************************************************************************
109  * Control: control facility for the vout (forwards to child vout)
110  *****************************************************************************/
111 static int Control( vout_thread_t *p_vout, int i_query, va_list args )
112 {
113     int i_row, i_col, i_vout = 0;
114
115     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
116     {
117         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
118         {
119             vout_vaControl( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
120                             i_query, args );
121             i_vout++;
122         }
123     }
124     return VLC_SUCCESS;
125 }
126
127 /*****************************************************************************
128  * Create: allocates Wall video thread output method
129  *****************************************************************************
130  * This function allocates and initializes a Wall vout method.
131  *****************************************************************************/
132 static int Create( vlc_object_t *p_this )
133 {
134     vout_thread_t *p_vout = (vout_thread_t *)p_this;
135     char *psz_method, *psz_tmp, *psz_method_tmp;
136     int i_vout;
137
138     /* Allocate structure */
139     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
140     if( p_vout->p_sys == NULL )
141     {
142         msg_Err( p_vout, "out of memory" );
143         return VLC_ENOMEM;
144     }
145
146     p_vout->pf_init = Init;
147     p_vout->pf_end = End;
148     p_vout->pf_manage = NULL;
149     p_vout->pf_render = Render;
150     p_vout->pf_display = NULL;
151     p_vout->pf_control = Control;
152
153     /* Look what method was requested */
154     p_vout->p_sys->i_col = config_GetInt( p_vout, "wall-cols" );
155     p_vout->p_sys->i_row = config_GetInt( p_vout, "wall-rows" );
156
157     p_vout->p_sys->i_col = __MAX( 1, __MIN( 15, p_vout->p_sys->i_col ) );
158     p_vout->p_sys->i_row = __MAX( 1, __MIN( 15, p_vout->p_sys->i_row ) );
159
160     msg_Dbg( p_vout, "opening a %i x %i wall",
161              p_vout->p_sys->i_col, p_vout->p_sys->i_row );
162
163     p_vout->p_sys->pp_vout = malloc( p_vout->p_sys->i_row *
164                                      p_vout->p_sys->i_col *
165                                      sizeof(struct vout_list_t) );
166     if( p_vout->p_sys->pp_vout == NULL )
167     {
168         msg_Err( p_vout, "out of memory" );
169         free( p_vout->p_sys );
170         return VLC_ENOMEM;
171     }
172
173     psz_method_tmp = psz_method = config_GetPsz( p_vout, "wall-active" );
174
175     /* If no trailing vout are specified, take them all */
176     if( psz_method == NULL )
177     {
178         for( i_vout = p_vout->p_sys->i_row * p_vout->p_sys->i_col;
179              i_vout--; )
180         {
181             p_vout->p_sys->pp_vout[i_vout].b_active = 1;
182         }
183     }
184     /* If trailing vout are specified, activate only the requested ones */
185     else
186     {
187         for( i_vout = p_vout->p_sys->i_row * p_vout->p_sys->i_col;
188              i_vout--; )
189         {
190             p_vout->p_sys->pp_vout[i_vout].b_active = 0;
191         }
192
193         while( *psz_method )
194         {
195             psz_tmp = psz_method;
196             while( *psz_tmp && *psz_tmp != ',' )
197             {
198                 psz_tmp++;
199             }
200
201             if( *psz_tmp )
202             {
203                 *psz_tmp = '\0';
204                 i_vout = atoi( psz_method );
205                 psz_method = psz_tmp + 1;
206             }
207             else
208             {
209                 i_vout = atoi( psz_method );
210                 psz_method = psz_tmp;
211             }
212
213             if( i_vout >= 0 &&
214                 i_vout < p_vout->p_sys->i_row * p_vout->p_sys->i_col )
215             {
216                 p_vout->p_sys->pp_vout[i_vout].b_active = 1;
217             }
218         }
219     }
220
221     free( psz_method_tmp );
222
223     return VLC_SUCCESS;
224 }
225
226 /*****************************************************************************
227  * Init: initialize Wall video thread output method
228  *****************************************************************************/
229 static int Init( vout_thread_t *p_vout )
230 {
231     int i_index, i_row, i_col, i_width, i_height, i_left, i_top;
232     unsigned int i_target_width,i_target_height;
233     picture_t *p_pic;
234     video_format_t fmt = {0};
235     int i_aspect = 4*VOUT_ASPECT_FACTOR/3;
236     int i_align = 0;
237     unsigned int i_hstart, i_hend, i_vstart, i_vend;
238     unsigned int w1,h1,w2,h2;
239     int i_xpos, i_ypos;
240     int i_vstart_rounded = 0, i_hstart_rounded = 0;
241     char *psz_aspect;
242
243     psz_aspect = config_GetPsz( p_vout, "wall-element-aspect" );
244     if( psz_aspect && *psz_aspect )
245     {
246         char *psz_parser = strchr( psz_aspect, ':' );
247         if( psz_parser )
248         {
249             *psz_parser++ = '\0';
250             i_aspect = atoi( psz_aspect ) * VOUT_ASPECT_FACTOR
251                 / atoi( psz_parser );
252         }
253         else
254         {
255             msg_Warn( p_vout, "invalid aspect ratio specification" );
256         }
257         free( psz_aspect );
258     }
259     
260
261     i_xpos = var_CreateGetInteger( p_vout, "video-x" );
262     i_ypos = var_CreateGetInteger( p_vout, "video-y" );
263     if( i_xpos < 0 ) i_xpos = 0;
264     if( i_ypos < 0 ) i_ypos = 0;
265
266     I_OUTPUTPICTURES = 0;
267
268     /* Initialize the output structure */
269     p_vout->output.i_chroma = p_vout->render.i_chroma;
270     p_vout->output.i_width  = p_vout->render.i_width;
271     p_vout->output.i_height = p_vout->render.i_height;
272     p_vout->output.i_aspect = p_vout->render.i_aspect;
273     var_Create( p_vout, "align", VLC_VAR_INTEGER );
274
275     fmt.i_width = fmt.i_visible_width = p_vout->render.i_width;
276     fmt.i_height = fmt.i_visible_height = p_vout->render.i_height;
277     fmt.i_x_offset = fmt.i_y_offset = 0;
278     fmt.i_chroma = p_vout->render.i_chroma;
279     fmt.i_aspect = p_vout->render.i_aspect;
280     fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
281     fmt.i_sar_den = VOUT_ASPECT_FACTOR;
282
283     w1 = p_vout->output.i_width / p_vout->p_sys->i_col;
284     w1 &= ~1;
285     h1 = w1 * VOUT_ASPECT_FACTOR / i_aspect&~1;
286     h1 &= ~1;
287     
288     h2 = p_vout->output.i_height / p_vout->p_sys->i_row&~1;
289     h2 &= ~1;
290     w2 = h2 * i_aspect / VOUT_ASPECT_FACTOR&~1;
291     w2 &= ~1;
292     
293     if ( h1 * p_vout->p_sys->i_row < p_vout->output.i_height )
294     {
295         unsigned int i_tmp;
296         i_target_width = w2;        
297         i_target_height = h2;
298         i_vstart = 0;
299         i_vend = p_vout->output.i_height;
300         i_tmp = i_target_width * p_vout->p_sys->i_col;
301         while( i_tmp < p_vout->output.i_width ) i_tmp += p_vout->p_sys->i_col;
302         i_hstart = (( i_tmp - p_vout->output.i_width ) / 2)&~1;
303         i_hstart_rounded  = ( ( i_tmp - p_vout->output.i_width ) % 2 ) ||
304             ( ( ( i_tmp - p_vout->output.i_width ) / 2 ) & 1 );
305         i_hend = i_hstart + p_vout->output.i_width;
306     }
307     else
308     {
309         unsigned int i_tmp;
310         i_target_height = h1;
311         i_target_width = w1;
312         i_hstart = 0;
313         i_hend = p_vout->output.i_width;
314         i_tmp = i_target_height * p_vout->p_sys->i_row;
315         while( i_tmp < p_vout->output.i_height ) i_tmp += p_vout->p_sys->i_row;
316         i_vstart = ( ( i_tmp - p_vout->output.i_height ) / 2 ) & ~1;
317         i_vstart_rounded  = ( ( i_tmp - p_vout->output.i_height ) % 2 ) ||
318             ( ( ( i_tmp - p_vout->output.i_height ) / 2 ) & 1 );
319         i_vend = i_vstart + p_vout->output.i_height;
320     }
321     msg_Dbg( p_vout, "target resolution %dx%d", i_target_width, i_target_height );
322
323     /* Try to open the real video output */
324     msg_Dbg( p_vout, "spawning the real video outputs" );
325
326     p_vout->p_sys->i_vout = 0;
327     msg_Dbg( p_vout, "target window (%d,%d)-(%d,%d)", i_hstart,i_vstart,i_hend,i_vend );
328     
329
330     i_top = 0;
331     i_height = 0;
332     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
333     {
334         i_left = 0;
335         i_top += i_height;
336         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
337         {
338             i_align = 0;
339
340             if( i_col*i_target_width >= i_hstart &&
341                 (i_col+1)*i_target_width <= i_hend )
342             {
343                 i_width = i_target_width;
344             }
345             else if( ( i_col + 1 ) * i_target_width < i_hstart ||
346                      ( i_col * i_target_width ) > i_hend )
347             {
348                 i_width = 0;                
349             }
350             else
351             {
352                 i_width = ( i_target_width - i_hstart % i_target_width );
353                 if( i_col >= ( p_vout->p_sys->i_col / 2 ) )
354                 {
355                     i_align |= VOUT_ALIGN_LEFT;
356                     i_width -= i_hstart_rounded ? 2: 0;
357                 }
358                 else
359                 {
360                     i_align |= VOUT_ALIGN_RIGHT;
361                 }
362             }
363             
364             if( i_row * i_target_height >= i_vstart &&
365                 ( i_row + 1 ) * i_target_height <= i_vend )
366             {
367                 i_height = i_target_height;
368             }
369             else if( ( i_row + 1 ) * i_target_height < i_vstart ||
370                      ( i_row * i_target_height ) > i_vend )
371             {
372                 i_height = 0;
373             }
374             else
375             {
376                 i_height = ( i_target_height -
377                              i_vstart%i_target_height );
378                 if(  i_row >= ( p_vout->p_sys->i_row / 2 ) )
379                 {
380                     i_align |= VOUT_ALIGN_TOP;
381                     i_height -= i_vstart_rounded ? 2: 0;
382                 }
383                 else
384                 {
385                     i_align |= VOUT_ALIGN_BOTTOM;
386                 }
387             }
388             if( i_height == 0 || i_width == 0 )
389             {
390                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].b_active = VLC_FALSE;
391             }
392
393             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_width = i_width;
394             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_height = i_height;
395             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_left = i_left;
396             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_top = i_top;
397             i_left += i_width;
398
399             if( !p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].b_active )
400             {
401                 p_vout->p_sys->i_vout++;
402                 continue;
403             }
404             var_SetInteger( p_vout, "align", i_align );
405             var_SetInteger( p_vout, "video-x", i_left + i_xpos - i_width);
406             var_SetInteger( p_vout, "video-y", i_top + i_ypos );
407
408             fmt.i_width = fmt.i_visible_width = i_width;
409             fmt.i_height = fmt.i_visible_height = i_height;
410             fmt.i_aspect = i_aspect * i_target_height / i_height *
411                 i_width / i_target_width;
412
413             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout =
414                 vout_Create( p_vout, &fmt );
415             if( !p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout )
416             {
417                 msg_Err( p_vout, "failed to get %ix%i vout threads",
418                                  p_vout->p_sys->i_col, p_vout->p_sys->i_row );
419                 RemoveAllVout( p_vout );
420                 return VLC_EGENERIC;
421             }
422             ADD_CALLBACKS(
423                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
424                 SendEvents );
425             p_vout->p_sys->i_vout++;
426         }
427     }
428
429     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
430
431     ADD_PARENT_CALLBACKS( SendEventsToChild );
432
433     return VLC_SUCCESS;
434 }
435
436 /*****************************************************************************
437  * End: terminate Wall video thread output method
438  *****************************************************************************/
439 static void End( vout_thread_t *p_vout )
440 {
441     int i_index;
442
443     /* Free the fake output buffers we allocated */
444     for( i_index = I_OUTPUTPICTURES ; i_index ; )
445     {
446         i_index--;
447         free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
448     }
449 }
450
451 /*****************************************************************************
452  * Destroy: destroy Wall video thread output method
453  *****************************************************************************
454  * Terminate an output method created by WallCreateOutputMethod
455  *****************************************************************************/
456 static void Destroy( vlc_object_t *p_this )
457 {
458     vout_thread_t *p_vout = (vout_thread_t *)p_this;
459
460     RemoveAllVout( p_vout );
461
462     DEL_PARENT_CALLBACKS( SendEventsToChild );
463
464     free( p_vout->p_sys->pp_vout );
465     free( p_vout->p_sys );
466 }
467
468 /*****************************************************************************
469  * Render: displays previously rendered output
470  *****************************************************************************
471  * This function send the currently rendered image to Wall image, waits
472  * until it is displayed and switch the two rendering buffers, preparing next
473  * frame.
474  *****************************************************************************/
475 static void Render( vout_thread_t *p_vout, picture_t *p_pic )
476 {
477     picture_t *p_outpic = NULL;
478     int i_col, i_row, i_vout, i_plane;
479     int pi_left_skip[VOUT_MAX_PLANES], pi_top_skip[VOUT_MAX_PLANES];
480
481     i_vout = 0;
482
483     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
484     {
485         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
486         {
487             for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
488             {
489                 pi_left_skip[i_plane] = p_vout->p_sys->pp_vout[ i_vout ].i_left * p_pic->p[ i_plane ].i_pitch / p_vout->output.i_width;
490                 pi_top_skip[i_plane] = (p_vout->p_sys->pp_vout[ i_vout ].i_top * p_pic->p[ i_plane ].i_lines / p_vout->output.i_height)*p_pic->p[i_plane].i_pitch;
491             }
492
493             if( !p_vout->p_sys->pp_vout[ i_vout ].b_active )
494             {
495                 i_vout++;
496                 continue;
497             }
498
499             while( ( p_outpic =
500                 vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
501                                     0, 0, 0 )
502                    ) == NULL )
503             {
504                 if( p_vout->b_die || p_vout->b_error )
505                 {
506                     vout_DestroyPicture(
507                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
508                     return;
509                 }
510
511                 msleep( VOUT_OUTMEM_SLEEP );
512             }
513
514             vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
515                               p_outpic, p_pic->date );
516             vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
517                               p_outpic );
518
519             for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
520             {
521                 uint8_t *p_in, *p_in_end, *p_out;
522                 int i_in_pitch = p_pic->p[i_plane].i_pitch;
523                 int i_out_pitch = p_outpic->p[i_plane].i_pitch;
524                 int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch;
525
526                 p_in = p_pic->p[i_plane].p_pixels
527                         + pi_top_skip[i_plane] + pi_left_skip[i_plane];
528
529                 p_in_end = p_in + p_outpic->p[i_plane].i_visible_lines
530                                    * p_pic->p[i_plane].i_pitch;
531
532                 p_out = p_outpic->p[i_plane].p_pixels;
533
534                 while( p_in < p_in_end )
535                 {
536                     p_vout->p_libvlc->pf_memcpy( p_out, p_in, i_copy_pitch );
537                     p_in += i_in_pitch;
538                     p_out += i_out_pitch;
539                 }
540
541 //                pi_left_skip[i_plane] += i_copy_pitch;
542             }
543
544             vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
545                                 p_outpic );
546             vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
547                                  p_outpic );
548
549             i_vout++;
550         }
551
552 /*         for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) */
553 /*         { */
554 /*             pi_top_skip[i_plane] += p_vout->p_sys->pp_vout[ i_vout ].i_height */
555 /*                                      * p_pic->p[i_plane].i_visible_lines */
556 /*                                      / p_vout->output.i_height */
557 /*                                      * p_pic->p[i_plane].i_pitch; */
558 /*         } */
559     }
560 }
561
562 /*****************************************************************************
563  * RemoveAllVout: destroy all the child video output threads
564  *****************************************************************************/
565 static void RemoveAllVout( vout_thread_t *p_vout )
566 {
567     while( p_vout->p_sys->i_vout )
568     {
569          --p_vout->p_sys->i_vout;
570          if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].b_active )
571          {
572              DEL_CALLBACKS(
573                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
574                  SendEvents );
575              vlc_object_detach(
576                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
577              vout_Destroy(
578                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
579          }
580     }
581 }
582
583 /*****************************************************************************
584  * SendEvents: forward mouse and keyboard events to the parent p_vout
585  *****************************************************************************/
586 static int SendEvents( vlc_object_t *p_this, char const *psz_var,
587                        vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
588 {
589     vout_thread_t *p_vout = (vout_thread_t *)_p_vout;
590     int i_vout;
591     vlc_value_t sentval = newval;
592
593     /* Find the video output index */
594     for( i_vout = 0; i_vout < p_vout->p_sys->i_vout; i_vout++ )
595     {
596         if( p_this == (vlc_object_t *)p_vout->p_sys->pp_vout[ i_vout ].p_vout )
597         {
598             break;
599         }
600     }
601
602     if( i_vout == p_vout->p_sys->i_vout )
603     {
604         return VLC_EGENERIC;
605     }
606
607     /* Translate the mouse coordinates */
608     if( !strcmp( psz_var, "mouse-x" ) )
609     {
610         sentval.i_int += p_vout->output.i_width
611                           * (i_vout % p_vout->p_sys->i_col)
612                           / p_vout->p_sys->i_col;
613     }
614     else if( !strcmp( psz_var, "mouse-y" ) )
615     {
616         sentval.i_int += p_vout->output.i_height
617                           * (i_vout / p_vout->p_sys->i_row)
618                           / p_vout->p_sys->i_row;
619     }
620
621     var_Set( p_vout, psz_var, sentval );
622
623     return VLC_SUCCESS;
624 }
625
626 /*****************************************************************************
627  * SendEventsToChild: forward events to the child/children vout
628  *****************************************************************************/
629 static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
630                        vlc_value_t oldval, vlc_value_t newval, void *p_data )
631 {
632     vout_thread_t *p_vout = (vout_thread_t *)p_this;
633     int i_row, i_col, i_vout = 0;
634
635     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
636     {
637         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
638         {
639             var_Set( p_vout->p_sys->pp_vout[ i_vout ].p_vout, psz_var, newval);
640             if( !strcmp( psz_var, "fullscreen" ) ) break;
641             i_vout++;
642         }
643     }
644
645     return VLC_SUCCESS;
646 }