demux: ts: use es_format_Change
[vlc.git] / src / video_output / control.h
blobf49208ab6a7d914ab09643cac023e21cc9b62cf2
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 it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * 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 #include <vlc_vout_window.h>
29 /* */
30 enum {
31 VOUT_CONTROL_INIT,
32 VOUT_CONTROL_CLEAN,
33 VOUT_CONTROL_REINIT, /* cfg */
34 VOUT_CONTROL_CANCEL,
36 #if 0
37 /* */
38 VOUT_CONTROL_START,
39 VOUT_CONTROL_STOP,
40 #endif
41 VOUT_CONTROL_SUBPICTURE, /* subpicture */
42 VOUT_CONTROL_FLUSH_SUBPICTURE, /* integer */
43 VOUT_CONTROL_OSD_TITLE, /* string */
44 VOUT_CONTROL_CHANGE_FILTERS, /* string */
45 VOUT_CONTROL_CHANGE_INTERLACE, /* boolean */
46 VOUT_CONTROL_CHANGE_SUB_SOURCES, /* string */
47 VOUT_CONTROL_CHANGE_SUB_FILTERS, /* string */
48 VOUT_CONTROL_CHANGE_SUB_MARGIN, /* integer */
50 VOUT_CONTROL_PAUSE,
51 VOUT_CONTROL_FLUSH, /* time */
52 VOUT_CONTROL_STEP, /* time_ptr */
54 VOUT_CONTROL_FULLSCREEN, /* bool */
55 VOUT_CONTROL_WINDOW_STATE, /* unsigned */
56 VOUT_CONTROL_WINDOW_MOUSE, /* window_mouse */
57 VOUT_CONTROL_DISPLAY_FILLED, /* bool */
58 VOUT_CONTROL_ZOOM, /* pair */
60 VOUT_CONTROL_ASPECT_RATIO, /* pair */
61 VOUT_CONTROL_CROP_BORDER, /* border */
62 VOUT_CONTROL_CROP_RATIO, /* pair */
63 VOUT_CONTROL_CROP_WINDOW, /* window */
64 VOUT_CONTROL_VIEWPOINT, /* viewpoint */
67 typedef struct {
68 int type;
70 union {
71 bool boolean;
72 mtime_t time;
73 mtime_t *time_ptr;
74 char *string;
75 int integer;
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 struct {
89 unsigned left;
90 unsigned top;
91 unsigned right;
92 unsigned bottom;
93 } border;
94 struct {
95 unsigned x;
96 unsigned y;
97 unsigned width;
98 unsigned height;
99 } window;
100 vout_window_mouse_event_t window_mouse;
101 const vout_configuration_t *cfg;
102 subpicture_t *subpicture;
103 vlc_viewpoint_t viewpoint;
104 } u;
105 } vout_control_cmd_t;
107 void vout_control_cmd_Init(vout_control_cmd_t *, int type);
108 void vout_control_cmd_Clean(vout_control_cmd_t *);
110 typedef struct {
111 vlc_mutex_t lock;
112 vlc_cond_t wait_request;
113 vlc_cond_t wait_acknowledge;
115 /* */
116 bool is_dead;
117 bool can_sleep;
118 bool is_processing;
119 DECL_ARRAY(vout_control_cmd_t) cmd;
120 } vout_control_t;
122 /* */
123 void vout_control_Init(vout_control_t *);
124 void vout_control_Clean(vout_control_t *);
126 /* controls outside of the vout thread */
127 void vout_control_WaitEmpty(vout_control_t *);
129 void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
130 void vout_control_PushVoid(vout_control_t *, int type);
131 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
132 void vout_control_PushInteger(vout_control_t *, int type, int integer);
133 void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
134 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
135 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
136 void vout_control_PushString(vout_control_t *, int type, const char *string);
137 void vout_control_Wake(vout_control_t *);
139 /* control inside of the vout thread */
140 int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline);
141 void vout_control_Dead(vout_control_t *);
143 #endif