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 <vlc_common.h>
34 #include <vlc_plugin.h>
36 #include <vlc_block.h>
37 #include <vlc_codec.h>
40 #include <vlc_image.h>
41 #include <vlc_filter.h>
43 #include "../video_filter/mosaic.h"
45 /*****************************************************************************
47 *****************************************************************************/
48 struct sout_stream_sys_t
54 image_handler_t *p_image; /* filter for resizing */
55 int i_height, i_width;
56 unsigned int i_sar_num, i_sar_den;
60 int i_chroma; /* force image format chroma */
62 filter_chain_t *p_vf2;
65 struct decoder_owner_sys_t
67 /* Current format in use by the output */
71 /*****************************************************************************
73 *****************************************************************************/
74 static int Open ( vlc_object_t * );
75 static void Close ( vlc_object_t * );
76 static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
77 static int Del ( sout_stream_t *, sout_stream_id_t * );
78 static int Send( sout_stream_t *, sout_stream_id_t *, block_t * );
80 inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
81 inline static void video_del_buffer_filter( filter_t *, picture_t * );
83 inline static picture_t *video_new_buffer_decoder( decoder_t * );
84 inline static picture_t *video_new_buffer_filter( filter_t * );
85 static picture_t *video_new_buffer( vlc_object_t *, decoder_owner_sys_t *,
88 static void video_link_picture_decoder( decoder_t *, picture_t * );
89 static void video_unlink_picture_decoder( decoder_t *, picture_t * );
91 static int HeightCallback( vlc_object_t *, char const *,
92 vlc_value_t, vlc_value_t, void * );
93 static int WidthCallback( vlc_object_t *, char const *,
94 vlc_value_t, vlc_value_t, void * );
95 static int alphaCallback( vlc_object_t *, char const *,
96 vlc_value_t, vlc_value_t, void * );
97 static int xCallback( vlc_object_t *, char const *,
98 vlc_value_t, vlc_value_t, void * );
99 static int yCallback( vlc_object_t *, char const *,
100 vlc_value_t, vlc_value_t, void * );
102 /*****************************************************************************
104 *****************************************************************************/
105 #define ID_TEXT N_("ID")
106 #define ID_LONGTEXT N_( \
107 "Specify an identifier string for this subpicture" )
109 #define WIDTH_TEXT N_("Video width")
110 #define WIDTH_LONGTEXT N_( \
111 "Output video width." )
112 #define HEIGHT_TEXT N_("Video height")
113 #define HEIGHT_LONGTEXT N_( \
114 "Output video height." )
115 #define RATIO_TEXT N_("Sample aspect ratio")
116 #define RATIO_LONGTEXT N_( \
117 "Sample aspect ratio of the destination (1:1, 3:4, 2:3)." )
119 #define VFILTER_TEXT N_("Video filter")
120 #define VFILTER_LONGTEXT N_( \
121 "Video filters will be applied to the video stream." )
123 #define CHROMA_TEXT N_("Image chroma")
124 #define CHROMA_LONGTEXT N_( \
125 "Force the use of a specific chroma. Use YUVA if you're planning " \
126 "to use the Alphamask or Bluescreen video filter." )
128 #define ALPHA_TEXT N_("Transparency")
129 #define ALPHA_LONGTEXT N_( \
130 "Transparency of the mosaic picture." )
132 #define X_TEXT N_("X offset")
133 #define X_LONGTEXT N_( \
134 "X coordinate of the upper left corner in the mosaic if non negative." )
136 #define Y_TEXT N_("Y offset")
137 #define Y_LONGTEXT N_( \
138 "Y coordinate of the upper left corner in the mosaic if non negative." )
140 #define CFG_PREFIX "sout-mosaic-bridge-"
143 set_shortname( N_( "Mosaic bridge" ) )
144 set_description(N_("Mosaic bridge stream output") )
145 set_capability( "sout stream", 0 )
146 add_shortcut( "mosaic-bridge" )
148 add_string( CFG_PREFIX "id", "Id", NULL, ID_TEXT, ID_LONGTEXT,
150 add_integer( CFG_PREFIX "width", 0, NULL, WIDTH_TEXT,
151 WIDTH_LONGTEXT, true )
152 add_integer( CFG_PREFIX "height", 0, NULL, HEIGHT_TEXT,
153 HEIGHT_LONGTEXT, true )
154 add_string( CFG_PREFIX "sar", "1:1", NULL, RATIO_TEXT,
155 RATIO_LONGTEXT, false )
156 add_string( CFG_PREFIX "chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
159 add_module_list( CFG_PREFIX "vfilter", "video filter2",
160 NULL, NULL, VFILTER_TEXT, VFILTER_LONGTEXT, false )
162 add_integer_with_range( CFG_PREFIX "alpha", 255, 0, 255, NULL,
163 ALPHA_TEXT, ALPHA_LONGTEXT, false )
164 add_integer( CFG_PREFIX "x", -1, NULL, X_TEXT, X_LONGTEXT, false )
165 add_integer( CFG_PREFIX "y", -1, NULL, Y_TEXT, Y_LONGTEXT, false )
167 set_callbacks( Open, Close )
170 static const char *const ppsz_sout_options[] = {
171 "id", "width", "height", "sar", "vfilter", "chroma", "alpha", "x", "y", NULL
174 /*****************************************************************************
176 *****************************************************************************/
177 static int Open( vlc_object_t *p_this )
179 sout_stream_t *p_stream = (sout_stream_t *)p_this;
180 sout_stream_sys_t *p_sys;
181 vlc_object_t *p_libvlc = VLC_OBJECT( p_this->p_libvlc );
184 config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
187 p_sys = malloc( sizeof( sout_stream_sys_t ) );
191 p_stream->p_sys = p_sys;
192 p_sys->b_inited = false;
194 var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
195 var_Get( p_libvlc, "mosaic-lock", &val );
196 p_sys->p_lock = val.p_address;
198 p_sys->psz_id = var_CreateGetString( p_stream, CFG_PREFIX "id" );
201 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "height" );
202 var_AddCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
205 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "width" );
206 var_AddCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
208 var_Get( p_stream, CFG_PREFIX "sar", &val );
211 char *psz_parser = strchr( val.psz_string, ':' );
215 *psz_parser++ = '\0';
216 p_sys->i_sar_num = atoi( val.psz_string );
217 p_sys->i_sar_den = atoi( psz_parser );
218 vlc_ureduce( &p_sys->i_sar_num, &p_sys->i_sar_den,
219 p_sys->i_sar_num, p_sys->i_sar_den, 0 );
223 msg_Warn( p_stream, "bad aspect ratio %s", val.psz_string );
224 p_sys->i_sar_num = p_sys->i_sar_den = 1;
227 free( val.psz_string );
231 p_sys->i_sar_num = p_sys->i_sar_den = 1;
235 val.psz_string = var_GetNonEmptyString( p_stream, CFG_PREFIX "chroma" );
236 if( val.psz_string && strlen( val.psz_string ) >= 4 )
238 memcpy( &p_sys->i_chroma, val.psz_string, 4 );
239 msg_Dbg( p_stream, "Forcing image chroma to 0x%.8x (%4.4s)", p_sys->i_chroma, (char*)&p_sys->i_chroma );
241 free( val.psz_string );
243 #define INT_COMMAND( a ) do { \
244 var_Create( p_stream, CFG_PREFIX #a, \
245 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND ); \
246 var_AddCallback( p_stream, CFG_PREFIX #a, a ## Callback, \
247 p_stream ); } while(0)
248 INT_COMMAND( alpha );
254 p_stream->pf_add = Add;
255 p_stream->pf_del = Del;
256 p_stream->pf_send = Send;
258 p_stream->p_sout->i_out_pace_nocontrol++;
263 /*****************************************************************************
265 *****************************************************************************/
266 static void Close( vlc_object_t * p_this )
268 sout_stream_t *p_stream = (sout_stream_t*)p_this;
269 sout_stream_sys_t *p_sys = p_stream->p_sys;
271 /* Delete the callbacks */
272 var_DelCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
273 var_DelCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
274 var_DelCallback( p_stream, CFG_PREFIX "alpha", alphaCallback, p_stream );
275 var_DelCallback( p_stream, CFG_PREFIX "x", xCallback, p_stream );
276 var_DelCallback( p_stream, CFG_PREFIX "y", yCallback, p_stream );
278 p_stream->p_sout->i_out_pace_nocontrol--;
280 free( p_sys->psz_id );
285 static int video_filter_buffer_allocation_init( filter_t *p_filter, void *p_data )
287 p_filter->pf_video_buffer_new = video_new_buffer_filter;
288 p_filter->pf_video_buffer_del = video_del_buffer_filter;
289 p_filter->p_owner = p_data;
293 static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
295 sout_stream_sys_t *p_sys = p_stream->p_sys;
301 if( p_sys->b_inited || p_fmt->i_cat != VIDEO_ES )
304 /* Create decoder object */
305 p_sys->p_decoder = vlc_object_create( p_stream, sizeof( decoder_t ) );
306 if( !p_sys->p_decoder )
308 vlc_object_attach( p_sys->p_decoder, p_stream );
309 p_sys->p_decoder->p_module = NULL;
310 p_sys->p_decoder->fmt_in = *p_fmt;
311 p_sys->p_decoder->b_pace_control = false;
312 p_sys->p_decoder->fmt_out = p_sys->p_decoder->fmt_in;
313 p_sys->p_decoder->fmt_out.i_extra = 0;
314 p_sys->p_decoder->fmt_out.p_extra = 0;
315 p_sys->p_decoder->pf_decode_video = 0;
316 p_sys->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
317 p_sys->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
318 p_sys->p_decoder->pf_picture_link = video_link_picture_decoder;
319 p_sys->p_decoder->pf_picture_unlink = video_unlink_picture_decoder;
320 p_sys->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
321 if( !p_sys->p_decoder->p_owner )
323 vlc_object_detach( p_sys->p_decoder );
324 vlc_object_release( p_sys->p_decoder );
328 p_sys->p_decoder->p_owner->video = p_fmt->video;
329 //p_sys->p_decoder->p_cfg = p_sys->p_video_cfg;
331 p_sys->p_decoder->p_module =
332 module_need( p_sys->p_decoder, "decoder", "$codec", false );
334 if( !p_sys->p_decoder->p_module || !p_sys->p_decoder->pf_decode_video )
336 if( p_sys->p_decoder->p_module )
338 msg_Err( p_stream, "instanciated a non video decoder" );
339 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
343 msg_Err( p_stream, "cannot find decoder" );
345 free( p_sys->p_decoder->p_owner );
346 vlc_object_detach( p_sys->p_decoder );
347 vlc_object_release( p_sys->p_decoder );
351 p_sys->b_inited = true;
352 vlc_mutex_lock( p_sys->p_lock );
354 p_bridge = GetBridge( p_stream );
355 if ( p_bridge == NULL )
357 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
360 p_bridge = xmalloc( sizeof( bridge_t ) );
362 var_Create( p_libvlc, "mosaic-struct", VLC_VAR_ADDRESS );
363 val.p_address = p_bridge;
364 var_Set( p_libvlc, "mosaic-struct", val );
366 p_bridge->i_es_num = 0;
367 p_bridge->pp_es = NULL;
370 for ( i = 0; i < p_bridge->i_es_num; i++ )
372 if ( p_bridge->pp_es[i]->b_empty )
376 if ( i == p_bridge->i_es_num )
378 p_bridge->pp_es = xrealloc( p_bridge->pp_es,
379 (p_bridge->i_es_num + 1) * sizeof(bridged_es_t *) );
380 p_bridge->i_es_num++;
381 p_bridge->pp_es[i] = xmalloc( sizeof(bridged_es_t) );
384 p_sys->p_es = p_es = p_bridge->pp_es[i];
386 p_es->i_alpha = var_GetInteger( p_stream, CFG_PREFIX "alpha" );
387 p_es->i_x = var_GetInteger( p_stream, CFG_PREFIX "x" );
388 p_es->i_y = var_GetInteger( p_stream, CFG_PREFIX "y" );
390 //p_es->fmt = *p_fmt;
391 p_es->psz_id = p_sys->psz_id;
392 p_es->p_picture = NULL;
393 p_es->pp_last = &p_es->p_picture;
394 p_es->b_empty = false;
396 vlc_mutex_unlock( p_sys->p_lock );
398 if ( p_sys->i_height || p_sys->i_width )
400 p_sys->p_image = image_HandlerCreate( p_stream );
404 p_sys->p_image = NULL;
407 msg_Dbg( p_stream, "mosaic bridge id=%s pos=%d", p_es->psz_id, i );
409 /* Create user specified video filters */
410 psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
411 msg_Dbg( p_stream, "psz_chain: %s", psz_chain );
414 p_sys->p_vf2 = filter_chain_New( p_stream, "video filter2", false,
415 video_filter_buffer_allocation_init,
416 NULL, p_sys->p_decoder->p_owner );
418 es_format_Copy( &fmt, &p_sys->p_decoder->fmt_out );
419 if( p_sys->i_chroma )
420 fmt.video.i_chroma = p_sys->i_chroma;
421 filter_chain_Reset( p_sys->p_vf2, &fmt, &fmt );
422 filter_chain_AppendFromString( p_sys->p_vf2, psz_chain );
430 return (sout_stream_id_t *)p_sys;
433 static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
436 sout_stream_sys_t *p_sys = p_stream->p_sys;
439 bool b_last_es = true;
442 if( !p_sys->b_inited )
445 if( p_sys->p_decoder != NULL )
447 decoder_owner_sys_t *p_owner = p_sys->p_decoder->p_owner;
449 if( p_sys->p_decoder->p_module )
450 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
451 if( p_sys->p_decoder->p_description )
452 vlc_meta_Delete( p_sys->p_decoder->p_description );
454 vlc_object_detach( p_sys->p_decoder );
455 vlc_object_release( p_sys->p_decoder );
460 /* Destroy user specified video filters */
462 filter_chain_Delete( p_sys->p_vf2 );
464 vlc_mutex_lock( p_sys->p_lock );
466 p_bridge = GetBridge( p_stream );
469 p_es->b_empty = true;
470 while ( p_es->p_picture )
472 picture_t *p_next = p_es->p_picture->p_next;
473 picture_Release( p_es->p_picture );
474 p_es->p_picture = p_next;
477 for ( i = 0; i < p_bridge->i_es_num; i++ )
479 if ( !p_bridge->pp_es[i]->b_empty )
488 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
489 for ( i = 0; i < p_bridge->i_es_num; i++ )
490 free( p_bridge->pp_es[i] );
491 free( p_bridge->pp_es );
493 var_Destroy( p_libvlc, "mosaic-struct" );
496 vlc_mutex_unlock( p_sys->p_lock );
498 if ( p_sys->p_image )
500 image_HandlerDelete( p_sys->p_image );
503 p_sys->b_inited = false;
508 /*****************************************************************************
509 * PushPicture : push a picture in the mosaic-struct structure
510 *****************************************************************************/
511 static void PushPicture( sout_stream_t *p_stream, picture_t *p_picture )
513 sout_stream_sys_t *p_sys = p_stream->p_sys;
514 bridged_es_t *p_es = p_sys->p_es;
516 vlc_mutex_lock( p_sys->p_lock );
518 *p_es->pp_last = p_picture;
519 p_picture->p_next = NULL;
520 p_es->pp_last = &p_picture->p_next;
522 vlc_mutex_unlock( p_sys->p_lock );
525 static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
528 sout_stream_sys_t *p_sys = p_stream->p_sys;
531 if ( (sout_stream_sys_t *)id != p_sys )
533 block_ChainRelease( p_buffer );
537 while ( (p_pic = p_sys->p_decoder->pf_decode_video( p_sys->p_decoder,
540 picture_t *p_new_pic;
542 if( p_sys->i_height || p_sys->i_width )
544 video_format_t fmt_out, fmt_in;
546 memset( &fmt_in, 0, sizeof(video_format_t) );
547 memset( &fmt_out, 0, sizeof(video_format_t) );
548 fmt_in = p_sys->p_decoder->fmt_out.video;
551 if( p_sys->i_chroma )
552 fmt_out.i_chroma = p_sys->i_chroma;
554 fmt_out.i_chroma = VLC_CODEC_I420;
556 const unsigned i_fmt_in_aspect =
557 (int64_t)VOUT_ASPECT_FACTOR *
558 fmt_in.i_sar_num * fmt_in.i_width /
559 (fmt_in.i_sar_den * fmt_in.i_height);
560 if ( !p_sys->i_height )
562 fmt_out.i_width = p_sys->i_width;
563 fmt_out.i_height = (p_sys->i_width * VOUT_ASPECT_FACTOR
564 * p_sys->i_sar_num / p_sys->i_sar_den / i_fmt_in_aspect)
567 else if ( !p_sys->i_width )
569 fmt_out.i_height = p_sys->i_height;
570 fmt_out.i_width = (p_sys->i_height * i_fmt_in_aspect
571 * p_sys->i_sar_den / p_sys->i_sar_num / VOUT_ASPECT_FACTOR)
576 fmt_out.i_width = p_sys->i_width;
577 fmt_out.i_height = p_sys->i_height;
579 fmt_out.i_visible_width = fmt_out.i_width;
580 fmt_out.i_visible_height = fmt_out.i_height;
582 p_new_pic = image_Convert( p_sys->p_image,
583 p_pic, &fmt_in, &fmt_out );
584 if( p_new_pic == NULL )
586 msg_Err( p_stream, "image conversion failed" );
587 picture_Release( p_pic );
593 /* TODO: chroma conversion if needed */
595 p_new_pic = picture_New( p_pic->format.i_chroma,
596 p_pic->format.i_width, p_pic->format.i_height,
597 p_sys->p_decoder->fmt_out.video.i_sar_num,
598 p_sys->p_decoder->fmt_out.video.i_sar_den );
601 picture_Release( p_pic );
602 msg_Err( p_stream, "image allocation failed" );
606 picture_Copy( p_new_pic, p_pic );
608 picture_Release( p_pic );
611 p_new_pic = filter_chain_VideoFilter( p_sys->p_vf2, p_new_pic );
613 PushPicture( p_stream, p_new_pic );
619 inline static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
621 return video_new_buffer( VLC_OBJECT( p_dec ),
622 (decoder_owner_sys_t *)p_dec->p_owner,
626 inline static picture_t *video_new_buffer_filter( filter_t *p_filter )
628 return video_new_buffer( VLC_OBJECT( p_filter ),
629 (decoder_owner_sys_t *)p_filter->p_owner,
630 &p_filter->fmt_out );
633 static picture_t *video_new_buffer( vlc_object_t *p_this,
634 decoder_owner_sys_t *p_sys,
635 es_format_t *fmt_out )
638 if( fmt_out->video.i_width != p_sys->video.i_width ||
639 fmt_out->video.i_height != p_sys->video.i_height ||
640 fmt_out->video.i_chroma != p_sys->video.i_chroma ||
641 (int64_t)fmt_out->video.i_sar_num * p_sys->video.i_sar_den !=
642 (int64_t)fmt_out->video.i_sar_den * p_sys->video.i_sar_num )
644 vlc_ureduce( &fmt_out->video.i_sar_num,
645 &fmt_out->video.i_sar_den,
646 fmt_out->video.i_sar_num,
647 fmt_out->video.i_sar_den, 0 );
649 if( !fmt_out->video.i_visible_width ||
650 !fmt_out->video.i_visible_height )
652 fmt_out->video.i_visible_width = fmt_out->video.i_width;
653 fmt_out->video.i_visible_height = fmt_out->video.i_height;
656 fmt_out->video.i_chroma = fmt_out->i_codec;
657 p_sys->video = fmt_out->video;
661 fmt_out->video.i_chroma = fmt_out->i_codec;
663 return picture_NewFromFormat( &fmt_out->video );
666 inline static void video_del_buffer_decoder( decoder_t *p_this,
670 picture_Release( p_pic );
673 inline static void video_del_buffer_filter( filter_t *p_this,
677 picture_Release( p_pic );
680 static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
683 picture_Hold( p_pic );
686 static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
689 picture_Release( p_pic );
693 /**********************************************************************
694 * Callback to update (some) params on the fly
695 **********************************************************************/
696 static int HeightCallback( vlc_object_t *p_this, char const *psz_var,
697 vlc_value_t oldval, vlc_value_t newval,
700 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
701 sout_stream_t *p_stream = (sout_stream_t *)p_data;
702 sout_stream_sys_t *p_sys = p_stream->p_sys;
704 /* We create the handler before updating the value in p_sys
705 * so we don't have to worry about locking */
706 if( !p_sys->p_image && newval.i_int )
707 p_sys->p_image = image_HandlerCreate( p_stream );
708 p_sys->i_height = newval.i_int;
713 static int WidthCallback( vlc_object_t *p_this, char const *psz_var,
714 vlc_value_t oldval, vlc_value_t newval,
717 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
718 sout_stream_t *p_stream = (sout_stream_t *)p_data;
719 sout_stream_sys_t *p_sys = p_stream->p_sys;
721 /* We create the handler before updating the value in p_sys
722 * so we don't have to worry about locking */
723 if( !p_sys->p_image && newval.i_int )
724 p_sys->p_image = image_HandlerCreate( p_stream );
725 p_sys->i_width = newval.i_int;
730 static int alphaCallback( vlc_object_t *p_this, char const *psz_var,
731 vlc_value_t oldval, vlc_value_t newval,
734 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
735 sout_stream_t *p_stream = (sout_stream_t *)p_data;
736 sout_stream_sys_t *p_sys = p_stream->p_sys;
739 p_sys->p_es->i_alpha = newval.i_int;
744 static int xCallback( vlc_object_t *p_this, char const *psz_var,
745 vlc_value_t oldval, vlc_value_t newval,
748 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
749 sout_stream_t *p_stream = (sout_stream_t *)p_data;
750 sout_stream_sys_t *p_sys = p_stream->p_sys;
753 p_sys->p_es->i_x = newval.i_int;
758 static int yCallback( vlc_object_t *p_this, char const *psz_var,
759 vlc_value_t oldval, vlc_value_t newval,
762 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
763 sout_stream_t *p_stream = (sout_stream_t *)p_data;
764 sout_stream_sys_t *p_sys = p_stream->p_sys;
767 p_sys->p_es->i_y = newval.i_int;