forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.h
300 lines (273 loc) · 9.81 KB
/
event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
/*****************************************************************************
* event.h: Input event functions
*****************************************************************************
* Copyright (C) 2008 Laurent Aimar
*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LIBVLC_INPUT_EVENT_H
#define LIBVLC_INPUT_EVENT_H 1
#include <vlc_common.h>
#include <vlc_input.h>
#include "input_internal.h"
static inline void input_SendEvent(input_thread_t *p_input,
const struct vlc_input_event *event)
{
input_thread_private_t *priv = input_priv(p_input);
if(priv->events_cb)
priv->events_cb(p_input, event, priv->events_data);
}
/*****************************************************************************
* Event for input.c
*****************************************************************************/
static inline void input_SendEventDead(input_thread_t *p_input)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_DEAD,
});
}
static inline void input_SendEventCapabilities(input_thread_t *p_input,
int i_capabilities)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_CAPABILITIES,
.capabilities = i_capabilities
});
}
static inline void input_SendEventTimes(input_thread_t *p_input,
double f_position, vlc_tick_t i_time,
vlc_tick_t i_normal_time,
vlc_tick_t i_length)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_TIMES,
.times = { f_position, i_time, i_normal_time, i_length }
});
}
static inline void input_SendEventOutputClock(input_thread_t *p_input,
vlc_es_id_t *id, bool master,
vlc_tick_t system_ts,
vlc_tick_t ts, double rate,
unsigned frame_rate,
unsigned frame_rate_base)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_OUTPUT_CLOCK,
.output_clock = { id, master, system_ts, ts, rate,
frame_rate, frame_rate_base }
});
}
static inline void input_SendEventStatistics(input_thread_t *p_input,
const struct input_stats_t *stats)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_STATISTICS,
.stats = stats,
});
}
static inline void input_SendEventRate(input_thread_t *p_input, float rate)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_RATE,
.rate = rate,
});
}
static inline void input_SendEventRecord(input_thread_t *p_input,
bool b_recording)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_RECORD,
.record = b_recording
});
}
static inline void input_SendEventTitle(input_thread_t *p_input,
const struct vlc_input_event_title *title)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_TITLE,
.title = *title
});
}
static inline void input_SendEventSeekpoint(input_thread_t *p_input,
int i_title, int i_seekpoint)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_CHAPTER,
.chapter = { i_title, i_seekpoint }
});
}
static inline void input_SendEventSignal(input_thread_t *p_input,
double f_quality, double f_strength)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_SIGNAL,
.signal = { f_quality, f_strength }
});
}
static inline void input_SendEventState(input_thread_t *p_input, int i_state,
vlc_tick_t state_date)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_STATE,
.state = { i_state, state_date, },
});
}
static inline void input_SendEventCache(input_thread_t *p_input, double f_level)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_CACHE,
.cache = f_level
});
}
static inline void input_SendEventMeta(input_thread_t *p_input)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_ITEM_META,
});
}
static inline void input_SendEventMetaInfo(input_thread_t *p_input)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_ITEM_INFO,
});
}
static inline void input_SendEventMetaEpg(input_thread_t *p_input)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_ITEM_EPG,
});
}
static inline void input_SendEventSubsFPS(input_thread_t *p_input, float fps)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_SUBS_FPS,
.subs_fps = fps,
});
}
/*****************************************************************************
* Event for es_out.c
*****************************************************************************/
static inline void input_SendEventProgramAdd(input_thread_t *p_input,
int i_program, const char *psz_text)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_PROGRAM,
.program = {
.action = VLC_INPUT_PROGRAM_ADDED,
.id = i_program,
.title = psz_text
}
});
}
static inline void input_SendEventProgramUpdated(input_thread_t *p_input,
int i_program, const char *psz_text)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_PROGRAM,
.program = {
.action = VLC_INPUT_PROGRAM_UPDATED,
.id = i_program,
.title = psz_text
}
});
}
static inline void input_SendEventProgramDel(input_thread_t *p_input,
int i_program)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_PROGRAM,
.program = {
.action = VLC_INPUT_PROGRAM_DELETED,
.id = i_program
}
});
}
static inline void input_SendEventProgramSelect(input_thread_t *p_input,
int i_program)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_PROGRAM,
.program = {
.action = VLC_INPUT_PROGRAM_SELECTED,
.id = i_program
}
});
}
static inline void input_SendEventProgramScrambled(input_thread_t *p_input,
int i_group, bool b_scrambled)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_PROGRAM,
.program = {
.action = VLC_INPUT_PROGRAM_SCRAMBLED,
.id = i_group,
.scrambled = b_scrambled
}
});
}
static inline void input_SendEventEs(input_thread_t *p_input,
const struct vlc_input_event_es *es_event)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_ES,
.es = *es_event,
});
}
static inline void input_SendEventParsing(input_thread_t *p_input,
input_item_node_t *p_root)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_SUBITEMS,
.subitems = p_root,
});
}
static inline void input_SendEventVbiPage(input_thread_t *p_input, unsigned page)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_VBI_PAGE,
.vbi_page = page,
});
}
static inline void input_SendEventVbiTransparency(input_thread_t *p_input,
bool transparent)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_VBI_TRANSPARENCY,
.vbi_transparent = transparent,
});
}
/*****************************************************************************
* Event for resource.c
*****************************************************************************/
static inline void input_SendEventVout(input_thread_t *p_input,
const struct vlc_input_event_vout *event)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_VOUT,
.vout = *event,
});
}
/*****************************************************************************
* Event for control.c/input.c
*****************************************************************************/
static inline void input_SendEventBookmark(input_thread_t *p_input)
{
input_SendEvent(p_input, &(struct vlc_input_event) {
.type = INPUT_EVENT_BOOKMARK
});
}
#endif