]> git.sesse.net Git - vlc/blob - src/video_output/control.h
Removed unused "intf-change" vout variable.
[vlc] / src / video_output / control.h
1 /*****************************************************************************
2  * control.h : vout internal control
3  *****************************************************************************
4  * Copyright (C) 2009-2010 Laurent Aimar
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
25 # error This header file can only be included from LibVLC.
26 #endif
27
28 #ifndef _VOUT_INTERNAL_CONTROL_H
29 #define _VOUT_INTERNAL_CONTROL_H
30
31 /* */
32 enum {
33 #if 0
34     VOUT_CONTROL_INIT,
35     VOUT_CONTROL_EXIT,
36
37     /* */
38     VOUT_CONTROL_START,
39     VOUT_CONTROL_STOP,
40
41     /* Controls */
42     VOUT_CONTROL_FULLSCREEN,
43     VOUT_CONTROL_DISPLAY_FILLED,
44     VOUT_CONTROL_ZOOM,
45     VOUT_CONTROL_ON_TOP,
46
47     VOUT_CONTROL_SOURCE_ASPECT,
48     VOUT_CONTROL_SOURCE_CROP_BORDER,
49     VOUT_CONTROL_SOURCE_CROP_RATIO,
50     VOUT_CONTROL_SOURCE_CROP_WINDOW,
51
52     /* OSD */
53     VOUT_CONTROL_OSD_MESSAGE,
54     VOUT_CONTROL_OSD_TEXT,
55     VOUT_CONTROL_OSD_SLIDER,
56     VOUT_CONTROL_OSD_ICON,
57     VOUT_CONTROL_OSD_SUBPICTURE,
58 #endif
59     VOUT_CONTROL_OSD_TITLE,             /* string */
60     VOUT_CONTROL_CHANGE_FILTERS,        /* string */
61
62     VOUT_CONTROL_PAUSE,
63     VOUT_CONTROL_RESET,
64     VOUT_CONTROL_FLUSH,                 /* time */
65     VOUT_CONTROL_STEP,                  /* time_ptr */
66 };
67
68 typedef struct {
69     int type;
70
71     union {
72         bool    boolean;
73         mtime_t time;
74         mtime_t *time_ptr;
75         char    *string;
76         struct {
77             int a;
78             int b;
79         } pair;
80         struct {
81             bool is_on;
82             mtime_t date;
83         } pause;
84         struct {
85             int channel;
86             char *string;
87         } message;
88 #if 0
89         struct {
90             int channel;
91             char *string;
92             text_style_t *style;
93             int flags;
94             int hmargin;
95             int vmargin;
96             mtime_t start;
97             mtime_t stop;
98         } text;
99         struct {
100             unsigned left;
101             unsigned top;
102             unsigned right;
103             unsigned bottom;
104         } border;
105         struct {
106             unsigned x;
107             unsigned y;
108             unsigned width;
109             unsigned height;
110         } window;
111         struct {
112             int   channel;
113             int   type;
114             float position;
115         } slider;
116         struct {
117             int channel;
118             int icon;
119         } icon;
120         subpicture_t *subpicture;
121 #endif
122     } u;
123 } vout_control_cmd_t;
124
125 void vout_control_cmd_Init(vout_control_cmd_t *, int type);
126 void vout_control_cmd_Clean(vout_control_cmd_t *);
127
128 typedef struct {
129     vlc_mutex_t lock;
130     vlc_cond_t  wait_request;
131     vlc_cond_t  wait_acknowledge;
132
133     /* */
134     bool is_dead;
135     bool is_sleeping;
136     bool can_sleep;
137     bool is_processing;
138     DECL_ARRAY(vout_control_cmd_t) cmd;
139 } vout_control_t;
140
141 /* */
142 void vout_control_Init(vout_control_t *);
143 void vout_control_Clean(vout_control_t *);
144
145 /* controls outside of the vout thread */
146 void vout_control_WaitEmpty(vout_control_t *);
147
148 void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
149 void vout_control_PushVoid(vout_control_t *, int type);
150 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
151 void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
152 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
153 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
154 void vout_control_PushString(vout_control_t *, int type, const char *string);
155 void vout_control_Wake(vout_control_t *);
156
157 /* control inside of the vout thread */
158 int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline, mtime_t timeout);
159 void vout_control_Dead(vout_control_t *);
160
161 #endif
162