VLC  4.0.0-dev
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 
30 {
31  ES_OUT_MODE_NONE, /* don't select anything */
32  ES_OUT_MODE_ALL, /* eg for stream output */
33  ES_OUT_MODE_AUTO, /* best audio/video or for input follow audio-track, sub-track */
34  ES_OUT_MODE_PARTIAL,/* select programs given after --programs */
35  ES_OUT_MODE_END /* mark the es_out as dead */
36 };
37 
39 {
40  /* set/get mode */
41  ES_OUT_PRIV_SET_MODE, /* arg1= int */
42 
43  /* Same than ES_OUT_SET_ES/ES_OUT_UNSET_ES/ES_OUT_RESTART_ES, but with vlc_es_id_t * */
44  ES_OUT_PRIV_SET_ES, /* arg1= vlc_es_id_t* */
45  ES_OUT_PRIV_UNSET_ES, /* arg1= vlc_es_id_t* res=can fail */
46  ES_OUT_PRIV_RESTART_ES, /* arg1= vlc_es_id_t* */
47 
48  /* Get date to wait before demuxing more data */
49  ES_OUT_PRIV_GET_WAKE_UP, /* arg1=vlc_tick_t* res=cannot fail */
50 
51  /* Select a list of ES */
52  ES_OUT_PRIV_SET_ES_LIST, /* arg1= vlc_es_id_t *const* (null terminated array) */
53 
54  ES_OUT_PRIV_SET_ES_CAT_IDS, /* arg1=es_format_category_e arg2=const char *, res=cannot fail */
55 
56  /* Stop all selected ES and save the stopped state in a context.
57  * Call ES_OUT_PRIV_START_ALL_ES to release the context. */
58  ES_OUT_PRIV_STOP_ALL_ES, /* arg1=vlc_es_id_t *** */
59  /* Start all ES from the context returned by ES_OUT_PRIV_STOP_ALL_ES */
60  ES_OUT_PRIV_START_ALL_ES, /* arg1=vlc_es_id_t ** */
61 
62  /* Get buffering state */
63  ES_OUT_PRIV_GET_BUFFERING, /* arg1=bool* res=cannot fail */
64 
65  /* Set delay for an ES identifier */
66  ES_OUT_PRIV_SET_ES_DELAY, /* arg1=vlc_es_id_t *, res=cannot fail */
67 
68  /* Set delay for a ES category */
69  ES_OUT_PRIV_SET_DELAY, /* arg1=es_category_e, res=cannot fail */
70 
71  /* Set record state */
72  ES_OUT_PRIV_SET_RECORD_STATE, /* arg1=bool res=can fail */
73 
74  /* Set pause state */
75  ES_OUT_PRIV_SET_PAUSE_STATE, /* arg1=bool b_source_paused, bool b_paused arg2=vlc_tick_t res=can fail */
76 
77  /* Set rate */
78  ES_OUT_PRIV_SET_RATE, /* arg1=double source_rate arg2=double rate res=can fail */
79 
80  /* Set next frame */
81  ES_OUT_PRIV_SET_FRAME_NEXT, /* res=can fail */
82 
83  /* Set position/time/length */
84  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 */
85 
86  /* Set jitter */
87  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 */
88 
89  /* Get forced group */
90  ES_OUT_PRIV_GET_GROUP_FORCED, /* arg1=int * res=cannot fail */
91 
92  /* Set End Of Stream */
93  ES_OUT_PRIV_SET_EOS, /* res=cannot fail */
94 
95  /* Set a VBI/Teletext page */
96  ES_OUT_PRIV_SET_VBI_PAGE, /* arg1=unsigned res=can fail */
97 
98  /* Set VBI/Teletext menu transparent */
99  ES_OUT_PRIV_SET_VBI_TRANSPARENCY /* arg1=bool res=can fail */
100 };
101 
102 static inline int es_out_vaPrivControl( es_out_t *out, int query, va_list args )
103 {
104  vlc_assert( out->cbs->priv_control );
105  return out->cbs->priv_control( out, query, args );
106 }
107 
108 static inline int es_out_PrivControl( es_out_t *out, int query, ... )
109 {
110  va_list args;
111  va_start( args, query );
112  int result = es_out_vaPrivControl( out, query, args );
113  va_end( args );
114  return result;
115 }
116 
117 static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
118 {
119  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_MODE, i_mode );
120  assert( !i_ret );
121 }
122 static inline int es_out_SetEs( es_out_t *p_out, vlc_es_id_t *id )
123 {
124  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES, id );
125 }
126 static inline int es_out_UnsetEs( es_out_t *p_out, vlc_es_id_t *id )
127 {
128  return es_out_PrivControl( p_out, ES_OUT_PRIV_UNSET_ES, id );
129 }
130 static inline int es_out_RestartEs( es_out_t *p_out, vlc_es_id_t *id )
131 {
132  return es_out_PrivControl( p_out, ES_OUT_PRIV_RESTART_ES, id );
133 }
134 static inline vlc_tick_t es_out_GetWakeup( es_out_t *p_out )
135 {
136  vlc_tick_t i_wu;
137  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_WAKE_UP, &i_wu );
138 
139  assert( !i_ret );
140  return i_wu;
141 }
142 static inline int es_out_SetEsList( es_out_t *p_out,
143  enum es_format_category_e cat,
144  vlc_es_id_t **ids )
145 {
146  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_LIST, cat, ids );
147 }
148 static inline void es_out_SetEsCatIds( es_out_t *p_out,
149  enum es_format_category_e cat,
150  const char *str_ids )
151 {
153  cat, str_ids );
154  assert( ret == VLC_SUCCESS );
155 }
156 static inline int es_out_StopAllEs( es_out_t *p_out, vlc_es_id_t ***context )
157 {
158  return es_out_PrivControl( p_out, ES_OUT_PRIV_STOP_ALL_ES, context );
159 }
160 static inline int es_out_StartAllEs( es_out_t *p_out, vlc_es_id_t **context )
161 {
162  return es_out_PrivControl( p_out, ES_OUT_PRIV_START_ALL_ES, context );
163 }
164 static inline bool es_out_GetBuffering( es_out_t *p_out )
165 {
166  bool b;
167  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_BUFFERING, &b );
168 
169  assert( !i_ret );
170  return b;
171 }
172 static inline bool es_out_GetEmpty( es_out_t *p_out )
173 {
174  bool b;
175  int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
176 
177  assert( !i_ret );
178  return b;
179 }
180 static inline void es_out_SetEsDelay( es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay )
181 {
182  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay );
183  assert( !i_ret );
184 }
185 static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, vlc_tick_t i_delay )
186 {
187  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_DELAY, i_cat, i_delay );
188  assert( !i_ret );
189 }
190 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
191 {
192  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RECORD_STATE, b_record );
193 }
194 static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
195 {
196  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
197 }
198 static inline int es_out_SetRate( es_out_t *p_out, float source_rate, float rate )
199 {
200  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RATE, source_rate, rate );
201 }
202 static inline int es_out_SetFrameNext( es_out_t *p_out )
203 {
205 }
206 static inline void es_out_SetTimes( es_out_t *p_out, double f_position,
207  vlc_tick_t i_time, vlc_tick_t i_normal_time,
208  vlc_tick_t i_length )
209 {
210  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
211  i_normal_time, i_length );
212  assert( !i_ret );
213 }
214 static inline void es_out_SetJitter( es_out_t *p_out,
215  vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average )
216 {
217  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_JITTER,
218  i_pts_delay, i_pts_jitter, i_cr_average );
219  assert( !i_ret );
220 }
221 static inline int es_out_GetGroupForced( es_out_t *p_out )
222 {
223  int i_group;
224  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_GROUP_FORCED, &i_group );
225  assert( !i_ret );
226  return i_group;
227 }
228 static inline void es_out_Eos( es_out_t *p_out )
229 {
230  int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_EOS );
231  assert( !i_ret );
232 }
233 static inline int es_out_SetVbiPage( es_out_t *p_out, vlc_es_id_t *id,
234  unsigned page )
235 {
236  return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_VBI_PAGE, id, page );
237 }
238 static inline int es_out_SetVbiTransparency( es_out_t *p_out, vlc_es_id_t *id,
239  bool enabled )
240 {
242  enabled );
243 }
244 
245 es_out_t *input_EsOutNew( input_thread_t *, input_source_t *main_source, float rate );
248 
251 
252 #endif
Definition: es_out.h:69
Definition: es_out.h:96
Definition: es_out.h:93
es_out_mode_e
Definition: es_out.h:29
static bool es_out_GetEmpty(es_out_t *p_out)
Definition: es_out.h:172
Definition: es_out.h:63
Definition: es_out.h:44
Definition: es_out.h:75
es_out_query_private_e
Definition: es_out.h:38
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:206
Definition: es_out.h:41
Definition: es_out.h:99
This file is a collection of common definitions and types.
static int es_out_SetVbiTransparency(es_out_t *p_out, vlc_es_id_t *id, bool enabled)
Definition: es_out.h:238
static int es_out_RestartEs(es_out_t *p_out, vlc_es_id_t *id)
Definition: es_out.h:130
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:214
static int es_out_vaPrivControl(es_out_t *out, int query, va_list args)
Definition: es_out.h:102
Definition: es_out.h:58
es_out_t * input_EsOutNew(input_thread_t *, input_source_t *main_source, float rate)
Definition: es_out.c:486
static int es_out_SetRate(es_out_t *p_out, float source_rate, float rate)
Definition: es_out.h:198
static int es_out_GetGroupForced(es_out_t *p_out)
Definition: es_out.h:221
static void es_out_SetMode(es_out_t *p_out, int i_mode)
Definition: es_out.h:117
Definition: es_out.h:81
es_format_category_e
ES Categories.
Definition: vlc_es.h:600
static vlc_tick_t es_out_GetWakeup(es_out_t *p_out)
Definition: es_out.h:134
Definition: es_out.h:32
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:194
Definition: es_out.h:49
static void es_out_Eos(es_out_t *p_out)
Definition: es_out.h:228
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45
static bool es_out_GetBuffering(es_out_t *p_out)
Definition: es_out.h:164
Definition: es_out.h:84
Definition: vlc_es_out.h:143
int(* priv_control)(es_out_t *, int query, va_list)
Private control callback, must be NULL for es_out created from modules.
Definition: vlc_es_out.h:140
static void es_out_SetDelay(es_out_t *p_out, int i_cat, vlc_tick_t i_delay)
Definition: es_out.h:185
#define vlc_assert(pred)
Run-time assertion.
Definition: vlc_common.h:267
Definition: es_out.h:46
const struct es_out_callbacks * cbs
Definition: vlc_es_out.h:145
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:470
Definition: es_out.c:103
Definition: vlc_es_out.h:93
es_out_t * input_EsOutSourceNew(es_out_t *master_out, input_source_t *in)
Definition: es_out_source.c:80
Opaque structure representing an ES (Elementary Stream) track.
Definition: es_out.c:92
static int es_out_SetFrameNext(es_out_t *p_out)
Definition: es_out.h:202
Definition: es_out.h:34
static int es_out_PrivControl(es_out_t *out, int query,...)
Definition: es_out.h:108
const input_source_t * vlc_es_id_GetSource(vlc_es_id_t *id)
Definition: es_out.c:4396
es_out_id_t * vlc_es_id_get_out(vlc_es_id_t *id)
Definition: es_out.c:4354
Definition: es_out.h:87
Main structure representing an input thread.
Definition: input_internal.h:48
static int es_out_StartAllEs(es_out_t *p_out, vlc_es_id_t **context)
Definition: es_out.h:160
static int es_out_SetEs(es_out_t *p_out, vlc_es_id_t *id)
Definition: es_out.h:122
static int es_out_Control(es_out_t *out, int i_query,...)
Definition: vlc_es_out.h:170
Definition: es_out.h:33
es_out_t * input_EsOutTimeshiftNew(input_thread_t *, es_out_t *, float i_rate)
Definition: es_out_timeshift.c:315
static int es_out_SetVbiPage(es_out_t *p_out, vlc_es_id_t *id, unsigned page)
Definition: es_out.h:233
static int es_out_StopAllEs(es_out_t *p_out, vlc_es_id_t ***context)
Definition: es_out.h:156
Definition: es_out.h:90
Definition: es_out.h:52
static int es_out_SetRecordState(es_out_t *p_out, bool b_record)
Definition: es_out.h:190
Definition: es_out.h:54
Definition: es_out.h:72
Definition: es_out.h:45
static int es_out_UnsetEs(es_out_t *p_out, vlc_es_id_t *id)
Definition: es_out.h:126
Definition: es_out.h:78
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:142
static void es_out_SetEsCatIds(es_out_t *p_out, enum es_format_category_e cat, const char *str_ids)
Definition: es_out.h:148
Definition: input_internal.h:373
static void es_out_SetEsDelay(es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay)
Definition: es_out.h:180
Definition: es_out.h:35
Definition: es_out.h:31
Definition: es_out.h:66
Definition: es_out.h:60