1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2004-2007 the VideoLAN team
7 * Authors: Antoine Cellerier <dionoea@videolan.org>
8 * Christophe Massiot <massiot@via.ecp.fr>
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
33 #include <errno.h> /* ENOMEM */
35 #include <vlc_common.h>
36 #include <vlc_plugin.h>
38 #include <vlc_block.h>
39 #include <vlc_codec.h>
42 #include <vlc_image.h>
43 #include <vlc_filter.h>
45 #include <vlc_memory.h>
47 #include "../video_filter/mosaic.h"
51 /*****************************************************************************
53 *****************************************************************************/
54 struct sout_stream_sys_t
60 image_handler_t *p_image; /* filter for resizing */
61 int i_height, i_width;
62 unsigned int i_sar_num, i_sar_den;
66 int i_chroma; /* force image format chroma */
68 filter_chain_t *p_vf2;
71 struct decoder_owner_sys_t
73 /* Current format in use by the output */
77 /*****************************************************************************
79 *****************************************************************************/
80 static int Open ( vlc_object_t * );
81 static void Close ( vlc_object_t * );
82 static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
83 static int Del ( sout_stream_t *, sout_stream_id_t * );
84 static int Send( sout_stream_t *, sout_stream_id_t *, block_t * );
86 inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
87 inline static void video_del_buffer_filter( filter_t *, picture_t * );
89 inline static picture_t *video_new_buffer_decoder( decoder_t * );
90 inline static picture_t *video_new_buffer_filter( filter_t * );
91 static picture_t *video_new_buffer( vlc_object_t *, decoder_owner_sys_t *,
94 static void video_link_picture_decoder( decoder_t *, picture_t * );
95 static void video_unlink_picture_decoder( decoder_t *, picture_t * );
97 static int HeightCallback( vlc_object_t *, char const *,
98 vlc_value_t, vlc_value_t, void * );
99 static int WidthCallback( vlc_object_t *, char const *,
100 vlc_value_t, vlc_value_t, void * );
101 static int alphaCallback( vlc_object_t *, char const *,
102 vlc_value_t, vlc_value_t, void * );
103 static int xCallback( vlc_object_t *, char const *,
104 vlc_value_t, vlc_value_t, void * );
105 static int yCallback( vlc_object_t *, char const *,
106 vlc_value_t, vlc_value_t, void * );
108 /*****************************************************************************
110 *****************************************************************************/
111 #define ID_TEXT N_("ID")
112 #define ID_LONGTEXT N_( \
113 "Specify an identifier string for this subpicture" )
115 #define WIDTH_TEXT N_("Video width")
116 #define WIDTH_LONGTEXT N_( \
117 "Output video width." )
118 #define HEIGHT_TEXT N_("Video height")
119 #define HEIGHT_LONGTEXT N_( \
120 "Output video height." )
121 #define RATIO_TEXT N_("Sample aspect ratio")
122 #define RATIO_LONGTEXT N_( \
123 "Sample aspect ratio of the destination (1:1, 3:4, 2:3)." )
125 #define VFILTER_TEXT N_("Video filter")
126 #define VFILTER_LONGTEXT N_( \
127 "Video filters will be applied to the video stream." )
129 #define CHROMA_TEXT N_("Image chroma")
130 #define CHROMA_LONGTEXT N_( \
131 "Force the use of a specific chroma. Use YUVA if you're planning " \
132 "to use the Alphamask or Bluescreen video filter." )
134 #define ALPHA_TEXT N_("Transparency")
135 #define ALPHA_LONGTEXT N_( \
136 "Transparency of the mosaic picture." )
138 #define X_TEXT N_("X offset")
139 #define X_LONGTEXT N_( \
140 "X coordinate of the upper left corner in the mosaic if non negative." )
142 #define Y_TEXT N_("Y offset")
143 #define Y_LONGTEXT N_( \
144 "Y coordinate of the upper left corner in the mosaic if non negative." )
146 #define CFG_PREFIX "sout-mosaic-bridge-"
149 set_shortname( N_( "Mosaic bridge" ) )
150 set_description(N_("Mosaic bridge stream output") )
151 set_capability( "sout stream", 0 )
152 add_shortcut( "mosaic-bridge" )
154 add_string( CFG_PREFIX "id", "Id", NULL, ID_TEXT, ID_LONGTEXT,
156 add_integer( CFG_PREFIX "width", 0, NULL, WIDTH_TEXT,
157 WIDTH_LONGTEXT, true )
158 add_integer( CFG_PREFIX "height", 0, NULL, HEIGHT_TEXT,
159 HEIGHT_LONGTEXT, true )
160 add_string( CFG_PREFIX "sar", "1:1", NULL, RATIO_TEXT,
161 RATIO_LONGTEXT, false )
162 add_string( CFG_PREFIX "chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
165 add_module_list( CFG_PREFIX "vfilter", "video filter2",
166 NULL, NULL, VFILTER_TEXT, VFILTER_LONGTEXT, false )
168 add_integer_with_range( CFG_PREFIX "alpha", 255, 0, 255, NULL,
169 ALPHA_TEXT, ALPHA_LONGTEXT, false )
170 add_integer( CFG_PREFIX "x", -1, NULL, X_TEXT, X_LONGTEXT, false )
171 add_integer( CFG_PREFIX "y", -1, NULL, Y_TEXT, Y_LONGTEXT, false )
173 set_callbacks( Open, Close )
176 static const char *const ppsz_sout_options[] = {
177 "id", "width", "height", "sar", "vfilter", "chroma", "alpha", "x", "y", NULL
180 /*****************************************************************************
182 *****************************************************************************/
183 static int Open( vlc_object_t *p_this )
185 sout_stream_t *p_stream = (sout_stream_t *)p_this;
186 sout_stream_sys_t *p_sys;
187 vlc_object_t *p_libvlc = VLC_OBJECT( p_this->p_libvlc );
190 config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
193 p_sys = malloc( sizeof( sout_stream_sys_t ) );
197 p_stream->p_sys = p_sys;
198 p_sys->b_inited = false;
200 var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
201 var_Get( p_libvlc, "mosaic-lock", &val );
202 p_sys->p_lock = val.p_address;
204 p_sys->psz_id = var_CreateGetString( p_stream, CFG_PREFIX "id" );
207 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "height" );
208 var_AddCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
211 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "width" );
212 var_AddCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
214 var_Get( p_stream, CFG_PREFIX "sar", &val );
217 char *psz_parser = strchr( val.psz_string, ':' );
221 *psz_parser++ = '\0';
222 p_sys->i_sar_num = atoi( val.psz_string );
223 p_sys->i_sar_den = atoi( psz_parser );
224 vlc_ureduce( &p_sys->i_sar_num, &p_sys->i_sar_den,
225 p_sys->i_sar_num, p_sys->i_sar_den, 0 );
229 msg_Warn( p_stream, "bad aspect ratio %s", val.psz_string );
230 p_sys->i_sar_num = p_sys->i_sar_den = 1;
233 free( val.psz_string );
237 p_sys->i_sar_num = p_sys->i_sar_den = 1;
241 val.psz_string = var_GetNonEmptyString( p_stream, CFG_PREFIX "chroma" );
242 if( val.psz_string && strlen( val.psz_string ) >= 4 )
244 memcpy( &p_sys->i_chroma, val.psz_string, 4 );
245 msg_Dbg( p_stream, "Forcing image chroma to 0x%.8x (%4.4s)", p_sys->i_chroma, (char*)&p_sys->i_chroma );
247 free( val.psz_string );
249 #define INT_COMMAND( a ) do { \
250 var_Create( p_stream, CFG_PREFIX #a, \
251 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND ); \
252 var_AddCallback( p_stream, CFG_PREFIX #a, a ## Callback, \
253 p_stream ); } while(0)
254 INT_COMMAND( alpha );
260 p_stream->pf_add = Add;
261 p_stream->pf_del = Del;
262 p_stream->pf_send = Send;
264 p_stream->p_sout->i_out_pace_nocontrol++;
269 /*****************************************************************************
271 *****************************************************************************/
272 static void Close( vlc_object_t * p_this )
274 sout_stream_t *p_stream = (sout_stream_t*)p_this;
275 sout_stream_sys_t *p_sys = p_stream->p_sys;
277 /* Delete the callbacks */
278 var_DelCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
279 var_DelCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
280 var_DelCallback( p_stream, CFG_PREFIX "alpha", alphaCallback, p_stream );
281 var_DelCallback( p_stream, CFG_PREFIX "x", xCallback, p_stream );
282 var_DelCallback( p_stream, CFG_PREFIX "y", yCallback, p_stream );
284 p_stream->p_sout->i_out_pace_nocontrol--;
286 free( p_sys->psz_id );
291 static int video_filter_buffer_allocation_init( filter_t *p_filter, void *p_data )
293 p_filter->pf_vout_buffer_new = video_new_buffer_filter;
294 p_filter->pf_vout_buffer_del = video_del_buffer_filter;
295 p_filter->p_owner = p_data;
299 static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
301 sout_stream_sys_t *p_sys = p_stream->p_sys;
307 if( p_sys->b_inited || p_fmt->i_cat != VIDEO_ES )
310 /* Create decoder object */
311 p_sys->p_decoder = vlc_object_create( p_stream, VLC_OBJECT_DECODER );
312 if( !p_sys->p_decoder )
314 vlc_object_attach( p_sys->p_decoder, p_stream );
315 p_sys->p_decoder->p_module = NULL;
316 p_sys->p_decoder->fmt_in = *p_fmt;
317 p_sys->p_decoder->b_pace_control = false;
318 p_sys->p_decoder->fmt_out = p_sys->p_decoder->fmt_in;
319 p_sys->p_decoder->fmt_out.i_extra = 0;
320 p_sys->p_decoder->fmt_out.p_extra = 0;
321 p_sys->p_decoder->pf_decode_video = 0;
322 p_sys->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
323 p_sys->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
324 p_sys->p_decoder->pf_picture_link = video_link_picture_decoder;
325 p_sys->p_decoder->pf_picture_unlink = video_unlink_picture_decoder;
326 p_sys->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
327 if( !p_sys->p_decoder->p_owner )
329 vlc_object_detach( p_sys->p_decoder );
330 vlc_object_release( p_sys->p_decoder );
334 p_sys->p_decoder->p_owner->video = p_fmt->video;
335 //p_sys->p_decoder->p_cfg = p_sys->p_video_cfg;
337 p_sys->p_decoder->p_module =
338 module_need( p_sys->p_decoder, "decoder", "$codec", false );
340 if( !p_sys->p_decoder->p_module || !p_sys->p_decoder->pf_decode_video )
342 if( p_sys->p_decoder->p_module )
344 msg_Err( p_stream, "instanciated a non video decoder" );
345 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
349 msg_Err( p_stream, "cannot find decoder" );
351 free( p_sys->p_decoder->p_owner );
352 vlc_object_detach( p_sys->p_decoder );
353 vlc_object_release( p_sys->p_decoder );
357 p_sys->b_inited = true;
358 vlc_mutex_lock( p_sys->p_lock );
360 p_bridge = GetBridge( p_stream );
361 if ( p_bridge == NULL )
363 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
366 p_bridge = malloc( sizeof( bridge_t ) );
369 var_Create( p_libvlc, "mosaic-struct", VLC_VAR_ADDRESS );
370 val.p_address = p_bridge;
371 var_Set( p_libvlc, "mosaic-struct", val );
373 p_bridge->i_es_num = 0;
374 p_bridge->pp_es = NULL;
377 for ( i = 0; i < p_bridge->i_es_num; i++ )
379 if ( p_bridge->pp_es[i]->b_empty )
383 if ( i == p_bridge->i_es_num )
385 p_bridge->pp_es = realloc_or_free( p_bridge->pp_es,
386 (p_bridge->i_es_num + 1) * sizeof(bridged_es_t *) );
387 assert( p_bridge->pp_es );
388 p_bridge->i_es_num++;
389 p_bridge->pp_es[i] = malloc( sizeof(bridged_es_t) );
390 assert( p_bridge->pp_es[i] );
393 p_sys->p_es = p_es = p_bridge->pp_es[i];
395 p_es->i_alpha = var_GetInteger( p_stream, CFG_PREFIX "alpha" );
396 p_es->i_x = var_GetInteger( p_stream, CFG_PREFIX "x" );
397 p_es->i_y = var_GetInteger( p_stream, CFG_PREFIX "y" );
399 //p_es->fmt = *p_fmt;
400 p_es->psz_id = p_sys->psz_id;
401 p_es->p_picture = NULL;
402 p_es->pp_last = &p_es->p_picture;
403 p_es->b_empty = false;
405 vlc_mutex_unlock( p_sys->p_lock );
407 if ( p_sys->i_height || p_sys->i_width )
409 p_sys->p_image = image_HandlerCreate( p_stream );
413 p_sys->p_image = NULL;
416 msg_Dbg( p_stream, "mosaic bridge id=%s pos=%d", p_es->psz_id, i );
418 /* Create user specified video filters */
419 psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
420 msg_Dbg( p_stream, "psz_chain: %s", psz_chain );
423 p_sys->p_vf2 = filter_chain_New( p_stream, "video filter2", false,
424 video_filter_buffer_allocation_init,
425 NULL, p_sys->p_decoder->p_owner );
427 es_format_Copy( &fmt, &p_sys->p_decoder->fmt_out );
428 if( p_sys->i_chroma )
429 fmt.video.i_chroma = p_sys->i_chroma;
430 filter_chain_Reset( p_sys->p_vf2, &fmt, &fmt );
431 filter_chain_AppendFromString( p_sys->p_vf2, psz_chain );
439 return (sout_stream_id_t *)p_sys;
442 static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
445 sout_stream_sys_t *p_sys = p_stream->p_sys;
448 bool b_last_es = true;
451 if( !p_sys->b_inited )
454 if( p_sys->p_decoder != NULL )
456 decoder_owner_sys_t *p_owner = p_sys->p_decoder->p_owner;
458 if( p_sys->p_decoder->p_module )
459 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
460 if( p_sys->p_decoder->p_description )
461 vlc_meta_Delete( p_sys->p_decoder->p_description );
463 vlc_object_detach( p_sys->p_decoder );
464 vlc_object_release( p_sys->p_decoder );
469 /* Destroy user specified video filters */
471 filter_chain_Delete( p_sys->p_vf2 );
473 vlc_mutex_lock( p_sys->p_lock );
475 p_bridge = GetBridge( p_stream );
478 p_es->b_empty = true;
479 while ( p_es->p_picture )
481 picture_t *p_next = p_es->p_picture->p_next;
482 picture_Release( p_es->p_picture );
483 p_es->p_picture = p_next;
486 for ( i = 0; i < p_bridge->i_es_num; i++ )
488 if ( !p_bridge->pp_es[i]->b_empty )
497 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
498 for ( i = 0; i < p_bridge->i_es_num; i++ )
499 free( p_bridge->pp_es[i] );
500 free( p_bridge->pp_es );
502 var_Destroy( p_libvlc, "mosaic-struct" );
505 vlc_mutex_unlock( p_sys->p_lock );
507 if ( p_sys->p_image )
509 image_HandlerDelete( p_sys->p_image );
512 p_sys->b_inited = false;
517 /*****************************************************************************
518 * PushPicture : push a picture in the mosaic-struct structure
519 *****************************************************************************/
520 static void PushPicture( sout_stream_t *p_stream, picture_t *p_picture )
522 sout_stream_sys_t *p_sys = p_stream->p_sys;
523 bridged_es_t *p_es = p_sys->p_es;
525 vlc_mutex_lock( p_sys->p_lock );
527 *p_es->pp_last = p_picture;
528 p_picture->p_next = NULL;
529 p_es->pp_last = &p_picture->p_next;
531 vlc_mutex_unlock( p_sys->p_lock );
534 static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
537 sout_stream_sys_t *p_sys = p_stream->p_sys;
540 if ( (sout_stream_sys_t *)id != p_sys )
542 block_ChainRelease( p_buffer );
546 while ( (p_pic = p_sys->p_decoder->pf_decode_video( p_sys->p_decoder,
549 picture_t *p_new_pic;
551 if( p_sys->i_height || p_sys->i_width )
553 video_format_t fmt_out, fmt_in;
555 memset( &fmt_in, 0, sizeof(video_format_t) );
556 memset( &fmt_out, 0, sizeof(video_format_t) );
557 fmt_in = p_sys->p_decoder->fmt_out.video;
560 if( p_sys->i_chroma )
561 fmt_out.i_chroma = p_sys->i_chroma;
563 fmt_out.i_chroma = VLC_CODEC_I420;
565 if ( !p_sys->i_height )
567 fmt_out.i_width = p_sys->i_width;
568 fmt_out.i_height = (p_sys->i_width * VOUT_ASPECT_FACTOR
569 * p_sys->i_sar_num / p_sys->i_sar_den / fmt_in.i_aspect)
572 else if ( !p_sys->i_width )
574 fmt_out.i_height = p_sys->i_height;
575 fmt_out.i_width = (p_sys->i_height * fmt_in.i_aspect
576 * p_sys->i_sar_den / p_sys->i_sar_num / VOUT_ASPECT_FACTOR)
581 fmt_out.i_width = p_sys->i_width;
582 fmt_out.i_height = p_sys->i_height;
584 fmt_out.i_visible_width = fmt_out.i_width;
585 fmt_out.i_visible_height = fmt_out.i_height;
587 p_new_pic = image_Convert( p_sys->p_image,
588 p_pic, &fmt_in, &fmt_out );
589 if( p_new_pic == NULL )
591 msg_Err( p_stream, "image conversion failed" );
592 picture_Release( p_pic );
598 /* TODO: chroma conversion if needed */
600 p_new_pic = picture_New( p_pic->format.i_chroma,
601 p_pic->format.i_width, p_pic->format.i_height,
602 p_sys->p_decoder->fmt_out.video.i_aspect );
605 picture_Release( p_pic );
606 msg_Err( p_stream, "image allocation failed" );
610 picture_Copy( p_new_pic, p_pic );
612 picture_Release( p_pic );
615 p_new_pic = filter_chain_VideoFilter( p_sys->p_vf2, p_new_pic );
617 PushPicture( p_stream, p_new_pic );
623 inline static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
625 return video_new_buffer( VLC_OBJECT( p_dec ),
626 (decoder_owner_sys_t *)p_dec->p_owner,
630 inline static picture_t *video_new_buffer_filter( filter_t *p_filter )
632 return video_new_buffer( VLC_OBJECT( p_filter ),
633 (decoder_owner_sys_t *)p_filter->p_owner,
634 &p_filter->fmt_out );
637 static picture_t *video_new_buffer( vlc_object_t *p_this,
638 decoder_owner_sys_t *p_sys,
639 es_format_t *fmt_out )
642 if( fmt_out->video.i_width != p_sys->video.i_width ||
643 fmt_out->video.i_height != p_sys->video.i_height ||
644 fmt_out->video.i_chroma != p_sys->video.i_chroma ||
645 fmt_out->video.i_aspect != p_sys->video.i_aspect )
647 if( !fmt_out->video.i_sar_num ||
648 !fmt_out->video.i_sar_den )
650 fmt_out->video.i_sar_num =
651 fmt_out->video.i_aspect * fmt_out->video.i_height;
653 fmt_out->video.i_sar_den =
654 VOUT_ASPECT_FACTOR * fmt_out->video.i_width;
657 vlc_ureduce( &fmt_out->video.i_sar_num,
658 &fmt_out->video.i_sar_den,
659 fmt_out->video.i_sar_num,
660 fmt_out->video.i_sar_den, 0 );
662 if( !fmt_out->video.i_visible_width ||
663 !fmt_out->video.i_visible_height )
665 fmt_out->video.i_visible_width = fmt_out->video.i_width;
666 fmt_out->video.i_visible_height = fmt_out->video.i_height;
669 fmt_out->video.i_chroma = fmt_out->i_codec;
670 p_sys->video = fmt_out->video;
674 fmt_out->video.i_chroma = fmt_out->i_codec;
676 return picture_New( fmt_out->video.i_chroma,
677 fmt_out->video.i_width,
678 fmt_out->video.i_height,
679 fmt_out->video.i_aspect );
682 inline static void video_del_buffer_decoder( decoder_t *p_this,
686 picture_Release( p_pic );
689 inline static void video_del_buffer_filter( filter_t *p_this,
693 picture_Release( p_pic );
696 static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
699 picture_Hold( p_pic );
702 static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
705 picture_Release( p_pic );
709 /**********************************************************************
710 * Callback to update (some) params on the fly
711 **********************************************************************/
712 static int HeightCallback( vlc_object_t *p_this, char const *psz_var,
713 vlc_value_t oldval, vlc_value_t newval,
716 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
717 sout_stream_t *p_stream = (sout_stream_t *)p_data;
718 sout_stream_sys_t *p_sys = p_stream->p_sys;
720 /* We create the handler before updating the value in p_sys
721 * so we don't have to worry about locking */
722 if( !p_sys->p_image && newval.i_int )
723 p_sys->p_image = image_HandlerCreate( p_stream );
724 p_sys->i_height = newval.i_int;
729 static int WidthCallback( vlc_object_t *p_this, char const *psz_var,
730 vlc_value_t oldval, vlc_value_t newval,
733 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
734 sout_stream_t *p_stream = (sout_stream_t *)p_data;
735 sout_stream_sys_t *p_sys = p_stream->p_sys;
737 /* We create the handler before updating the value in p_sys
738 * so we don't have to worry about locking */
739 if( !p_sys->p_image && newval.i_int )
740 p_sys->p_image = image_HandlerCreate( p_stream );
741 p_sys->i_width = newval.i_int;
746 static int alphaCallback( vlc_object_t *p_this, char const *psz_var,
747 vlc_value_t oldval, vlc_value_t newval,
750 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
751 sout_stream_t *p_stream = (sout_stream_t *)p_data;
752 sout_stream_sys_t *p_sys = p_stream->p_sys;
755 p_sys->p_es->i_alpha = newval.i_int;
760 static int xCallback( vlc_object_t *p_this, char const *psz_var,
761 vlc_value_t oldval, vlc_value_t newval,
764 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
765 sout_stream_t *p_stream = (sout_stream_t *)p_data;
766 sout_stream_sys_t *p_sys = p_stream->p_sys;
769 p_sys->p_es->i_x = newval.i_int;
774 static int yCallback( vlc_object_t *p_this, char const *psz_var,
775 vlc_value_t oldval, vlc_value_t newval,
778 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
779 sout_stream_t *p_stream = (sout_stream_t *)p_data;
780 sout_stream_sys_t *p_sys = p_stream->p_sys;
783 p_sys->p_es->i_y = newval.i_int;