1 /*****************************************************************************
2 * opengl.c: OpenGL video output
3 *****************************************************************************
4 * Copyright (C) 2004 VideoLAN
7 * Authors: Cyril Deguet <asmax@videolan.org>
8 * Gildas Bazin <gbazin@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 <errno.h> /* ENOMEM */
29 #include <stdlib.h> /* malloc(), free() */
36 #include <OpenGL/gl.h>
37 #include <OpenGL/glext.h>
39 /* On OS X, use GL_TEXTURE_RECTANGLE_EXT instead of GL_TEXTURE_2D.
40 This allows sizes which are not powers of 2 */
41 #define VLCGL_TARGET GL_TEXTURE_RECTANGLE_EXT
43 /* OS X OpenGL supports YUV. Hehe. */
44 #define VLCGL_FORMAT GL_YCBCR_422_APPLE
45 #define VLCGL_TYPE GL_UNSIGNED_SHORT_8_8_APPLE
49 #define VLCGL_TARGET GL_TEXTURE_2D
52 #ifndef GL_UNSIGNED_SHORT_5_6_5
53 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
55 //#define VLCGL_RGB_FORMAT GL_RGB
56 //#define VLCGL_RGB_TYPE GL_UNSIGNED_SHORT_5_6_5
59 //#define VLCGL_RGB_FORMAT GL_RGB
60 //#define VLCGL_RGB_TYPE GL_UNSIGNED_BYTE
63 #define VLCGL_RGB_FORMAT GL_RGBA
64 #define VLCGL_RGB_TYPE GL_UNSIGNED_BYTE
66 /* Use RGB on Win32/GLX */
67 #define VLCGL_FORMAT VLCGL_RGB_FORMAT
68 #define VLCGL_TYPE VLCGL_RGB_TYPE
72 #define OPENGL_EFFECT_NONE 1
73 #define OPENGL_EFFECT_CUBE 2
74 #define OPENGL_EFFECT_TRANSPARENT_CUBE 4
76 /*****************************************************************************
78 *****************************************************************************/
79 static int CreateVout ( vlc_object_t * );
80 static void DestroyVout ( vlc_object_t * );
81 static int Init ( vout_thread_t * );
82 static void End ( vout_thread_t * );
83 static int Manage ( vout_thread_t * );
84 static void Render ( vout_thread_t *, picture_t * );
85 static void DisplayVideo ( vout_thread_t *, picture_t * );
86 static int Control ( vout_thread_t *, int, va_list );
88 static inline int GetAlignedSize( int );
90 static int InitTextures( vout_thread_t * );
91 static int SendEvents( vlc_object_t *, char const *,
92 vlc_value_t, vlc_value_t, void * );
94 /*****************************************************************************
96 *****************************************************************************/
97 #define SPEED_TEXT N_( "OpenGL cube rotation speed" )
98 #define SPEED_LONGTEXT N_( "If the OpenGL cube effect is enabled, this " \
99 "controls its rotation speed." )
101 #define EFFECT_TEXT N_("Select effect")
102 #define EFFECT_LONGTEXT N_( \
103 "Allows you to select different visual effects.")
105 static char *ppsz_effects[] = {
106 "none", "cube", "transparent-cube" };
107 static char *ppsz_effects_text[] = {
108 N_("None"), N_("Cube"), N_("Transparent Cube") };
111 set_description( _("OpenGL video output") );
113 set_capability( "video output", 200 );
115 set_capability( "video output", 20 );
117 add_shortcut( "opengl" );
118 add_float( "opengl-cube-speed", 2.0, NULL, SPEED_TEXT,
119 SPEED_LONGTEXT, VLC_FALSE );
120 set_callbacks( CreateVout, DestroyVout );
121 add_string( "opengl-effect", "none", NULL, EFFECT_TEXT,
122 EFFECT_LONGTEXT, VLC_TRUE );
123 change_string_list( ppsz_effects, ppsz_effects_text, 0 );
126 /*****************************************************************************
127 * vout_sys_t: video output method descriptor
128 *****************************************************************************
129 * This structure is part of the video output thread descriptor.
130 * It describes the OpenGL specific properties of the output thread.
131 *****************************************************************************/
134 vout_thread_t *p_vout;
136 uint8_t *pp_buffer[2];
140 GLuint p_textures[2];
147 /*****************************************************************************
148 * CreateVout: This function allocates and initializes the OpenGL vout method.
149 *****************************************************************************/
150 static int CreateVout( vlc_object_t *p_this )
152 vout_thread_t *p_vout = (vout_thread_t *)p_this;
155 /* Allocate structure */
156 p_vout->p_sys = p_sys = malloc( sizeof( vout_sys_t ) );
159 msg_Err( p_vout, "out of memory" );
163 var_Create( p_vout, "opengl-effect", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
167 p_sys->i_tex_width = p_vout->render.i_width;
168 p_sys->i_tex_height = p_vout->render.i_height;
170 /* A texture must have a size aligned on a power of 2 */
171 p_sys->i_tex_width = GetAlignedSize( p_vout->render.i_width );
172 p_sys->i_tex_height = GetAlignedSize( p_vout->render.i_height );
175 msg_Dbg( p_vout, "Texture size: %dx%d", p_sys->i_tex_width,
176 p_sys->i_tex_height );
180 (vout_thread_t *)vlc_object_create( p_this, VLC_OBJECT_OPENGL );
181 if( p_sys->p_vout == NULL )
183 msg_Err( p_vout, "out of memory" );
186 vlc_object_attach( p_sys->p_vout, p_this );
188 p_sys->p_vout->i_window_width = p_vout->i_window_width;
189 p_sys->p_vout->i_window_height = p_vout->i_window_height;
190 p_sys->p_vout->b_fullscreen = p_vout->b_fullscreen;
191 p_sys->p_vout->render.i_width = p_vout->render.i_width;
192 p_sys->p_vout->render.i_height = p_vout->render.i_height;
193 p_sys->p_vout->render.i_aspect = p_vout->render.i_aspect;
194 p_sys->p_vout->b_scale = p_vout->b_scale;
195 p_sys->p_vout->i_alignment = p_vout->i_alignment;
197 p_sys->p_vout->p_module =
198 module_Need( p_sys->p_vout, "opengl provider", NULL, 0 );
199 if( p_sys->p_vout->p_module == NULL )
201 msg_Warn( p_vout, "No OpenGL provider found" );
202 vlc_object_detach( p_sys->p_vout );
203 vlc_object_destroy( p_sys->p_vout );
207 p_sys->f_speed = var_CreateGetFloat( p_vout, "opengl-cube-speed" );
209 p_vout->pf_init = Init;
210 p_vout->pf_end = End;
211 p_vout->pf_manage = Manage;
212 p_vout->pf_render = Render;
213 p_vout->pf_display = DisplayVideo;
214 p_vout->pf_control = Control;
216 /* Forward events from the opengl provider */
217 var_Create( p_sys->p_vout, "mouse-x", VLC_VAR_INTEGER );
218 var_Create( p_sys->p_vout, "mouse-y", VLC_VAR_INTEGER );
219 var_Create( p_sys->p_vout, "mouse-moved", VLC_VAR_BOOL );
220 var_Create( p_sys->p_vout, "mouse-clicked", VLC_VAR_INTEGER );
221 var_Create( p_sys->p_vout, "video-on-top",
222 VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
224 var_AddCallback( p_sys->p_vout, "mouse-x", SendEvents, p_vout );
225 var_AddCallback( p_sys->p_vout, "mouse-y", SendEvents, p_vout );
226 var_AddCallback( p_sys->p_vout, "mouse-moved", SendEvents, p_vout );
227 var_AddCallback( p_sys->p_vout, "mouse-clicked", SendEvents, p_vout );
232 /*****************************************************************************
233 * Init: initialize the OpenGL video thread output method
234 *****************************************************************************/
235 static int Init( vout_thread_t *p_vout )
237 vout_sys_t *p_sys = p_vout->p_sys;
241 p_sys->p_vout->pf_init( p_sys->p_vout );
244 p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
245 p_vout->output.i_rmask = 0x00ff0000;
246 p_vout->output.i_gmask = 0x0000ff00;
247 p_vout->output.i_bmask = 0x000000ff;
250 #if VLCGL_RGB_FORMAT == GL_RGB
251 # if VLCGL_RGB_TYPE == GL_UNSIGNED_BYTE
252 p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
253 p_vout->output.i_rmask = 0x000000ff;
254 p_vout->output.i_gmask = 0x0000ff00;
255 p_vout->output.i_bmask = 0x00ff0000;
258 p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
259 p_vout->output.i_rmask = 0xf800;
260 p_vout->output.i_gmask = 0x07e0;
261 p_vout->output.i_bmask = 0x001f;
265 p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
266 p_vout->output.i_rmask = 0x000000ff;
267 p_vout->output.i_gmask = 0x0000ff00;
268 p_vout->output.i_bmask = 0x00ff0000;
273 /* Since OpenGL can do rescaling for us, stick to the default
274 * coordinates and aspect. */
275 p_vout->output.i_width = p_vout->render.i_width;
276 p_vout->output.i_height = p_vout->render.i_height;
277 p_vout->output.i_aspect = p_vout->render.i_aspect;
279 /* We know the chroma, allocate one buffer which will be used
280 * directly by the decoder */
281 p_sys->pp_buffer[0] =
282 malloc( p_sys->i_tex_width * p_sys->i_tex_height * i_pixel_pitch );
283 if( !p_sys->pp_buffer[0] )
285 msg_Err( p_vout, "Out of memory" );
288 p_sys->pp_buffer[1] =
289 malloc( p_sys->i_tex_width * p_sys->i_tex_height * i_pixel_pitch );
290 if( !p_sys->pp_buffer[1] )
292 msg_Err( p_vout, "Out of memory" );
296 p_vout->p_picture[0].i_planes = 1;
297 p_vout->p_picture[0].p->p_pixels = p_sys->pp_buffer[0];
298 p_vout->p_picture[0].p->i_lines = p_vout->output.i_height;
299 p_vout->p_picture[0].p->i_visible_lines = p_vout->output.i_height;
300 p_vout->p_picture[0].p->i_pixel_pitch = i_pixel_pitch;
301 p_vout->p_picture[0].p->i_pitch = p_vout->output.i_width *
302 p_vout->p_picture[0].p->i_pixel_pitch;
303 p_vout->p_picture[0].p->i_visible_pitch = p_vout->output.i_width *
304 p_vout->p_picture[0].p->i_pixel_pitch;
306 p_vout->p_picture[0].i_status = DESTROYED_PICTURE;
307 p_vout->p_picture[0].i_type = DIRECT_PICTURE;
309 PP_OUTPUTPICTURE[ 0 ] = &p_vout->p_picture[0];
311 I_OUTPUTPICTURES = 1;
313 InitTextures( p_vout );
316 glDisable(GL_DEPTH_TEST);
317 glDepthMask(GL_FALSE);
318 glDisable(GL_CULL_FACE);
319 glClear( GL_COLOR_BUFFER_BIT );
321 /* Check if the user asked for useless visual effects */
322 var_Get( p_vout, "opengl-effect", &val );
323 if( !val.psz_string || !strcmp( val.psz_string, "none" ))
325 p_sys->i_effect = OPENGL_EFFECT_NONE;
327 else if( !strcmp( val.psz_string, "cube" ) )
329 p_sys->i_effect = OPENGL_EFFECT_CUBE;
331 glEnable( GL_CULL_FACE);
332 //glEnable( GL_DEPTH_TEST );
334 else if( !strcmp( val.psz_string, "transparent-cube" ) )
336 p_sys->i_effect = OPENGL_EFFECT_TRANSPARENT_CUBE;
338 glDisable( GL_DEPTH_TEST );
339 glEnable( GL_BLEND );
340 glBlendFunc( GL_SRC_ALPHA, GL_ONE );
344 msg_Warn( p_vout, "no valid opengl effect provided, using "
346 p_sys->i_effect = OPENGL_EFFECT_NONE;
348 if( val.psz_string ) free( val.psz_string );
350 if( p_sys->i_effect & ( OPENGL_EFFECT_CUBE |
351 OPENGL_EFFECT_TRANSPARENT_CUBE ) )
353 /* Set the perpective */
354 glMatrixMode( GL_PROJECTION );
356 glFrustum( -1.0, 1.0, -1.0, 1.0, 3.0, 20.0 );
357 glMatrixMode( GL_MODELVIEW );
359 glTranslatef( 0.0, 0.0, - 5.0 );
365 /*****************************************************************************
366 * End: terminate GLX video thread output method
367 *****************************************************************************/
368 static void End( vout_thread_t *p_vout )
374 /*****************************************************************************
375 * Destroy: destroy GLX video thread output method
376 *****************************************************************************
377 * Terminate an output method created by CreateVout
378 *****************************************************************************/
379 static void DestroyVout( vlc_object_t *p_this )
381 vout_thread_t *p_vout = (vout_thread_t *)p_this;
382 vout_sys_t *p_sys = p_vout->p_sys;
384 module_Unneed( p_sys->p_vout, p_sys->p_vout->p_module );
385 vlc_object_detach( p_sys->p_vout );
386 vlc_object_destroy( p_sys->p_vout );
388 /* Free the texture buffer*/
389 if( p_sys->pp_buffer[0] ) free( p_sys->pp_buffer[0] );
390 if( p_sys->pp_buffer[1] ) free( p_sys->pp_buffer[1] );
395 /*****************************************************************************
396 * Manage: handle Sys events
397 *****************************************************************************
398 * This function should be called regularly by video output thread. It returns
399 * a non null value if an error occurred.
400 *****************************************************************************/
401 static int Manage( vout_thread_t *p_vout )
403 vout_sys_t *p_sys = p_vout->p_sys;
404 int i_ret, i_fullscreen_change;
406 i_fullscreen_change = ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE );
408 p_sys->p_vout->i_changes = p_vout->i_changes;
409 i_ret = p_sys->p_vout->pf_manage( p_sys->p_vout );
410 p_vout->i_changes = p_sys->p_vout->i_changes;
413 /* On OS X, we create the window and the GL view when entering
414 fullscreen - the textures have to be inited again */
415 if( i_fullscreen_change )
417 InitTextures( p_vout );
419 switch( p_sys->i_effect )
421 case OPENGL_EFFECT_CUBE:
422 glEnable( GL_CULL_FACE );
425 case OPENGL_EFFECT_TRANSPARENT_CUBE:
426 glDisable( GL_DEPTH_TEST );
427 glEnable( GL_BLEND );
428 glBlendFunc( GL_SRC_ALPHA, GL_ONE );
432 if( p_sys->i_effect & ( OPENGL_EFFECT_CUBE |
433 OPENGL_EFFECT_TRANSPARENT_CUBE ) )
435 /* Set the perpective */
436 glMatrixMode( GL_PROJECTION );
438 glFrustum( -1.0, 1.0, -1.0, 1.0, 3.0, 20.0 );
439 glMatrixMode( GL_MODELVIEW );
441 glTranslatef( 0.0, 0.0, - 5.0 );
449 /*****************************************************************************
450 * Render: render previously calculated output
451 *****************************************************************************/
452 static void Render( vout_thread_t *p_vout, picture_t *p_pic )
454 vout_sys_t *p_sys = p_vout->p_sys;
456 /* On Win32/GLX, we do this the usual way:
457 + Fill the buffer with new content,
458 + Reload the texture,
461 On OS X with VRAM or AGP texturing, the order has to be:
462 + Reload the texture,
463 + Fill the buffer with new content,
466 (Thanks to gcc from the Arstechnica forums for the tip)
468 Therefore, we have to use two buffers and textures. On Win32/GLX,
469 we reload the texture to be displayed and use it right away. On
470 OS X, we first render, then reload the texture to be used next
475 i_new_index = ( p_sys->i_index + 1 ) & 1;
477 /* Update the texture */
478 glBindTexture( VLCGL_TARGET, p_sys->p_textures[i_new_index] );
479 glTexSubImage2D( VLCGL_TARGET, 0, 0, 0, p_sys->i_tex_width,
480 p_sys->i_tex_height, VLCGL_FORMAT, VLCGL_TYPE,
481 p_sys->pp_buffer[i_new_index] );
483 /* Bind to the previous texture for drawing */
484 glBindTexture( VLCGL_TARGET, p_sys->p_textures[p_sys->i_index] );
487 p_sys->i_index = i_new_index;
488 p_pic->p->p_pixels = p_sys->pp_buffer[p_sys->i_index];
491 /* Update the texture */
492 glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0,
493 p_vout->render.i_width, p_vout->render.i_height,
494 VLCGL_RGB_FORMAT, VLCGL_RGB_TYPE, p_sys->pp_buffer[0] );
498 /*****************************************************************************
499 * DisplayVideo: displays previously rendered output
500 *****************************************************************************/
501 static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
503 vout_sys_t *p_sys = p_vout->p_sys;
504 float f_width, f_height;
506 /* glTexCoord works differently with GL_TEXTURE_2D and
507 GL_TEXTURE_RECTANGLE_EXT */
509 f_width = (float)p_vout->output.i_width;
510 f_height = (float)p_vout->output.i_height;
512 f_width = (float)p_vout->output.i_width / p_sys->i_tex_width;
513 f_height = (float)p_vout->output.i_height / p_sys->i_tex_height;
516 /* Why drawing here and not in Render()? Because this way, the
517 OpenGL providers can call pf_display to force redraw. Currently,
518 the OS X provider uses it to get a smooth window resizing */
520 glClear( GL_COLOR_BUFFER_BIT );
522 if( p_sys->i_effect == OPENGL_EFFECT_NONE )
524 glEnable( VLCGL_TARGET );
525 glBegin( GL_POLYGON );
526 glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, 1.0 );
527 glTexCoord2f( f_width, 0.0 ); glVertex2f( 1.0, 1.0 );
528 glTexCoord2f( f_width, f_height ); glVertex2f( 1.0, -1.0 );
529 glTexCoord2f( 0.0, f_height ); glVertex2f( -1.0, -1.0 );
534 glRotatef( 0.5 * p_sys->f_speed , 0.3, 0.5, 0.7 );
536 glEnable( VLCGL_TARGET );
540 glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, 1.0 );
541 glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 );
542 glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, 1.0 );
543 glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, 1.0 );
546 glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 );
547 glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 );
548 glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 );
549 glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, 1.0 );
552 glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, - 1.0 );
553 glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 );
554 glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 );
555 glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 );
558 glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, 1.0 );
559 glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, 1.0 );
560 glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 );
561 glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 );
564 glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 );
565 glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, 1.0, 1.0 );
566 glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, 1.0, 1.0 );
567 glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 );
570 glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, - 1.0, 1.0 );
571 glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 );
572 glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 );
573 glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, - 1.0, 1.0 );
577 glDisable( VLCGL_TARGET );
579 p_sys->p_vout->pf_swap( p_sys->p_vout );
582 int GetAlignedSize( int i_size )
584 /* Return the nearest power of 2 */
586 while( i_result < i_size )
593 /*****************************************************************************
594 * Control: control facility for the vout
595 *****************************************************************************/
596 static int Control( vout_thread_t *p_vout, int i_query, va_list args )
598 vout_sys_t *p_sys = p_vout->p_sys;
600 if( p_sys->p_vout->pf_control )
601 return p_sys->p_vout->pf_control( p_sys->p_vout, i_query, args );
603 return vout_vaControlDefault( p_vout, i_query, args );
606 static int InitTextures( vout_thread_t *p_vout )
608 vout_sys_t *p_sys = p_vout->p_sys;
611 glDeleteTextures( 2, p_sys->p_textures );
612 glGenTextures( 2, p_sys->p_textures );
614 for( i_index = 0; i_index < 2; i_index++ )
616 glBindTexture( VLCGL_TARGET, p_sys->p_textures[i_index] );
618 /* Set the texture parameters */
619 glTexParameterf( VLCGL_TARGET, GL_TEXTURE_PRIORITY, 1.0 );
621 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
622 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
624 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_S, GL_CLAMP );
625 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_T, GL_CLAMP );
627 glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
630 /* Tell the driver not to make a copy of the texture but to use
632 glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE );
633 glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE );
636 /* Use VRAM texturing */
637 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE,
638 GL_STORAGE_CACHED_APPLE );
640 /* Use AGP texturing */
641 glTexParameteri( VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE,
642 GL_STORAGE_SHARED_APPLE );
646 /* Call glTexImage2D only once, and use glTexSubImage2D later */
647 glTexImage2D( VLCGL_TARGET, 0, 3, p_sys->i_tex_width,
648 p_sys->i_tex_height, 0, VLCGL_FORMAT, VLCGL_TYPE,
649 p_sys->pp_buffer[i_index] );
655 /*****************************************************************************
656 * SendEvents: forward mouse and keyboard events to the parent p_vout
657 *****************************************************************************/
658 static int SendEvents( vlc_object_t *p_this, char const *psz_var,
659 vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
661 return var_Set( (vlc_object_t *)_p_vout, psz_var, newval );