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 "../video_filter/mosaic.h"
47 /*****************************************************************************
49 *****************************************************************************/
50 struct sout_stream_sys_t
56 image_handler_t *p_image; /* filter for resizing */
57 int i_height, i_width;
58 unsigned int i_sar_num, i_sar_den;
62 int i_chroma; /* force image format chroma */
64 filter_chain_t *p_vf2;
67 struct decoder_owner_sys_t
69 /* Current format in use by the output */
73 /*****************************************************************************
75 *****************************************************************************/
76 static int Open ( vlc_object_t * );
77 static void Close ( vlc_object_t * );
78 static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
79 static int Del ( sout_stream_t *, sout_stream_id_t * );
80 static int Send( sout_stream_t *, sout_stream_id_t *, block_t * );
82 inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
83 inline static void video_del_buffer_filter( filter_t *, picture_t * );
85 inline static picture_t *video_new_buffer_decoder( decoder_t * );
86 inline static picture_t *video_new_buffer_filter( filter_t * );
87 static picture_t *video_new_buffer( vlc_object_t *, decoder_owner_sys_t *,
90 static void video_link_picture_decoder( decoder_t *, picture_t * );
91 static void video_unlink_picture_decoder( decoder_t *, picture_t * );
93 static int HeightCallback( vlc_object_t *, char const *,
94 vlc_value_t, vlc_value_t, void * );
95 static int WidthCallback( vlc_object_t *, char const *,
96 vlc_value_t, vlc_value_t, void * );
97 static int alphaCallback( vlc_object_t *, char const *,
98 vlc_value_t, vlc_value_t, void * );
99 static int xCallback( vlc_object_t *, char const *,
100 vlc_value_t, vlc_value_t, void * );
101 static int yCallback( vlc_object_t *, char const *,
102 vlc_value_t, vlc_value_t, void * );
104 /*****************************************************************************
106 *****************************************************************************/
107 #define ID_TEXT N_("ID")
108 #define ID_LONGTEXT N_( \
109 "Specify an identifier string for this subpicture" )
111 #define WIDTH_TEXT N_("Video width")
112 #define WIDTH_LONGTEXT N_( \
113 "Output video width." )
114 #define HEIGHT_TEXT N_("Video height")
115 #define HEIGHT_LONGTEXT N_( \
116 "Output video height." )
117 #define RATIO_TEXT N_("Sample aspect ratio")
118 #define RATIO_LONGTEXT N_( \
119 "Sample aspect ratio of the destination (1:1, 3:4, 2:3)." )
121 #define VFILTER_TEXT N_("Video filter")
122 #define VFILTER_LONGTEXT N_( \
123 "Video filters will be applied to the video stream." )
125 #define CHROMA_TEXT N_("Image chroma")
126 #define CHROMA_LONGTEXT N_( \
127 "Force the use of a specific chroma. Use YUVA if you're planning " \
128 "to use the Alphamask or Bluescreen video filter." )
130 #define ALPHA_TEXT N_("Transparency")
131 #define ALPHA_LONGTEXT N_( \
132 "Transparency of the mosaic picture." )
134 #define X_TEXT N_("X offset")
135 #define X_LONGTEXT N_( \
136 "X coordinate of the upper left corner in the mosaic if non negative." )
138 #define Y_TEXT N_("Y offset")
139 #define Y_LONGTEXT N_( \
140 "Y coordinate of the upper left corner in the mosaic if non negative." )
142 #define CFG_PREFIX "sout-mosaic-bridge-"
145 set_shortname( N_( "Mosaic bridge" ) )
146 set_description(N_("Mosaic bridge stream output") )
147 set_capability( "sout stream", 0 )
148 add_shortcut( "mosaic-bridge" )
150 add_string( CFG_PREFIX "id", "Id", NULL, ID_TEXT, ID_LONGTEXT,
152 add_integer( CFG_PREFIX "width", 0, NULL, WIDTH_TEXT,
153 WIDTH_LONGTEXT, true )
154 add_integer( CFG_PREFIX "height", 0, NULL, HEIGHT_TEXT,
155 HEIGHT_LONGTEXT, true )
156 add_string( CFG_PREFIX "sar", "1:1", NULL, RATIO_TEXT,
157 RATIO_LONGTEXT, false )
158 add_string( CFG_PREFIX "chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
161 add_module_list( CFG_PREFIX "vfilter", "video filter2",
162 NULL, NULL, VFILTER_TEXT, VFILTER_LONGTEXT, false )
164 add_integer_with_range( CFG_PREFIX "alpha", 255, 0, 255, NULL,
165 ALPHA_TEXT, ALPHA_LONGTEXT, false )
166 add_integer( CFG_PREFIX "x", -1, NULL, X_TEXT, X_LONGTEXT, false )
167 add_integer( CFG_PREFIX "y", -1, NULL, Y_TEXT, Y_LONGTEXT, false )
169 set_callbacks( Open, Close )
172 static const char *const ppsz_sout_options[] = {
173 "id", "width", "height", "sar", "vfilter", "chroma", "alpha", "x", "y", NULL
176 /*****************************************************************************
178 *****************************************************************************/
179 static int Open( vlc_object_t *p_this )
181 sout_stream_t *p_stream = (sout_stream_t *)p_this;
182 sout_stream_sys_t *p_sys;
183 vlc_object_t *p_libvlc = VLC_OBJECT( p_this->p_libvlc );
186 config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
189 p_sys = malloc( sizeof( sout_stream_sys_t ) );
193 p_stream->p_sys = p_sys;
194 p_sys->b_inited = false;
196 var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
197 var_Get( p_libvlc, "mosaic-lock", &val );
198 p_sys->p_lock = val.p_address;
200 p_sys->psz_id = var_CreateGetString( p_stream, CFG_PREFIX "id" );
203 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "height" );
204 var_AddCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
207 var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "width" );
208 var_AddCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
210 var_Get( p_stream, CFG_PREFIX "sar", &val );
213 char *psz_parser = strchr( val.psz_string, ':' );
217 *psz_parser++ = '\0';
218 p_sys->i_sar_num = atoi( val.psz_string );
219 p_sys->i_sar_den = atoi( psz_parser );
220 vlc_ureduce( &p_sys->i_sar_num, &p_sys->i_sar_den,
221 p_sys->i_sar_num, p_sys->i_sar_den, 0 );
225 msg_Warn( p_stream, "bad aspect ratio %s", val.psz_string );
226 p_sys->i_sar_num = p_sys->i_sar_den = 1;
229 free( val.psz_string );
233 p_sys->i_sar_num = p_sys->i_sar_den = 1;
237 val.psz_string = var_GetNonEmptyString( p_stream, CFG_PREFIX "chroma" );
238 if( val.psz_string && strlen( val.psz_string ) >= 4 )
240 memcpy( &p_sys->i_chroma, val.psz_string, 4 );
241 msg_Dbg( p_stream, "Forcing image chroma to 0x%.8x (%4.4s)", p_sys->i_chroma, (char*)&p_sys->i_chroma );
243 free( val.psz_string );
245 #define INT_COMMAND( a ) do { \
246 var_Create( p_stream, CFG_PREFIX #a, \
247 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND ); \
248 var_AddCallback( p_stream, CFG_PREFIX #a, a ## Callback, \
249 p_stream ); } while(0)
250 INT_COMMAND( alpha );
256 p_stream->pf_add = Add;
257 p_stream->pf_del = Del;
258 p_stream->pf_send = Send;
260 p_stream->p_sout->i_out_pace_nocontrol++;
265 /*****************************************************************************
267 *****************************************************************************/
268 static void Close( vlc_object_t * p_this )
270 sout_stream_t *p_stream = (sout_stream_t*)p_this;
271 sout_stream_sys_t *p_sys = p_stream->p_sys;
273 /* Delete the callbacks */
274 var_DelCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream );
275 var_DelCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream );
276 var_DelCallback( p_stream, CFG_PREFIX "alpha", alphaCallback, p_stream );
277 var_DelCallback( p_stream, CFG_PREFIX "x", xCallback, p_stream );
278 var_DelCallback( p_stream, CFG_PREFIX "y", yCallback, p_stream );
280 p_stream->p_sout->i_out_pace_nocontrol--;
282 free( p_sys->psz_id );
287 static int video_filter_buffer_allocation_init( filter_t *p_filter, void *p_data )
289 p_filter->pf_vout_buffer_new = video_new_buffer_filter;
290 p_filter->pf_vout_buffer_del = video_del_buffer_filter;
291 p_filter->p_owner = p_data;
295 static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
297 sout_stream_sys_t *p_sys = p_stream->p_sys;
303 if( p_sys->b_inited || p_fmt->i_cat != VIDEO_ES )
306 /* Create decoder object */
307 p_sys->p_decoder = vlc_object_create( p_stream, VLC_OBJECT_DECODER );
308 if( !p_sys->p_decoder )
310 vlc_object_attach( p_sys->p_decoder, p_stream );
311 p_sys->p_decoder->p_module = NULL;
312 p_sys->p_decoder->fmt_in = *p_fmt;
313 p_sys->p_decoder->b_pace_control = false;
314 p_sys->p_decoder->fmt_out = p_sys->p_decoder->fmt_in;
315 p_sys->p_decoder->fmt_out.i_extra = 0;
316 p_sys->p_decoder->fmt_out.p_extra = 0;
317 p_sys->p_decoder->pf_decode_video = 0;
318 p_sys->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
319 p_sys->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
320 p_sys->p_decoder->pf_picture_link = video_link_picture_decoder;
321 p_sys->p_decoder->pf_picture_unlink = video_unlink_picture_decoder;
322 p_sys->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
323 if( !p_sys->p_decoder->p_owner )
325 vlc_object_detach( p_sys->p_decoder );
326 vlc_object_release( p_sys->p_decoder );
330 p_sys->p_decoder->p_owner->video = p_fmt->video;
331 //p_sys->p_decoder->p_cfg = p_sys->p_video_cfg;
333 p_sys->p_decoder->p_module =
334 module_need( p_sys->p_decoder, "decoder", "$codec", false );
336 if( !p_sys->p_decoder->p_module || !p_sys->p_decoder->pf_decode_video )
338 if( p_sys->p_decoder->p_module )
340 msg_Err( p_stream, "instanciated a non video decoder" );
341 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
345 msg_Err( p_stream, "cannot find decoder" );
347 free( p_sys->p_decoder->p_owner );
348 vlc_object_detach( p_sys->p_decoder );
349 vlc_object_release( p_sys->p_decoder );
353 p_sys->b_inited = true;
354 vlc_mutex_lock( p_sys->p_lock );
356 p_bridge = GetBridge( p_stream );
357 if ( p_bridge == NULL )
359 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
362 p_bridge = xmalloc( sizeof( bridge_t ) );
364 var_Create( p_libvlc, "mosaic-struct", VLC_VAR_ADDRESS );
365 val.p_address = p_bridge;
366 var_Set( p_libvlc, "mosaic-struct", val );
368 p_bridge->i_es_num = 0;
369 p_bridge->pp_es = NULL;
372 for ( i = 0; i < p_bridge->i_es_num; i++ )
374 if ( p_bridge->pp_es[i]->b_empty )
378 if ( i == p_bridge->i_es_num )
380 p_bridge->pp_es = xrealloc( p_bridge->pp_es,
381 (p_bridge->i_es_num + 1) * sizeof(bridged_es_t *) );
382 p_bridge->i_es_num++;
383 p_bridge->pp_es[i] = xmalloc( sizeof(bridged_es_t) );
386 p_sys->p_es = p_es = p_bridge->pp_es[i];
388 p_es->i_alpha = var_GetInteger( p_stream, CFG_PREFIX "alpha" );
389 p_es->i_x = var_GetInteger( p_stream, CFG_PREFIX "x" );
390 p_es->i_y = var_GetInteger( p_stream, CFG_PREFIX "y" );
392 //p_es->fmt = *p_fmt;
393 p_es->psz_id = p_sys->psz_id;
394 p_es->p_picture = NULL;
395 p_es->pp_last = &p_es->p_picture;
396 p_es->b_empty = false;
398 vlc_mutex_unlock( p_sys->p_lock );
400 if ( p_sys->i_height || p_sys->i_width )
402 p_sys->p_image = image_HandlerCreate( p_stream );
406 p_sys->p_image = NULL;
409 msg_Dbg( p_stream, "mosaic bridge id=%s pos=%d", p_es->psz_id, i );
411 /* Create user specified video filters */
412 psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
413 msg_Dbg( p_stream, "psz_chain: %s", psz_chain );
416 p_sys->p_vf2 = filter_chain_New( p_stream, "video filter2", false,
417 video_filter_buffer_allocation_init,
418 NULL, p_sys->p_decoder->p_owner );
420 es_format_Copy( &fmt, &p_sys->p_decoder->fmt_out );
421 if( p_sys->i_chroma )
422 fmt.video.i_chroma = p_sys->i_chroma;
423 filter_chain_Reset( p_sys->p_vf2, &fmt, &fmt );
424 filter_chain_AppendFromString( p_sys->p_vf2, psz_chain );
432 return (sout_stream_id_t *)p_sys;
435 static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
438 sout_stream_sys_t *p_sys = p_stream->p_sys;
441 bool b_last_es = true;
444 if( !p_sys->b_inited )
447 if( p_sys->p_decoder != NULL )
449 decoder_owner_sys_t *p_owner = p_sys->p_decoder->p_owner;
451 if( p_sys->p_decoder->p_module )
452 module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
453 if( p_sys->p_decoder->p_description )
454 vlc_meta_Delete( p_sys->p_decoder->p_description );
456 vlc_object_detach( p_sys->p_decoder );
457 vlc_object_release( p_sys->p_decoder );
462 /* Destroy user specified video filters */
464 filter_chain_Delete( p_sys->p_vf2 );
466 vlc_mutex_lock( p_sys->p_lock );
468 p_bridge = GetBridge( p_stream );
471 p_es->b_empty = true;
472 while ( p_es->p_picture )
474 picture_t *p_next = p_es->p_picture->p_next;
475 picture_Release( p_es->p_picture );
476 p_es->p_picture = p_next;
479 for ( i = 0; i < p_bridge->i_es_num; i++ )
481 if ( !p_bridge->pp_es[i]->b_empty )
490 vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
491 for ( i = 0; i < p_bridge->i_es_num; i++ )
492 free( p_bridge->pp_es[i] );
493 free( p_bridge->pp_es );
495 var_Destroy( p_libvlc, "mosaic-struct" );
498 vlc_mutex_unlock( p_sys->p_lock );
500 if ( p_sys->p_image )
502 image_HandlerDelete( p_sys->p_image );
505 p_sys->b_inited = false;
510 /*****************************************************************************
511 * PushPicture : push a picture in the mosaic-struct structure
512 *****************************************************************************/
513 static void PushPicture( sout_stream_t *p_stream, picture_t *p_picture )
515 sout_stream_sys_t *p_sys = p_stream->p_sys;
516 bridged_es_t *p_es = p_sys->p_es;
518 vlc_mutex_lock( p_sys->p_lock );
520 *p_es->pp_last = p_picture;
521 p_picture->p_next = NULL;
522 p_es->pp_last = &p_picture->p_next;
524 vlc_mutex_unlock( p_sys->p_lock );
527 static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
530 sout_stream_sys_t *p_sys = p_stream->p_sys;
533 if ( (sout_stream_sys_t *)id != p_sys )
535 block_ChainRelease( p_buffer );
539 while ( (p_pic = p_sys->p_decoder->pf_decode_video( p_sys->p_decoder,
542 picture_t *p_new_pic;
544 if( p_sys->i_height || p_sys->i_width )
546 video_format_t fmt_out, fmt_in;
548 memset( &fmt_in, 0, sizeof(video_format_t) );
549 memset( &fmt_out, 0, sizeof(video_format_t) );
550 fmt_in = p_sys->p_decoder->fmt_out.video;
553 if( p_sys->i_chroma )
554 fmt_out.i_chroma = p_sys->i_chroma;
556 fmt_out.i_chroma = VLC_CODEC_I420;
558 const unsigned i_fmt_in_aspect =
559 (int64_t)VOUT_ASPECT_FACTOR *
560 fmt_in.i_sar_num * fmt_in.i_width /
561 (fmt_in.i_sar_den * fmt_in.i_height);
562 if ( !p_sys->i_height )
564 fmt_out.i_width = p_sys->i_width;
565 fmt_out.i_height = (p_sys->i_width * VOUT_ASPECT_FACTOR
566 * p_sys->i_sar_num / p_sys->i_sar_den / i_fmt_in_aspect)
569 else if ( !p_sys->i_width )
571 fmt_out.i_height = p_sys->i_height;
572 fmt_out.i_width = (p_sys->i_height * i_fmt_in_aspect
573 * p_sys->i_sar_den / p_sys->i_sar_num / VOUT_ASPECT_FACTOR)
578 fmt_out.i_width = p_sys->i_width;
579 fmt_out.i_height = p_sys->i_height;
581 fmt_out.i_visible_width = fmt_out.i_width;
582 fmt_out.i_visible_height = fmt_out.i_height;
584 p_new_pic = image_Convert( p_sys->p_image,
585 p_pic, &fmt_in, &fmt_out );
586 if( p_new_pic == NULL )
588 msg_Err( p_stream, "image conversion failed" );
589 picture_Release( p_pic );
595 /* TODO: chroma conversion if needed */
597 p_new_pic = picture_New( p_pic->format.i_chroma,
598 p_pic->format.i_width, p_pic->format.i_height,
599 p_sys->p_decoder->fmt_out.video.i_sar_num,
600 p_sys->p_decoder->fmt_out.video.i_sar_den );
603 picture_Release( p_pic );
604 msg_Err( p_stream, "image allocation failed" );
608 picture_Copy( p_new_pic, p_pic );
610 picture_Release( p_pic );
613 p_new_pic = filter_chain_VideoFilter( p_sys->p_vf2, p_new_pic );
615 PushPicture( p_stream, p_new_pic );
621 inline static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
623 return video_new_buffer( VLC_OBJECT( p_dec ),
624 (decoder_owner_sys_t *)p_dec->p_owner,
628 inline static picture_t *video_new_buffer_filter( filter_t *p_filter )
630 return video_new_buffer( VLC_OBJECT( p_filter ),
631 (decoder_owner_sys_t *)p_filter->p_owner,
632 &p_filter->fmt_out );
635 static picture_t *video_new_buffer( vlc_object_t *p_this,
636 decoder_owner_sys_t *p_sys,
637 es_format_t *fmt_out )
640 if( fmt_out->video.i_width != p_sys->video.i_width ||
641 fmt_out->video.i_height != p_sys->video.i_height ||
642 fmt_out->video.i_chroma != p_sys->video.i_chroma ||
643 (int64_t)fmt_out->video.i_sar_num * p_sys->video.i_sar_den !=
644 (int64_t)fmt_out->video.i_sar_den * p_sys->video.i_sar_num )
646 vlc_ureduce( &fmt_out->video.i_sar_num,
647 &fmt_out->video.i_sar_den,
648 fmt_out->video.i_sar_num,
649 fmt_out->video.i_sar_den, 0 );
651 if( !fmt_out->video.i_visible_width ||
652 !fmt_out->video.i_visible_height )
654 fmt_out->video.i_visible_width = fmt_out->video.i_width;
655 fmt_out->video.i_visible_height = fmt_out->video.i_height;
658 fmt_out->video.i_chroma = fmt_out->i_codec;
659 p_sys->video = fmt_out->video;
663 fmt_out->video.i_chroma = fmt_out->i_codec;
665 return picture_NewFromFormat( &fmt_out->video );
668 inline static void video_del_buffer_decoder( decoder_t *p_this,
672 picture_Release( p_pic );
675 inline static void video_del_buffer_filter( filter_t *p_this,
679 picture_Release( p_pic );
682 static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
685 picture_Hold( p_pic );
688 static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
691 picture_Release( p_pic );
695 /**********************************************************************
696 * Callback to update (some) params on the fly
697 **********************************************************************/
698 static int HeightCallback( vlc_object_t *p_this, char const *psz_var,
699 vlc_value_t oldval, vlc_value_t newval,
702 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
703 sout_stream_t *p_stream = (sout_stream_t *)p_data;
704 sout_stream_sys_t *p_sys = p_stream->p_sys;
706 /* We create the handler before updating the value in p_sys
707 * so we don't have to worry about locking */
708 if( !p_sys->p_image && newval.i_int )
709 p_sys->p_image = image_HandlerCreate( p_stream );
710 p_sys->i_height = newval.i_int;
715 static int WidthCallback( vlc_object_t *p_this, char const *psz_var,
716 vlc_value_t oldval, vlc_value_t newval,
719 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
720 sout_stream_t *p_stream = (sout_stream_t *)p_data;
721 sout_stream_sys_t *p_sys = p_stream->p_sys;
723 /* We create the handler before updating the value in p_sys
724 * so we don't have to worry about locking */
725 if( !p_sys->p_image && newval.i_int )
726 p_sys->p_image = image_HandlerCreate( p_stream );
727 p_sys->i_width = newval.i_int;
732 static int alphaCallback( vlc_object_t *p_this, char const *psz_var,
733 vlc_value_t oldval, vlc_value_t newval,
736 VLC_UNUSED(p_this); VLC_UNUSED(oldval); VLC_UNUSED(psz_var);
737 sout_stream_t *p_stream = (sout_stream_t *)p_data;
738 sout_stream_sys_t *p_sys = p_stream->p_sys;
741 p_sys->p_es->i_alpha = newval.i_int;
746 static int xCallback( 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_x = newval.i_int;
760 static int yCallback( 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_y = newval.i_int;