VLC  3.0.15
control.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * control.h : vout internal control
3  *****************************************************************************
4  * Copyright (C) 2009-2010 Laurent Aimar
5  * $Id: 04a66e9fb47d26ba40374fc39ca890f5c93b82e1 $
6  *
7  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8  *
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.
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 Lesser General Public License for more details.
18  *
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  *****************************************************************************/
23 
24 #ifndef LIBVLC_VOUT_INTERNAL_CONTROL_H
25 #define LIBVLC_VOUT_INTERNAL_CONTROL_H
26 
27 #include <vlc_vout_window.h>
28 #include <vlc_viewpoint.h>
29 
30 /* */
31 enum {
34  VOUT_CONTROL_REINIT, /* cfg */
36 
37 #if 0
38  /* */
39  VOUT_CONTROL_START,
40  VOUT_CONTROL_STOP,
41 #endif
42  VOUT_CONTROL_SUBPICTURE, /* subpicture */
43  VOUT_CONTROL_FLUSH_SUBPICTURE, /* integer */
44  VOUT_CONTROL_OSD_TITLE, /* string */
45  VOUT_CONTROL_CHANGE_FILTERS, /* string */
46  VOUT_CONTROL_CHANGE_INTERLACE, /* boolean */
49  VOUT_CONTROL_CHANGE_SUB_MARGIN, /* integer */
50 
52  VOUT_CONTROL_FLUSH, /* time */
53  VOUT_CONTROL_STEP, /* time_ptr */
54 
55  VOUT_CONTROL_FULLSCREEN, /* bool */
56  VOUT_CONTROL_WINDOW_STATE, /* unsigned */
57  VOUT_CONTROL_WINDOW_MOUSE, /* window_mouse */
58  VOUT_CONTROL_DISPLAY_FILLED, /* bool */
59  VOUT_CONTROL_ZOOM, /* pair */
60 
65  VOUT_CONTROL_VIEWPOINT, /* viewpoint */
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  int integer;
77  struct {
78  int a;
79  int b;
80  } pair;
81  struct {
82  bool is_on;
83  mtime_t date;
84  } pause;
85  struct {
86  int channel;
87  char *string;
88  } message;
89  struct {
90  unsigned left;
91  unsigned top;
92  unsigned right;
93  unsigned bottom;
94  } border;
95  struct {
96  unsigned x;
97  unsigned y;
98  unsigned width;
99  unsigned height;
100  } window;
103  subpicture_t *subpicture;
104  vlc_viewpoint_t viewpoint;
105  } u;
107 
108 void vout_control_cmd_Init(vout_control_cmd_t *, int type);
110 
111 typedef struct {
113  vlc_cond_t wait_request;
114  vlc_cond_t wait_acknowledge;
115 
116  /* */
117  bool is_dead;
118  bool can_sleep;
119  bool is_processing;
122 
123 /* */
126 
127 /* controls outside of the vout thread */
129 
131 void vout_control_PushVoid(vout_control_t *, int type);
132 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
133 void vout_control_PushInteger(vout_control_t *, int type, int integer);
134 void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
135 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
136 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
137 void vout_control_PushString(vout_control_t *, int type, const char *string);
139 
140 /* control inside of the vout thread */
143 
144 #endif
VOUT_CONTROL_WINDOW_MOUSE
Definition: control.h:76
VOUT_CONTROL_STEP
Definition: control.h:72
VOUT_CONTROL_CHANGE_FILTERS
Definition: control.h:64
VOUT_CONTROL_CHANGE_SUB_MARGIN
Definition: control.h:68
VOUT_CONTROL_DISPLAY_FILLED
Definition: control.h:77
vout_control_Push
void vout_control_Push(vout_control_t *, vout_control_cmd_t *)
Definition: control.c:101
vout_control_PushTime
void vout_control_PushTime(vout_control_t *, int type, mtime_t time)
Definition: control.c:144
VOUT_CONTROL_FLUSH_SUBPICTURE
Definition: control.h:62
vout_control_Wake
void vout_control_Wake(vout_control_t *)
Definition: control.c:113
VOUT_CONTROL_VIEWPOINT
Definition: control.h:84
VOUT_CONTROL_CLEAN
Definition: control.h:52
vlc_viewpoint_t
Viewpoints.
Definition: vlc_viewpoint.h:44
VOUT_CONTROL_SUBPICTURE
Definition: control.h:61
vout_control_cmd_t
Definition: control.h:67
vout_control_Dead
void vout_control_Dead(vout_control_t *)
Definition: control.c:84
vlc_cond_t
pthread_cond_t vlc_cond_t
Condition variable.
Definition: vlc_threads.h:279
vout_control_cmd_Init
void vout_control_cmd_Init(vout_control_cmd_t *, int type)
Definition: control.c:33
VOUT_CONTROL_INIT
Definition: control.h:51
VOUT_CONTROL_CHANGE_SUB_SOURCES
Definition: control.h:66
vout_configuration_t
Vout configuration.
Definition: vlc_vout.h:50
vout_control_t
Definition: control.h:110
vout_control_PushMessage
void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string)
Definition: control.c:152
VOUT_CONTROL_ZOOM
Definition: control.h:78
VOUT_CONTROL_FLUSH
Definition: control.h:71
lock
static vlc_mutex_t lock
Definition: interface.c:62
vout_control_cmd_Clean
void vout_control_cmd_Clean(vout_control_cmd_t *)
Definition: control.c:39
vout_window_mouse_event_t
Window mouse event.
Definition: vlc_vout_window.h:82
vout_control_PushBool
void vout_control_PushBool(vout_control_t *, int type, bool boolean)
Definition: control.c:128
VOUT_CONTROL_ASPECT_RATIO
Definition: control.h:80
vout_control_Init
void vout_control_Init(vout_control_t *)
Definition: control.c:58
subpicture_t
Video subtitle.
Definition: vlc_subpicture.h:153
VOUT_CONTROL_WINDOW_STATE
Definition: control.h:75
VOUT_CONTROL_CANCEL
Definition: control.h:54
DECL_ARRAY
#define DECL_ARRAY(type)
Definition: vlc_arrays.h:165
vout_control_PushPair
void vout_control_PushPair(vout_control_t *, int type, int a, int b)
Definition: control.c:161
vout_control_WaitEmpty
void vout_control_WaitEmpty(vout_control_t *)
Definition: control.c:93
VOUT_CONTROL_CROP_BORDER
Definition: control.h:81
vlc_mutex_t
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
VOUT_CONTROL_CHANGE_SUB_FILTERS
Definition: control.h:67
VOUT_CONTROL_PAUSE
Definition: control.h:70
vout_control_Pop
int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline)
Definition: control.c:179
VOUT_CONTROL_OSD_TITLE
Definition: control.h:63
VOUT_CONTROL_REINIT
Definition: control.h:53
vlc_vout_window.h
vlc_viewpoint.h
mtime_t
int64_t mtime_t
High precision date or time interval.
Definition: vlc_common.h:150
VOUT_CONTROL_FULLSCREEN
Definition: control.h:74
vout_control_Clean
void vout_control_Clean(vout_control_t *)
Definition: control.c:70
vout_control_PushString
void vout_control_PushString(vout_control_t *, int type, const char *string)
Definition: control.c:170
VOUT_CONTROL_CHANGE_INTERLACE
Definition: control.h:65
vout_control_PushInteger
void vout_control_PushInteger(vout_control_t *, int type, int integer)
Definition: control.c:136
VOUT_CONTROL_CROP_RATIO
Definition: control.h:82
vout_control_PushVoid
void vout_control_PushVoid(vout_control_t *, int type)
Definition: control.c:121
VOUT_CONTROL_CROP_WINDOW
Definition: control.h:83