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
107static inline int es_out_vaPrivControl( es_out_t *out, int query, va_list args )
108{
109 vlc_assert( out->cbs->priv_control );
110 return out->cbs->priv_control( out, NULL, query, args );
111}
112
113static inline int es_out_PrivControl( es_out_t *out, int query, ... )
114{
115 va_list args;
116 va_start( args, query );
117 int result = es_out_vaPrivControl( out, query, args );
118 va_end( args );
119 return result;
120}
121
122static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
123{
124 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_MODE, i_mode );
125 assert( !i_ret );
126}
127static inline int es_out_SetEs( es_out_t *p_out, vlc_es_id_t *id )
128{
129 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES, id );
130}
131static inline int es_out_UnsetEs( es_out_t *p_out, vlc_es_id_t *id )
132{
133 return es_out_PrivControl( p_out, ES_OUT_PRIV_UNSET_ES, id );
134}
135static inline int es_out_RestartEs( es_out_t *p_out, vlc_es_id_t *id )
136{
137 return es_out_PrivControl( p_out, ES_OUT_PRIV_RESTART_ES, id );
138}
139static inline vlc_tick_t es_out_GetWakeup( es_out_t *p_out )
140{
141 vlc_tick_t i_wu;
142 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_WAKE_UP, &i_wu );
143
144 assert( !i_ret );
145 return i_wu;
146}
147static inline int es_out_SetEsList( es_out_t *p_out,
148 enum es_format_category_e cat,
149 vlc_es_id_t **ids )
150{
151 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_LIST, cat, ids );
152}
153static inline void es_out_SetEsCatIds( es_out_t *p_out,
154 enum es_format_category_e cat,
155 const char *str_ids )
156{
158 cat, str_ids );
159 assert( ret == VLC_SUCCESS );
160}
161static inline int es_out_StopAllEs( es_out_t *p_out, vlc_es_id_t ***context )
162{
163 return es_out_PrivControl( p_out, ES_OUT_PRIV_STOP_ALL_ES, context );
164}
165static inline int es_out_StartAllEs( es_out_t *p_out, vlc_es_id_t **context )
166{
167 return es_out_PrivControl( p_out, ES_OUT_PRIV_START_ALL_ES, context );
168}
169static inline bool es_out_GetBuffering( es_out_t *p_out )
170{
171 bool b;
172 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_BUFFERING, &b );
173
174 assert( !i_ret );
175 return b;
176}
177static inline bool es_out_GetEmpty( es_out_t *p_out )
178{
179 bool b;
180 int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
181
182 assert( !i_ret );
183 return b;
184}
185static inline void es_out_SetEsDelay( es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay )
186{
187 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay );
188 assert( !i_ret );
189}
190static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, vlc_tick_t i_delay )
191{
192 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_DELAY, i_cat, i_delay );
193 assert( !i_ret );
194}
195static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record, const char *dir_path )
196{
197 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RECORD_STATE, b_record, dir_path );
198}
199static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
200{
201 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
202}
203static inline int es_out_SetRate( es_out_t *p_out, float source_rate, float rate )
204{
205 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RATE, source_rate, rate );
206}
207static inline int es_out_SetFrameNext( es_out_t *p_out )
208{
210}
211static inline void es_out_SetTimes( es_out_t *p_out, double f_position,
212 vlc_tick_t i_time, vlc_tick_t i_normal_time,
213 vlc_tick_t i_length )
214{
215 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
216 i_normal_time, i_length );
217 assert( !i_ret );
218}
219static inline void es_out_SetJitter( es_out_t *p_out,
220 vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average )
221{
222 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_JITTER,
223 i_pts_delay, i_pts_jitter, i_cr_average );
224 assert( !i_ret );
225}
226static inline int es_out_GetGroupForced( es_out_t *p_out )
227{
228 int i_group;
229 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_GROUP_FORCED, &i_group );
230 assert( !i_ret );
231 return i_group;
232}
233static inline void es_out_Eos( es_out_t *p_out )
234{
235 int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_EOS );
236 assert( !i_ret );
237}
238static inline int es_out_SetVbiPage( es_out_t *p_out, vlc_es_id_t *id,
239 unsigned page )
240{
241 return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_VBI_PAGE, id, page );
242}
243static inline int es_out_SetVbiTransparency( es_out_t *p_out, vlc_es_id_t *id,
244 bool enabled )
245{
247 enabled );
248}
249
250es_out_t *input_EsOutNew( input_thread_t *, input_source_t *main_source, float rate,
251 enum input_type input_type );
254
257
258#endif
static int es_out_StopAllEs(es_out_t *p_out, vlc_es_id_t ***context)
Definition es_out.h:161
es_out_t * input_EsOutTimeshiftNew(input_thread_t *, es_out_t *, float i_rate)
Definition es_out_timeshift.c:838
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_SetVbiPage(es_out_t *p_out, vlc_es_id_t *id, unsigned page)
Definition es_out.h:238
static int es_out_SetPauseState(es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date)
Definition es_out.h:199
static bool es_out_GetBuffering(es_out_t *p_out)
Definition es_out.h:169
static int es_out_SetRecordState(es_out_t *p_out, bool b_record, const char *dir_path)
Definition es_out.h:195
static bool es_out_GetEmpty(es_out_t *p_out)
Definition es_out.h:177
const input_source_t * vlc_es_id_GetSource(vlc_es_id_t *id)
Definition es_out.c:4635
static int es_out_SetFrameNext(es_out_t *p_out)
Definition es_out.h:207
static int es_out_GetGroupForced(es_out_t *p_out)
Definition es_out.h:226
es_out_t * input_EsOutSourceNew(es_out_t *master_out, input_source_t *in)
Definition es_out_source.c:95
static int es_out_SetVbiTransparency(es_out_t *p_out, vlc_es_id_t *id, bool enabled)
Definition es_out.h:243
static int es_out_PrivControl(es_out_t *out, int query,...)
Definition es_out.h:113
static void es_out_SetTimes(es_out_t *p_out, double f_position, vlc_tick_t i_time, vlc_tick_t i_normal_time, vlc_tick_t i_length)
Definition es_out.h:211
es_out_t * input_EsOutNew(input_thread_t *, input_source_t *main_source, float rate, enum input_type input_type)
Definition es_out.c:4004
static void es_out_Eos(es_out_t *p_out)
Definition es_out.h:233
static int es_out_SetEsList(es_out_t *p_out, enum es_format_category_e cat, vlc_es_id_t **ids)
Definition es_out.h:147
static vlc_tick_t es_out_GetWakeup(es_out_t *p_out)
Definition es_out.h:139
static int es_out_vaPrivControl(es_out_t *out, int query, va_list args)
Definition es_out.h:107
static void es_out_SetEsCatIds(es_out_t *p_out, enum es_format_category_e cat, const char *str_ids)
Definition es_out.h:153
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 void es_out_SetJitter(es_out_t *p_out, vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average)
Definition es_out.h:219
es_out_id_t * vlc_es_id_get_out(vlc_es_id_t *id)
Definition es_out.c:4593
static void es_out_SetDelay(es_out_t *p_out, int i_cat, vlc_tick_t i_delay)
Definition es_out.h:190
static int es_out_SetRate(es_out_t *p_out, float source_rate, float rate)
Definition es_out.h:203
static void es_out_SetMode(es_out_t *p_out, int i_mode)
Definition es_out.h:122
static void es_out_SetEsDelay(es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay)
Definition es_out.h:185
static int es_out_SetEs(es_out_t *p_out, vlc_es_id_t *id)
Definition es_out.h:127
static int es_out_StartAllEs(es_out_t *p_out, vlc_es_id_t **context)
Definition es_out.h:165
static int es_out_RestartEs(es_out_t *p_out, vlc_es_id_t *id)
Definition es_out.h:135
static int es_out_UnsetEs(es_out_t *p_out, vlc_es_id_t *id)
Definition es_out.h:131
#define vlc_assert(pred)
Run-time assertion.
Definition vlc_common.h:290
#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:168
@ 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
int(* priv_control)(es_out_t *, input_source_t *in, int query, va_list)
Private control callback, must be NULL for es_out created from modules.
Definition vlc_es_out.h:138
Definition es_out.c:115
Definition vlc_es_out.h:142
const struct es_out_callbacks * cbs
Definition vlc_es_out.h:143
Definition source.h:34
Main structure representing an input thread.
Definition input_internal.h:43
Opaque structure representing an ES (Elementary Stream) track.
Definition es_out.c:104
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