VLC 4.0.0-dev
Loading...
Searching...
No Matches
es_out.h
Go to the documentation of this file.
1/*****************************************************************************
2 * es_out.h: Input es_out functions
3 *****************************************************************************
4 * Copyright (C) 1998-2008 VLC authors and VideoLAN
5 * Copyright (C) 2008 Laurent Aimar
6 *
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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_INPUT_ES_OUT_H
25#define LIBVLC_INPUT_ES_OUT_H 1
26
27#include <vlc_common.h>
28#include <vlc_es_out.h>
29
30#include "input_internal.h"
31
33
35{
36 ES_OUT_MODE_NONE, /* don't select anything */
37 ES_OUT_MODE_ALL, /* eg for stream output */
38 ES_OUT_MODE_AUTO, /* best audio/video or for input follow audio-track, sub-track */
39 ES_OUT_MODE_PARTIAL,/* select programs given after --programs */
40 ES_OUT_MODE_END /* mark the es_out as dead */
41};
42
44{
45 /* set/get mode */
47
48 /* Same than ES_OUT_SET_ES/ES_OUT_UNSET_ES/ES_OUT_RESTART_ES, but with vlc_es_id_t * */
49 ES_OUT_PRIV_SET_ES, /* arg1= vlc_es_id_t* */
50 ES_OUT_PRIV_UNSET_ES, /* arg1= vlc_es_id_t* res=can fail */
51 ES_OUT_PRIV_RESTART_ES, /* arg1= vlc_es_id_t* */
52
53 /* Get date to wait before demuxing more data */
54 ES_OUT_PRIV_GET_WAKE_UP, /* arg1=vlc_tick_t* res=cannot fail */
55
56 /* Select a list of ES */
57 ES_OUT_PRIV_SET_ES_LIST, /* arg1= vlc_es_id_t *const* (null terminated array) */
58
59 ES_OUT_PRIV_SET_ES_CAT_IDS, /* arg1=es_format_category_e arg2=const char *, res=cannot fail */
60
61 /* Stop all selected ES and save the stopped state in a context.
62 * Call ES_OUT_PRIV_START_ALL_ES to release the context. */
63 ES_OUT_PRIV_STOP_ALL_ES, /* arg1=vlc_es_id_t *** */
64 /* Start all ES from the context returned by ES_OUT_PRIV_STOP_ALL_ES */
65 ES_OUT_PRIV_START_ALL_ES, /* arg1=vlc_es_id_t ** */
66
67 /* Get buffering state */
68 ES_OUT_PRIV_GET_BUFFERING, /* arg1=bool* res=cannot fail */
69
70 /* Set delay for an ES identifier */
71 ES_OUT_PRIV_SET_ES_DELAY, /* arg1=vlc_es_id_t *, res=cannot fail */
72
73 /* Set delay for a ES category */
74 ES_OUT_PRIV_SET_DELAY, /* arg1=es_category_e, res=cannot fail */
75
76 /* Set record state */
77 ES_OUT_PRIV_SET_RECORD_STATE, /* arg1=bool res=can fail */
78
79 /* Set pause state */
80 ES_OUT_PRIV_SET_PAUSE_STATE, /* arg1=bool b_source_paused, bool b_paused arg2=vlc_tick_t res=can fail */
81
82 /* Set rate */
83 ES_OUT_PRIV_SET_RATE, /* arg1=double source_rate arg2=double rate res=can fail */
84
85 /* Set next frame */
86 ES_OUT_PRIV_SET_FRAME_NEXT, /* res=can fail */
87
88 /* Set position/time/length */
89 ES_OUT_PRIV_SET_TIMES, /* arg1=double f_position arg2=vlc_tick_t i_time arg3=vlc_tick_t i_normal_time arg4=vlc_tick_t i_length res=cannot fail */
90
91 /* Set jitter */
92 ES_OUT_PRIV_SET_JITTER, /* arg1=vlc_tick_t i_pts_delay arg2= vlc_tick_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
93
94 /* Get forced group */
95 ES_OUT_PRIV_GET_GROUP_FORCED, /* arg1=int * res=cannot fail */
96
97 /* Set End Of Stream */
98 ES_OUT_PRIV_SET_EOS, /* res=cannot fail */
99
100 /* Set a VBI/Teletext page */
101 ES_OUT_PRIV_SET_VBI_PAGE, /* arg1=unsigned res=can fail */
102
103 /* Set VBI/Teletext menu transparent */
104 ES_OUT_PRIV_SET_VBI_TRANSPARENCY /* arg1=bool res=can fail */
106
107struct vlc_input_es_out;
110 struct vlc_input_es_out *out,
111 input_source_t *source,
112 int query,
113 va_list args);
114};
115
121
122static inline int
123es_out_vaPrivControl(struct vlc_input_es_out *out, int query, va_list args )
124{
125 return out->ops->priv_control(out, NULL, query, args);
126}
127
128static inline int
129es_out_PrivControl(struct vlc_input_es_out *out, int query, ...)
130{
131 va_list args;
132 va_start( args, query );
133 int result = es_out_vaPrivControl( out, query, args );
134 va_end( args );
135 return result;
136}
137
138static inline void
139es_out_SetMode(struct vlc_input_es_out *out, int i_mode)
140{
141 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_MODE, i_mode);
142 assert( !i_ret );
143}
144
145static inline int
147{
148 return es_out_PrivControl(out, ES_OUT_PRIV_SET_ES, id);
149}
150
151static inline int
156
157static inline int
162
163static inline vlc_tick_t
165{
166 vlc_tick_t i_wu;
167 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_WAKE_UP, &i_wu);
168
169 assert( !i_ret );
170 return i_wu;
171}
172
173static inline int
175 enum es_format_category_e cat,
176 vlc_es_id_t **ids)
177{
178 return es_out_PrivControl(out, ES_OUT_PRIV_SET_ES_LIST, cat, ids);
179}
180
181static inline void
183 enum es_format_category_e cat,
184 const char *str_ids)
185{
187 cat, str_ids);
188 assert( ret == VLC_SUCCESS );
189}
190
191static inline int
193 vlc_es_id_t ***context)
194{
195 return es_out_PrivControl(out, ES_OUT_PRIV_STOP_ALL_ES, context);
196}
197
198static inline int
200{
201 return es_out_PrivControl(out, ES_OUT_PRIV_START_ALL_ES, context);
202}
203
204static inline bool
206{
207 bool b;
208 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_BUFFERING, &b);
209
210 assert( !i_ret );
211 return b;
212}
213
214static inline bool
216{
217 bool b;
218 int i_ret = es_out_Control(&out->out, ES_OUT_GET_EMPTY, &b);
219
220 assert( !i_ret );
221 return b;
222}
223
224static inline void
226 vlc_es_id_t *es,
227 vlc_tick_t i_delay)
228{
229 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay);
230 assert( !i_ret );
231}
232
233static inline void
235 int i_cat,
236 vlc_tick_t i_delay)
237{
238 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_DELAY, i_cat, i_delay);
239 assert( !i_ret );
240}
241
242static inline int
244 bool b_record,
245 const char *dir_path)
246{
247 return es_out_PrivControl(out, ES_OUT_PRIV_SET_RECORD_STATE, b_record, dir_path);
248}
249
250static inline int
252 bool b_source_paused,
253 bool b_paused,
254 vlc_tick_t i_date)
255{
256 return es_out_PrivControl(out, ES_OUT_PRIV_SET_PAUSE_STATE, b_source_paused, b_paused, i_date);
257}
258
259static inline int
260es_out_SetRate(struct vlc_input_es_out *out, float source_rate, float rate)
261{
262 return es_out_PrivControl(out, ES_OUT_PRIV_SET_RATE, source_rate, rate);
263}
264
265static inline int
270
271static inline void
272es_out_SetTimes(struct vlc_input_es_out *out, double f_position,
273 vlc_tick_t i_time, vlc_tick_t i_normal_time,
274 vlc_tick_t i_length )
275{
276 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
277 i_normal_time, i_length);
278 assert( !i_ret );
279}
280
281static inline void
283 vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter,
284 int i_cr_average)
285{
287 i_pts_delay, i_pts_jitter, i_cr_average);
288 assert( !i_ret );
289}
290
291static inline int
293{
294 int i_group;
295 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_GROUP_FORCED, &i_group);
296 assert( !i_ret );
297 return i_group;
298}
299
300static inline void
302{
303 int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_EOS);
304 assert( !i_ret );
305}
306
307static inline int
309 unsigned page)
310{
311 return es_out_PrivControl(out, ES_OUT_PRIV_SET_VBI_PAGE, id, page);
312}
313
314static inline int
316 bool enabled)
317{
319 enabled);
320}
321
322struct vlc_input_es_out *
323input_EsOutNew(input_thread_t *, input_source_t *main_source, float rate,
325
326struct vlc_input_es_out *
328
329struct vlc_input_es_out *
331
334
335static inline void
340
341#endif
static int es_out_GetGroupForced(struct vlc_input_es_out *out)
Definition es_out.h:292
es_out_query_private_e
Definition es_out.h:44
@ ES_OUT_PRIV_SET_FRAME_NEXT
Definition es_out.h:86
@ ES_OUT_PRIV_GET_GROUP_FORCED
Definition es_out.h:95
@ ES_OUT_PRIV_SET_RATE
Definition es_out.h:83
@ ES_OUT_PRIV_SET_DELAY
Definition es_out.h:74
@ ES_OUT_PRIV_SET_VBI_PAGE
Definition es_out.h:101
@ ES_OUT_PRIV_SET_ES_CAT_IDS
Definition es_out.h:59
@ ES_OUT_PRIV_STOP_ALL_ES
Definition es_out.h:63
@ ES_OUT_PRIV_RESTART_ES
Definition es_out.h:51
@ ES_OUT_PRIV_GET_BUFFERING
Definition es_out.h:68
@ ES_OUT_PRIV_START_ALL_ES
Definition es_out.h:65
@ ES_OUT_PRIV_SET_ES_DELAY
Definition es_out.h:71
@ ES_OUT_PRIV_SET_ES
Definition es_out.h:49
@ ES_OUT_PRIV_SET_ES_LIST
Definition es_out.h:57
@ ES_OUT_PRIV_SET_PAUSE_STATE
Definition es_out.h:80
@ ES_OUT_PRIV_SET_VBI_TRANSPARENCY
Definition es_out.h:104
@ ES_OUT_PRIV_SET_EOS
Definition es_out.h:98
@ ES_OUT_PRIV_SET_JITTER
Definition es_out.h:92
@ ES_OUT_PRIV_SET_RECORD_STATE
Definition es_out.h:77
@ ES_OUT_PRIV_SET_TIMES
Definition es_out.h:89
@ ES_OUT_PRIV_GET_WAKE_UP
Definition es_out.h:54
@ ES_OUT_PRIV_SET_MODE
Definition es_out.h:46
@ ES_OUT_PRIV_UNSET_ES
Definition es_out.h:50
static int es_out_SetVbiTransparency(struct vlc_input_es_out *out, vlc_es_id_t *id, bool enabled)
Definition es_out.h:315
static void es_out_SetJitter(struct vlc_input_es_out *out, vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average)
Definition es_out.h:282
static int es_out_SetEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
Definition es_out.h:146
static int es_out_StopAllEs(struct vlc_input_es_out *out, vlc_es_id_t ***context)
Definition es_out.h:192
static int es_out_SetRate(struct vlc_input_es_out *out, float source_rate, float rate)
Definition es_out.h:260
static int es_out_SetPauseState(struct vlc_input_es_out *out, bool b_source_paused, bool b_paused, vlc_tick_t i_date)
Definition es_out.h:251
const input_source_t * vlc_es_id_GetSource(vlc_es_id_t *id)
Definition es_out.c:4651
static void es_out_SetMode(struct vlc_input_es_out *out, int i_mode)
Definition es_out.h:139
static void es_out_SetDelay(struct vlc_input_es_out *out, int i_cat, vlc_tick_t i_delay)
Definition es_out.h:234
static int es_out_vaPrivControl(struct vlc_input_es_out *out, int query, va_list args)
Definition es_out.h:123
static bool es_out_GetEmpty(struct vlc_input_es_out *out)
Definition es_out.h:215
static bool es_out_GetBuffering(struct vlc_input_es_out *out)
Definition es_out.h:205
static void vlc_input_es_out_Delete(struct vlc_input_es_out *out)
Definition es_out.h:336
static void es_out_SetEsDelay(struct vlc_input_es_out *out, vlc_es_id_t *es, vlc_tick_t i_delay)
Definition es_out.h:225
struct vlc_input_es_out * input_EsOutNew(input_thread_t *, input_source_t *main_source, float rate, enum input_type input_type)
Definition es_out.c:4015
struct vlc_input_es_out * input_EsOutTimeshiftNew(input_thread_t *, struct vlc_input_es_out *, float i_rate)
Definition es_out_timeshift.c:848
static int es_out_SetFrameNext(struct vlc_input_es_out *out)
Definition es_out.h:266
static void es_out_Eos(struct vlc_input_es_out *out)
Definition es_out.h:301
static int es_out_SetEsList(struct vlc_input_es_out *out, enum es_format_category_e cat, vlc_es_id_t **ids)
Definition es_out.h:174
static int es_out_RestartEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
Definition es_out.h:158
static int es_out_StartAllEs(struct vlc_input_es_out *out, vlc_es_id_t **context)
Definition es_out.h:199
es_out_mode_e
Definition es_out.h:35
@ ES_OUT_MODE_NONE
Definition es_out.h:36
@ ES_OUT_MODE_ALL
Definition es_out.h:37
@ ES_OUT_MODE_END
Definition es_out.h:40
@ ES_OUT_MODE_AUTO
Definition es_out.h:38
@ ES_OUT_MODE_PARTIAL
Definition es_out.h:39
static int es_out_PrivControl(struct vlc_input_es_out *out, int query,...)
Definition es_out.h:129
static vlc_tick_t es_out_GetWakeup(struct vlc_input_es_out *out)
Definition es_out.h:164
static void es_out_SetTimes(struct vlc_input_es_out *out, double f_position, vlc_tick_t i_time, vlc_tick_t i_normal_time, vlc_tick_t i_length)
Definition es_out.h:272
es_out_id_t * vlc_es_id_get_out(vlc_es_id_t *id)
Definition es_out.c:4609
static int es_out_SetRecordState(struct vlc_input_es_out *out, bool b_record, const char *dir_path)
Definition es_out.h:243
static void es_out_SetEsCatIds(struct vlc_input_es_out *out, enum es_format_category_e cat, const char *str_ids)
Definition es_out.h:182
static int es_out_SetVbiPage(struct vlc_input_es_out *out, vlc_es_id_t *id, unsigned page)
Definition es_out.h:308
static int es_out_UnsetEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
Definition es_out.h:152
struct vlc_input_es_out * input_EsOutSourceNew(struct vlc_input_es_out *master_out, input_source_t *in)
Definition es_out_source.c:97
#define VLC_SUCCESS
No error.
Definition vlc_common.h:478
static int es_out_Control(es_out_t *out, int i_query,...)
Definition vlc_es_out.h:164
static void es_out_Delete(es_out_t *p_out)
Definition vlc_es_out.h:175
@ ES_OUT_GET_EMPTY
Definition vlc_es_out.h:95
@ ES_OUT_PRIVATE_START
Definition vlc_es_out.h:116
input_type
Definition input_internal.h:51
Definition es_out.c:115
Definition vlc_es_out.h:138
Definition source.h:35
Main structure representing an input thread.
Definition input_internal.h:43
Opaque structure representing an ES (Elementary Stream) track.
Definition es_out.c:104
Definition es_out.h:108
int(* priv_control)(struct vlc_input_es_out *out, input_source_t *source, int query, va_list args)
Definition es_out.h:109
Definition es_out.h:116
es_out_t out
Definition es_out.h:117
const struct vlc_input_es_out_ops * ops
Definition es_out.h:119
This file is a collection of common definitions and types.
es_format_category_e
ES Categories.
Definition vlc_es.h:616
Elementary streams output interface.
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48