contrib: protobuf: Require version 3.1.0+
[vlc.git] / src / video_output / vout_intf.c
blob14d0c03c5c19db1e674b5512e9b2840c0940355e
1 /*****************************************************************************
2 * vout_intf.c : video output interface
3 *****************************************************************************
4 * Copyright (C) 2000-2007 VLC authors and VideoLAN
6 * Authors: Gildas Bazin <gbazin@videolan.org>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 /*****************************************************************************
24 * Preamble
25 *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc_common.h>
33 #include <stdio.h>
34 #include <stdlib.h> /* free() */
35 #include <assert.h>
37 #include <vlc_block.h>
38 #include <vlc_modules.h>
40 #include <vlc_vout.h>
41 #include <vlc_vout_osd.h>
42 #include <vlc_strings.h>
43 #include <vlc_charset.h>
44 #include "vout_internal.h"
46 /*****************************************************************************
47 * Local prototypes
48 *****************************************************************************/
49 /* Object variables callbacks */
50 static int CropCallback( vlc_object_t *, char const *,
51 vlc_value_t, vlc_value_t, void * );
52 static int CropBorderCallback( vlc_object_t *, char const *,
53 vlc_value_t, vlc_value_t, void * );
54 static int AspectCallback( vlc_object_t *, char const *,
55 vlc_value_t, vlc_value_t, void * );
56 static int AutoScaleCallback( vlc_object_t *, char const *,
57 vlc_value_t, vlc_value_t, void * );
58 static int ZoomCallback( vlc_object_t *, char const *,
59 vlc_value_t, vlc_value_t, void * );
60 static int AboveCallback( vlc_object_t *, char const *,
61 vlc_value_t, vlc_value_t, void * );
62 static int WallPaperCallback( vlc_object_t *, char const *,
63 vlc_value_t, vlc_value_t, void * );
64 static int FullscreenCallback( vlc_object_t *, char const *,
65 vlc_value_t, vlc_value_t, void * );
66 static int SnapshotCallback( vlc_object_t *, char const *,
67 vlc_value_t, vlc_value_t, void * );
68 static int VideoFilterCallback( vlc_object_t *, char const *,
69 vlc_value_t, vlc_value_t, void * );
70 static int SubSourceCallback( vlc_object_t *, char const *,
71 vlc_value_t, vlc_value_t, void * );
72 static int SubFilterCallback( vlc_object_t *, char const *,
73 vlc_value_t, vlc_value_t, void * );
74 static int SubMarginCallback( vlc_object_t *, char const *,
75 vlc_value_t, vlc_value_t, void * );
76 static int ViewpointCallback( vlc_object_t *, char const *,
77 vlc_value_t, vlc_value_t, void * );
79 /*****************************************************************************
80 * vout_IntfInit: called during the vout creation to initialise misc things.
81 *****************************************************************************/
82 static const struct
84 double f_value;
85 char psz_label[13];
86 } p_zoom_values[] = {
87 { 0.25, N_("1:4 Quarter") },
88 { 0.5, N_("1:2 Half") },
89 { 1, N_("1:1 Original") },
90 { 2, N_("2:1 Double") },
93 static const struct
95 char psz_value[8];
96 char psz_label[8];
97 } p_crop_values[] = {
98 { "", N_("Default") },
99 { "16:10", "16:10" },
100 { "16:9", "16:9" },
101 { "4:3", "4:3" },
102 { "185:100", "1.85:1" },
103 { "221:100", "2.21:1" },
104 { "235:100", "2.35:1" },
105 { "239:100", "2.39:1" },
106 { "5:3", "5:3" },
107 { "5:4", "5:4" },
108 { "1:1", "1:1" },
111 static const struct
113 char psz_value[8];
114 char psz_label[8];
115 } p_aspect_ratio_values[] = {
116 { "", N_("Default") },
117 { "16:9", "16:9" },
118 { "4:3", "4:3" },
119 { "1:1", "1:1" },
120 { "16:10", "16:10" },
121 { "221:100", "2.21:1" },
122 { "235:100", "2.35:1" },
123 { "239:100", "2.39:1" },
124 { "5:4", "5:4" },
127 static void AddCustomRatios( vout_thread_t *p_vout, const char *psz_var,
128 char *psz_list )
130 assert( psz_list );
132 char *psz_cur = psz_list;
133 char *psz_next;
134 while( psz_cur && *psz_cur )
136 vlc_value_t val, text;
137 psz_next = strchr( psz_cur, ',' );
138 if( psz_next )
140 *psz_next = '\0';
141 psz_next++;
143 val.psz_string = psz_cur;
144 text.psz_string = psz_cur;
145 var_Change( p_vout, psz_var, VLC_VAR_ADDCHOICE, &val, &text);
146 psz_cur = psz_next;
150 void vout_IntfInit( vout_thread_t *p_vout )
152 vlc_value_t val, text;
153 char *psz_buf;
155 /* Create a few object variables we'll need later on */
156 var_Create( p_vout, "snapshot-num", VLC_VAR_INTEGER );
157 var_SetInteger( p_vout, "snapshot-num", 1 );
159 var_Create( p_vout, "width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
160 var_Create( p_vout, "height", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
161 var_Create( p_vout, "align", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
163 var_Create( p_vout, "mouse-hide-timeout",
164 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
166 /* Add variables to manage scaling video */
167 var_Create( p_vout, "autoscale", VLC_VAR_BOOL | VLC_VAR_DOINHERIT
168 | VLC_VAR_ISCOMMAND );
169 text.psz_string = _("Autoscale video");
170 var_Change( p_vout, "autoscale", VLC_VAR_SETTEXT, &text, NULL );
171 var_AddCallback( p_vout, "autoscale", AutoScaleCallback, NULL );
173 var_Create( p_vout, "zoom", VLC_VAR_FLOAT | VLC_VAR_ISCOMMAND |
174 VLC_VAR_DOINHERIT );
176 text.psz_string = _("Zoom");
177 var_Change( p_vout, "zoom", VLC_VAR_SETTEXT, &text, NULL );
179 for( size_t i = 0; i < ARRAY_SIZE(p_zoom_values); i++ )
181 val.f_float = p_zoom_values[i].f_value;
182 text.psz_string = vlc_gettext( p_zoom_values[i].psz_label );
183 var_Change( p_vout, "zoom", VLC_VAR_ADDCHOICE, &val, &text );
186 var_AddCallback( p_vout, "zoom", ZoomCallback, NULL );
188 /* Crop offset vars */
189 var_Create( p_vout, "crop-left", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
190 var_Create( p_vout, "crop-top", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
191 var_Create( p_vout, "crop-right", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
192 var_Create( p_vout, "crop-bottom", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
194 var_AddCallback( p_vout, "crop-left", CropBorderCallback, NULL );
195 var_AddCallback( p_vout, "crop-top", CropBorderCallback, NULL );
196 var_AddCallback( p_vout, "crop-right", CropBorderCallback, NULL );
197 var_AddCallback( p_vout, "crop-bottom", CropBorderCallback, NULL );
199 /* Crop object var */
200 var_Create( p_vout, "crop", VLC_VAR_STRING | VLC_VAR_ISCOMMAND |
201 VLC_VAR_DOINHERIT );
203 text.psz_string = _("Crop");
204 var_Change( p_vout, "crop", VLC_VAR_SETTEXT, &text, NULL );
206 for( size_t i = 0; i < ARRAY_SIZE(p_crop_values); i++ )
208 val.psz_string = (char*)p_crop_values[i].psz_value;
209 text.psz_string = _( p_crop_values[i].psz_label );
210 var_Change( p_vout, "crop", VLC_VAR_ADDCHOICE, &val, &text );
213 /* Add custom crop ratios */
214 psz_buf = var_CreateGetNonEmptyString( p_vout, "custom-crop-ratios" );
215 if( psz_buf )
217 AddCustomRatios( p_vout, "crop", psz_buf );
218 free( psz_buf );
221 var_AddCallback( p_vout, "crop", CropCallback, NULL );
223 /* Monitor pixel aspect-ratio */
224 var_Create( p_vout, "monitor-par", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
226 /* Aspect-ratio object var */
227 var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING | VLC_VAR_ISCOMMAND |
228 VLC_VAR_DOINHERIT );
230 text.psz_string = _("Aspect ratio");
231 var_Change( p_vout, "aspect-ratio", VLC_VAR_SETTEXT, &text, NULL );
233 for( size_t i = 0; i < ARRAY_SIZE(p_aspect_ratio_values); i++ )
235 val.psz_string = (char*)p_aspect_ratio_values[i].psz_value;
236 text.psz_string = _( p_aspect_ratio_values[i].psz_label );
237 var_Change( p_vout, "aspect-ratio", VLC_VAR_ADDCHOICE, &val, &text );
240 /* Add custom aspect ratios */
241 psz_buf = var_CreateGetNonEmptyString( p_vout, "custom-aspect-ratios" );
242 if( psz_buf )
244 AddCustomRatios( p_vout, "aspect-ratio", psz_buf );
245 free( psz_buf );
248 var_AddCallback( p_vout, "aspect-ratio", AspectCallback, NULL );
250 /* Add a variable to indicate if the window should be on top of others */
251 var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT
252 | VLC_VAR_ISCOMMAND );
253 text.psz_string = _("Always on top");
254 var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL );
255 var_AddCallback( p_vout, "video-on-top", AboveCallback, NULL );
257 /* Add a variable to indicate if the window should be below all others */
258 var_Create( p_vout, "video-wallpaper", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
259 var_AddCallback( p_vout, "video-wallpaper", WallPaperCallback,
260 (void *)(uintptr_t)VOUT_WINDOW_STATE_BELOW );
262 /* Add a variable to indicate whether we want window decoration or not */
263 var_Create( p_vout, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
265 /* Add a fullscreen variable */
266 var_Create( p_vout, "fullscreen",
267 VLC_VAR_BOOL | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
268 text.psz_string = _("Fullscreen");
269 var_Change( p_vout, "fullscreen", VLC_VAR_SETTEXT, &text, NULL );
270 var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL );
272 /* Add a snapshot variable */
273 var_Create( p_vout, "video-snapshot", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
274 text.psz_string = _("Snapshot");
275 var_Change( p_vout, "video-snapshot", VLC_VAR_SETTEXT, &text, NULL );
276 var_AddCallback( p_vout, "video-snapshot", SnapshotCallback, NULL );
278 /* Add a video-filter variable */
279 var_Create( p_vout, "video-filter",
280 VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
281 var_AddCallback( p_vout, "video-filter", VideoFilterCallback, NULL );
283 /* Add a sub-source variable */
284 var_Create( p_vout, "sub-source",
285 VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
286 var_AddCallback( p_vout, "sub-source", SubSourceCallback, NULL );
288 /* Add a sub-filter variable */
289 var_Create( p_vout, "sub-filter",
290 VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
291 var_AddCallback( p_vout, "sub-filter", SubFilterCallback, NULL );
293 /* Add sub-margin variable */
294 var_Create( p_vout, "sub-margin",
295 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
296 var_AddCallback( p_vout, "sub-margin", SubMarginCallback, NULL );
298 /* Mouse coordinates */
299 var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
300 var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );
301 var_Create( p_vout, "mouse-clicked", VLC_VAR_COORDS );
303 /* Device orientation */
304 var_Create( p_vout, "viewpoint-moved", VLC_VAR_ADDRESS );
306 /* Viewpoint */
307 var_Create( p_vout, "viewpoint", VLC_VAR_ADDRESS );
308 var_AddCallback( p_vout, "viewpoint", ViewpointCallback, NULL );
309 var_Create( p_vout, "viewpoint-changeable", VLC_VAR_BOOL );
311 vout_IntfReinit( p_vout );
314 void vout_IntfReinit( vout_thread_t *p_vout )
316 var_TriggerCallback( p_vout, "zoom" );
317 var_TriggerCallback( p_vout, "crop" );
318 var_TriggerCallback( p_vout, "aspect-ratio" );
320 var_TriggerCallback( p_vout, "video-on-top" );
321 var_TriggerCallback( p_vout, "video-wallpaper" );
323 var_TriggerCallback( p_vout, "video-filter" );
324 var_TriggerCallback( p_vout, "sub-source" );
325 var_TriggerCallback( p_vout, "sub-filter" );
326 var_TriggerCallback( p_vout, "sub-margin" );
329 /*****************************************************************************
330 * vout_Snapshot: generates a snapshot.
331 *****************************************************************************/
333 * This function will inject a subpicture into the vout with the provided
334 * picture
336 static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic )
338 subpicture_t *p_subpic = subpicture_NewFromPicture( VLC_OBJECT(p_vout),
339 p_pic, VLC_CODEC_YUVA );
340 if( !p_subpic )
341 return VLC_EGENERIC;
343 /* FIXME SPU_DEFAULT_CHANNEL is not good (used by the text) but
344 * hardcoded 0 doesn't seem right */
345 p_subpic->i_channel = 0;
346 p_subpic->i_start = mdate();
347 p_subpic->i_stop = p_subpic->i_start + 4000000;
348 p_subpic->b_ephemer = true;
349 p_subpic->b_fade = true;
351 /* Reduce the picture to 1/4^2 of the screen */
352 p_subpic->i_original_picture_width *= 4;
353 p_subpic->i_original_picture_height *= 4;
355 vout_PutSubpicture( p_vout, p_subpic );
356 return VLC_SUCCESS;
360 * This function will display the name and a PIP of the provided snapshot
362 static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char *psz_filename )
364 msg_Dbg( p_vout, "snapshot taken (%s)", psz_filename );
365 vout_OSDMessage( p_vout, VOUT_SPU_CHANNEL_OSD, "%s", psz_filename );
367 if( var_InheritBool( p_vout, "snapshot-preview" ) )
369 if( VoutSnapshotPip( p_vout, p_pic ) )
370 msg_Warn( p_vout, "Failed to display snapshot" );
375 * This function will handle a snapshot request
377 static void VoutSaveSnapshot( vout_thread_t *p_vout )
379 char *psz_path = var_InheritString( p_vout, "snapshot-path" );
380 char *psz_format = var_InheritString( p_vout, "snapshot-format" );
381 char *psz_prefix = var_InheritString( p_vout, "snapshot-prefix" );
383 /* */
384 picture_t *p_picture;
385 block_t *p_image;
387 /* 500ms timeout
388 * XXX it will cause trouble with low fps video (< 2fps) */
389 if( vout_GetSnapshot( p_vout, &p_image, &p_picture, NULL, psz_format, 500*1000 ) )
391 p_picture = NULL;
392 p_image = NULL;
393 goto exit;
396 if( !psz_path )
398 psz_path = vout_snapshot_GetDirectory();
399 if( !psz_path )
401 msg_Err( p_vout, "no path specified for snapshots" );
402 goto exit;
406 vout_snapshot_save_cfg_t cfg;
407 memset( &cfg, 0, sizeof(cfg) );
408 cfg.is_sequential = var_InheritBool( p_vout, "snapshot-sequential" );
409 cfg.sequence = var_GetInteger( p_vout, "snapshot-num" );
410 cfg.path = psz_path;
411 cfg.format = psz_format;
412 cfg.prefix_fmt = psz_prefix;
414 char *psz_filename;
415 int i_sequence;
416 if (vout_snapshot_SaveImage( &psz_filename, &i_sequence,
417 p_image, p_vout, &cfg ) )
418 goto exit;
419 if( cfg.is_sequential )
420 var_SetInteger( p_vout, "snapshot-num", i_sequence + 1 );
422 VoutOsdSnapshot( p_vout, p_picture, psz_filename );
424 /* signal creation of a new snapshot file */
425 var_SetString( p_vout->obj.libvlc, "snapshot-file", psz_filename );
427 free( psz_filename );
429 exit:
430 if( p_image )
431 block_Release( p_image );
432 if( p_picture )
433 picture_Release( p_picture );
434 free( psz_prefix );
435 free( psz_format );
436 free( psz_path );
439 /*****************************************************************************
440 * Object variables callbacks
441 *****************************************************************************/
442 static int CropCallback( vlc_object_t *object, char const *cmd,
443 vlc_value_t oldval, vlc_value_t newval, void *data )
445 vout_thread_t *vout = (vout_thread_t *)object;
446 VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data);
447 unsigned num, den;
448 unsigned y, x;
449 unsigned width, height;
450 unsigned left, top, right, bottom;
452 if (sscanf(newval.psz_string, "%u:%u", &num, &den) == 2) {
453 vout_ControlChangeCropRatio(vout, num, den);
454 } else if (sscanf(newval.psz_string, "%ux%u+%u+%u",
455 &width, &height, &x, &y) == 4) {
456 vout_ControlChangeCropWindow(vout, x, y, width, height);
457 } else if (sscanf(newval.psz_string, "%u+%u+%u+%u",
458 &left, &top, &right, &bottom) == 4) {
459 vout_ControlChangeCropBorder(vout, left, top, right, bottom);
460 } else if (*newval.psz_string == '\0') {
461 vout_ControlChangeCropRatio(vout, 0, 0);
462 } else {
463 msg_Err(object, "Unknown crop format (%s)", newval.psz_string);
465 return VLC_SUCCESS;
468 static int CropBorderCallback(vlc_object_t *object, char const *cmd,
469 vlc_value_t oldval, vlc_value_t newval, void *data)
471 char buf[4 * 21];
473 snprintf(buf, sizeof (buf), "%"PRIu64"+%"PRIu64"+%"PRIu64"+%"PRIu64,
474 var_GetInteger(object, "crop-left"),
475 var_GetInteger(object, "crop-top"),
476 var_GetInteger(object, "crop-right"),
477 var_GetInteger(object, "crop-bottom"));
478 var_SetString(object, "crop", buf);
480 VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data); VLC_UNUSED(newval);
481 return VLC_SUCCESS;
484 static int AspectCallback( vlc_object_t *object, char const *cmd,
485 vlc_value_t oldval, vlc_value_t newval, void *data )
487 vout_thread_t *vout = (vout_thread_t *)object;
488 VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data);
489 unsigned num, den;
491 if (sscanf(newval.psz_string, "%u:%u", &num, &den) == 2 &&
492 (num != 0) == (den != 0))
493 vout_ControlChangeSampleAspectRatio(vout, num, den);
494 else if (*newval.psz_string == '\0')
495 vout_ControlChangeSampleAspectRatio(vout, 0, 0);
496 return VLC_SUCCESS;
499 static int AutoScaleCallback( vlc_object_t *obj, char const *name,
500 vlc_value_t prev, vlc_value_t cur, void *data )
502 vout_thread_t *p_vout = (vout_thread_t *)obj;
504 (void) name; (void) prev; (void) data;
505 vout_ControlChangeDisplayFilled( p_vout, cur.b_bool );
506 return VLC_SUCCESS;
509 static int ZoomCallback( vlc_object_t *obj, char const *name,
510 vlc_value_t prev, vlc_value_t cur, void *data )
512 vout_thread_t *p_vout = (vout_thread_t *)obj;
514 (void) name; (void) prev; (void) data;
515 vout_ControlChangeZoom( p_vout, 1000 * cur.f_float, 1000 );
516 return VLC_SUCCESS;
519 static int AboveCallback( vlc_object_t *obj, char const *name,
520 vlc_value_t prev, vlc_value_t cur, void *data )
522 vout_ControlChangeWindowState( (vout_thread_t *)obj,
523 cur.b_bool ? VOUT_WINDOW_STATE_ABOVE : VOUT_WINDOW_STATE_NORMAL );
524 (void) name; (void) prev; (void) data;
525 return VLC_SUCCESS;
528 static int WallPaperCallback( vlc_object_t *obj, char const *name,
529 vlc_value_t prev, vlc_value_t cur, void *data )
531 vout_thread_t *vout = (vout_thread_t *)obj;
533 if( cur.b_bool )
535 vout_ControlChangeWindowState( vout, VOUT_WINDOW_STATE_BELOW );
536 vout_ControlChangeFullscreen( vout, true );
538 else
540 var_TriggerCallback( obj, "fullscreen" );
541 var_TriggerCallback( obj, "video-on-top" );
543 (void) name; (void) prev; (void) data;
544 return VLC_SUCCESS;
547 static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
548 vlc_value_t oldval, vlc_value_t newval, void *p_data )
550 vout_thread_t *p_vout = (vout_thread_t *)p_this;
551 (void)psz_cmd; (void)p_data;
553 if( oldval.b_bool != newval.b_bool )
554 vout_ControlChangeFullscreen( p_vout, newval.b_bool );
555 return VLC_SUCCESS;
558 static int SnapshotCallback( vlc_object_t *p_this, char const *psz_cmd,
559 vlc_value_t oldval, vlc_value_t newval, void *p_data )
561 vout_thread_t *p_vout = (vout_thread_t *)p_this;
562 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
563 VLC_UNUSED(newval); VLC_UNUSED(p_data);
565 VoutSaveSnapshot( p_vout );
566 return VLC_SUCCESS;
569 static int VideoFilterCallback( vlc_object_t *p_this, char const *psz_cmd,
570 vlc_value_t oldval, vlc_value_t newval, void *p_data)
572 vout_thread_t *p_vout = (vout_thread_t *)p_this;
573 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
575 vout_ControlChangeFilters( p_vout, newval.psz_string );
576 return VLC_SUCCESS;
579 static int SubSourceCallback( vlc_object_t *p_this, char const *psz_cmd,
580 vlc_value_t oldval, vlc_value_t newval, void *p_data)
582 vout_thread_t *p_vout = (vout_thread_t *)p_this;
583 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
585 vout_ControlChangeSubSources( p_vout, newval.psz_string );
586 return VLC_SUCCESS;
589 static int SubFilterCallback( vlc_object_t *p_this, char const *psz_cmd,
590 vlc_value_t oldval, vlc_value_t newval, void *p_data)
592 vout_thread_t *p_vout = (vout_thread_t *)p_this;
593 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
595 vout_ControlChangeSubFilters( p_vout, newval.psz_string );
596 return VLC_SUCCESS;
599 static int SubMarginCallback( vlc_object_t *p_this, char const *psz_cmd,
600 vlc_value_t oldval, vlc_value_t newval, void *p_data)
602 vout_thread_t *p_vout = (vout_thread_t *)p_this;
603 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
605 vout_ControlChangeSubMargin( p_vout, newval.i_int );
606 return VLC_SUCCESS;
609 static int ViewpointCallback( vlc_object_t *p_this, char const *psz_cmd,
610 vlc_value_t oldval, vlc_value_t newval, void *p_data)
612 vout_thread_t *p_vout = (vout_thread_t *)p_this;
613 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
615 if( newval.p_address != NULL )
616 vout_ControlChangeViewpoint( p_vout, newval.p_address );
617 return VLC_SUCCESS;