Refactor: rename "sub-filter" to "sub-source" this includes capability, functions...
[vlc.git] / src / video_output / control.h
blob09325b5a599c5b3b64c5beea53c9f35dd64694ee
1 /*****************************************************************************
2 * control.h : vout internal control
3 *****************************************************************************
4 * Copyright (C) 2009-2010 Laurent Aimar
5 * $Id$
7 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_VOUT_INTERNAL_CONTROL_H
25 #define LIBVLC_VOUT_INTERNAL_CONTROL_H
27 /* */
28 enum {
29 VOUT_CONTROL_INIT,
30 VOUT_CONTROL_CLEAN,
31 VOUT_CONTROL_REINIT, /* cfg */
33 #if 0
34 /* */
35 VOUT_CONTROL_START,
36 VOUT_CONTROL_STOP,
37 #endif
38 VOUT_CONTROL_SUBPICTURE, /* subpicture */
39 VOUT_CONTROL_FLUSH_SUBPICTURE, /* integer */
40 VOUT_CONTROL_OSD_TITLE, /* string */
41 VOUT_CONTROL_CHANGE_FILTERS, /* string */
42 VOUT_CONTROL_CHANGE_SUB_SOURCES, /* string */
43 VOUT_CONTROL_CHANGE_SUB_MARGIN, /* integer */
45 VOUT_CONTROL_PAUSE,
46 VOUT_CONTROL_RESET,
47 VOUT_CONTROL_FLUSH, /* time */
48 VOUT_CONTROL_STEP, /* time_ptr */
50 VOUT_CONTROL_FULLSCREEN, /* bool */
51 VOUT_CONTROL_ON_TOP, /* bool */
52 VOUT_CONTROL_DISPLAY_FILLED, /* bool */
53 VOUT_CONTROL_ZOOM, /* pair */
55 VOUT_CONTROL_ASPECT_RATIO, /* pair */
56 VOUT_CONTROL_CROP_BORDER, /* border */
57 VOUT_CONTROL_CROP_RATIO, /* pair */
58 VOUT_CONTROL_CROP_WINDOW, /* window */
61 typedef struct {
62 int type;
64 union {
65 bool boolean;
66 mtime_t time;
67 mtime_t *time_ptr;
68 char *string;
69 int integer;
70 struct {
71 int a;
72 int b;
73 } pair;
74 struct {
75 bool is_on;
76 mtime_t date;
77 } pause;
78 struct {
79 int channel;
80 char *string;
81 } message;
82 struct {
83 unsigned left;
84 unsigned top;
85 unsigned right;
86 unsigned bottom;
87 } border;
88 struct {
89 unsigned x;
90 unsigned y;
91 unsigned width;
92 unsigned height;
93 } window;
94 const vout_configuration_t *cfg;
95 subpicture_t *subpicture;
96 } u;
97 } vout_control_cmd_t;
99 void vout_control_cmd_Init(vout_control_cmd_t *, int type);
100 void vout_control_cmd_Clean(vout_control_cmd_t *);
102 typedef struct {
103 vlc_mutex_t lock;
104 vlc_cond_t wait_request;
105 vlc_cond_t wait_acknowledge;
107 /* */
108 bool is_dead;
109 bool is_sleeping;
110 bool can_sleep;
111 bool is_processing;
112 DECL_ARRAY(vout_control_cmd_t) cmd;
113 } vout_control_t;
115 /* */
116 void vout_control_Init(vout_control_t *);
117 void vout_control_Clean(vout_control_t *);
119 /* controls outside of the vout thread */
120 void vout_control_WaitEmpty(vout_control_t *);
122 void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
123 void vout_control_PushVoid(vout_control_t *, int type);
124 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
125 void vout_control_PushInteger(vout_control_t *, int type, int integer);
126 void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
127 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
128 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
129 void vout_control_PushString(vout_control_t *, int type, const char *string);
130 void vout_control_Wake(vout_control_t *);
132 /* control inside of the vout thread */
133 int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline, mtime_t timeout);
134 void vout_control_Dead(vout_control_t *);
136 #endif