VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_es_out.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_es_out.h: es_out (demuxer output) descriptor, queries and methods
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VLC authors and VideoLAN
5 *
6 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
22
23#ifndef VLC_ES_OUT_H
24#define VLC_ES_OUT_H 1
25
26#include <vlc_es.h>
27
28#include <vlc_tick.h>
29
30/**
31 * \defgroup es_out ES output
32 * \ingroup input
33 * Elementary streams output
34 * @{
35 * \file
36 * Elementary streams output interface
37 */
38
41 /* set or change the selected ES in its category (audio/video/spu) */
42 ES_OUT_SET_ES, /* arg1= es_out_id_t* */
43 ES_OUT_UNSET_ES, /* arg1= es_out_id_t* res=can fail */
44 ES_OUT_RESTART_ES, /* arg1= es_out_id_t* */
46 /* set 'default' tag on ES (copied across from container) */
47 ES_OUT_SET_ES_DEFAULT, /* arg1= es_out_id_t* */
49 /* force (un)selection of the ES (bypass current mode)
50 XXX: this will not change the state of any other ES ! (see SET_ES) */
51 ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=bool */
52 ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=bool* */
54 /* sets es selection policy when in auto mode */
55 ES_OUT_SET_ES_CAT_POLICY, /* arg1=es_format_category_e arg2=es_out_policy_e */
57 /* */
58 ES_OUT_SET_GROUP, /* arg1= int */
60 /* PCR handling, DTS/PTS will be automatically computed using those PCR
61 * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
62 * to slow down the demuxer so that it reads at the right speed.
63 * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
64 * as you would normally do.
65 */
66 ES_OUT_SET_PCR, /* arg1=vlc_tick_t i_pcr(microsecond!) (using default group 0)*/
67 ES_OUT_SET_GROUP_PCR, /* arg1= int i_group, arg2=vlc_tick_t i_pcr(microsecond!)*/
68 ES_OUT_RESET_PCR, /* no arg */
70 /* This will update the fmt, drain and restart the decoder (if any).
71 * The new fmt must have the same i_cat and i_id. */
72 ES_OUT_SET_ES_FMT, /* arg1= es_out_id_t* arg2=es_format_t* res=can fail */
74 /* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed */
75 ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=vlc_tick_t i_pts(microsecond) */
76 /* Set meta data for group (dynamic) (The vlc_meta_t is not modified nor released) */
77 ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=const vlc_meta_t */
78 /* Set epg for group (dynamic) (The vlc_epg_t is not modified nor released) */
79 ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=const vlc_epg_t * */
80 ES_OUT_SET_GROUP_EPG_EVENT, /* arg1=int i_group arg2=const vlc_epg_event_t * */
81 ES_OUT_SET_EPG_TIME, /* arg1=int int64_t */
83 /* */
84 ES_OUT_DEL_GROUP, /* arg1=int i_group */
86 /* Set scrambled state for one es */
87 ES_OUT_SET_ES_SCRAMBLED_STATE, /* arg1=int i_group arg2=es_out_id_t* */
89 /* Stop any buffering being done, and drain
90 * It will not block and so MUST be used carefully. The only good reason
91 * is for interactive playback (like for DVD menu).
92 * XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls in case of success. */
93 ES_OUT_DRAIN, /* res=can fail */
95 /* Ask if es_out has no more data to play */
96 ES_OUT_IS_EMPTY, /* arg1=bool* res=cannot fail */
98 /* Set global meta data (The vlc_meta_t is not modified nor released) */
99 ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
101 ES_OUT_POST_SUBNODE, /* arg1=input_item_node_t *, res=can fail */
103 ES_OUT_VOUT_SET_MOUSE_EVENT, /* arg1= es_out_id_t* (video es),
104 arg2=vlc_mouse_event, arg3=void *(user_data),
105 res=can fail */
106
107 ES_OUT_VOUT_ADD_OVERLAY, /* arg1= es_out_id_t* (video es),
108 * arg2= subpicture_t *,
109 * arg3= size_t * (channel id), res= can fail */
110 ES_OUT_VOUT_DEL_OVERLAY, /* arg1= es_out_id_t* (video es),
111 * arg2= size_t (channel id), res= can fail */
112
113 ES_OUT_SPU_SET_HIGHLIGHT, /* arg1= es_out_id_t* (spu es),
114 arg2= const vlc_spu_highlight_t *, res=can fail */
115
116 /* First value usable for private control */
117 ES_OUT_PRIVATE_START = 0x10000,
119
122 ES_OUT_ES_POLICY_EXCLUSIVE = 0,/* Enforces single ES selection only */
123 ES_OUT_ES_POLICY_SIMULTANEOUS, /* Allows multiple ES per cat */
124 /* Exclusive by default, and simultaneous if specifically requested more
125 * than one track at once */
128
129struct es_out_callbacks
131 es_out_id_t *(*add)(es_out_t *, input_source_t *in, const es_format_t *);
133 void (*del)(es_out_t *, es_out_id_t *);
134 int (*control)(es_out_t *, input_source_t *in, int query, va_list);
135 void (*destroy)(es_out_t *);
137
138struct es_out_t
140 const struct es_out_callbacks *cbs;
142
144static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt )
146 return out->cbs->add( out, NULL, fmt );
147}
148
149static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
151 out->cbs->del( out, id );
152}
153
154static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
155 block_t *p_block )
156{
157 return out->cbs->send( out, id, p_block );
158}
159
160static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
162 return out->cbs->control( out, NULL, i_query, args );
163}
164
165static inline int es_out_Control( es_out_t *out, int i_query, ... )
167 va_list args;
168 int i_result;
169
170 va_start( args, i_query );
171 i_result = es_out_vaControl( out, i_query, args );
172 va_end( args );
173 return i_result;
174}
175
176static inline void es_out_Delete( es_out_t *p_out )
178 p_out->cbs->destroy( p_out );
179}
180
181/* PCR handling, DTS/PTS will be automatically computed using those PCR
182 * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
183 * to slow down the demuxer so that it reads at the right speed.
184 * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
185 * as you would normally do.
186 */
187static inline int es_out_SetPCR( es_out_t *out, vlc_tick_t pcr )
189 return es_out_Control( out, ES_OUT_SET_PCR, pcr );
190}
191
192/* Reset the PCR */
193VLC_USED static inline int es_out_ResetPCR( es_out_t *out )
195 return es_out_Control( out, ES_OUT_RESET_PCR );
196}
197
198/* Set or change the selected ES in its category (audio/video/spu) */
199VLC_USED static inline int es_out_SetES( es_out_t *out, es_out_id_t *id )
201 return es_out_Control( out, ES_OUT_SET_ES, id );
202}
203
204/* Unset selected ES */
205VLC_USED static inline int es_out_UnsetES( es_out_t *out, es_out_id_t *id )
207 return es_out_Control( out, ES_OUT_UNSET_ES, id );
208}
209
210/* Restart the selected ES */
211VLC_USED static inline int es_out_RestartES( es_out_t *out, es_out_id_t *id )
213 return es_out_Control( out, ES_OUT_RESTART_ES, id );
214}
215
216/* Set or change the default ES */
217VLC_USED static inline int es_out_SetESDefault( es_out_t *out, es_out_id_t *id )
219 return es_out_Control( out, ES_OUT_SET_ES_DEFAULT, id );
220}
221
222/* Force (un)selection of the ES (bypass current mode) */
223VLC_USED static inline int es_out_SetESState( es_out_t *out, es_out_id_t *id, bool state )
225 return es_out_Control( out, ES_OUT_SET_ES_STATE, id, state );
226}
227
228/* This will update the fmt, drain and restart the decoder (if any).
229 * The new fmt must have the same i_cat and i_id. */
230VLC_USED static inline int es_out_SetESFmt( es_out_t *out, es_format_t *fmt )
232 return es_out_Control( out, ES_OUT_SET_ES_FMT, fmt );
233}
234
235/* Sets ES selection policy when in auto mode */
236VLC_USED static inline int es_out_SetESCatPolicy( es_out_t *out, enum es_format_category_e cat, enum es_out_policy_e policy )
238 return es_out_Control( out, ES_OUT_SET_ES_CAT_POLICY, cat, policy );
239}
240
241/* Get the selected state of the ES */
242VLC_USED static inline bool es_out_GetESState( es_out_t *out, es_out_id_t *id)
244 bool state = false;
245
247 return state;
248}
249
250/* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed) */
251VLC_USED static inline int es_out_SetNextDisplayTime( es_out_t *out, vlc_tick_t ndt )
254}
255
256/* Set global meta data (The vlc_meta_t is not modified nor released) */
257VLC_USED static inline int es_out_SetMeta( es_out_t *out, const vlc_meta_t *meta )
259 return es_out_Control( out, ES_OUT_SET_META, meta );
260}
261#define es_out_ControlSetMeta es_out_SetMeta
263/**
264 * @}
265 */
266
267#endif
#define VLC_USED
Definition fourcc_gen.c:32
static int es_out_SetMeta(es_out_t *out, const vlc_meta_t *meta)
Definition vlc_es_out.h:258
static int es_out_SetESCatPolicy(es_out_t *out, enum es_format_category_e cat, enum es_out_policy_e policy)
Definition vlc_es_out.h:237
static int es_out_SetESDefault(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:218
static es_out_id_t * es_out_Add(es_out_t *out, const es_format_t *fmt)
Definition vlc_es_out.h:145
static int es_out_RestartES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:212
static int es_out_Send(es_out_t *out, es_out_id_t *id, block_t *p_block)
Definition vlc_es_out.h:155
es_out_policy_e
Definition vlc_es_out.h:122
static int es_out_SetPCR(es_out_t *out, vlc_tick_t pcr)
Definition vlc_es_out.h:188
static int es_out_ResetPCR(es_out_t *out)
Definition vlc_es_out.h:194
static int es_out_SetESState(es_out_t *out, es_out_id_t *id, bool state)
Definition vlc_es_out.h:224
static int es_out_SetNextDisplayTime(es_out_t *out, vlc_tick_t ndt)
Definition vlc_es_out.h:252
static int es_out_SetESFmt(es_out_t *out, es_format_t *fmt)
Definition vlc_es_out.h:231
static int es_out_Control(es_out_t *out, int i_query,...)
Definition vlc_es_out.h:166
static bool es_out_GetESState(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:243
static void es_out_Del(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:150
es_out_query_e
Definition vlc_es_out.h:41
static int es_out_UnsetES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:206
static void es_out_Delete(es_out_t *p_out)
Definition vlc_es_out.h:177
static int es_out_SetES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:200
static int es_out_vaControl(es_out_t *out, int i_query, va_list args)
Definition vlc_es_out.h:161
@ ES_OUT_ES_POLICY_EXCLUSIVE
Definition vlc_es_out.h:123
@ ES_OUT_ES_POLICY_AUTO
Definition vlc_es_out.h:127
@ ES_OUT_ES_POLICY_SIMULTANEOUS
Definition vlc_es_out.h:124
@ ES_OUT_SET_GROUP_EPG_EVENT
Definition vlc_es_out.h:81
@ ES_OUT_SET_GROUP
Definition vlc_es_out.h:59
@ ES_OUT_SET_GROUP_PCR
Definition vlc_es_out.h:68
@ ES_OUT_SET_EPG_TIME
Definition vlc_es_out.h:82
@ ES_OUT_SET_ES_CAT_POLICY
Definition vlc_es_out.h:56
@ ES_OUT_DRAIN
Definition vlc_es_out.h:94
@ ES_OUT_UNSET_ES
Definition vlc_es_out.h:44
@ ES_OUT_VOUT_DEL_OVERLAY
Definition vlc_es_out.h:111
@ ES_OUT_RESTART_ES
Definition vlc_es_out.h:45
@ ES_OUT_VOUT_ADD_OVERLAY
Definition vlc_es_out.h:108
@ ES_OUT_SET_GROUP_EPG
Definition vlc_es_out.h:80
@ ES_OUT_POST_SUBNODE
Definition vlc_es_out.h:102
@ ES_OUT_RESET_PCR
Definition vlc_es_out.h:69
@ ES_OUT_SPU_SET_HIGHLIGHT
Definition vlc_es_out.h:114
@ ES_OUT_SET_ES_DEFAULT
Definition vlc_es_out.h:48
@ ES_OUT_SET_NEXT_DISPLAY_TIME
Definition vlc_es_out.h:76
@ ES_OUT_DEL_GROUP
Definition vlc_es_out.h:85
@ ES_OUT_SET_ES_STATE
Definition vlc_es_out.h:52
@ ES_OUT_SET_ES_FMT
Definition vlc_es_out.h:73
@ ES_OUT_VOUT_SET_MOUSE_EVENT
Definition vlc_es_out.h:104
@ ES_OUT_GET_ES_STATE
Definition vlc_es_out.h:53
@ ES_OUT_SET_GROUP_META
Definition vlc_es_out.h:78
@ ES_OUT_PRIVATE_START
Definition vlc_es_out.h:118
@ ES_OUT_SET_META
Definition vlc_es_out.h:100
@ ES_OUT_SET_ES_SCRAMBLED_STATE
Definition vlc_es_out.h:88
@ ES_OUT_SET_ES
Definition vlc_es_out.h:43
@ ES_OUT_IS_EMPTY
Definition vlc_es_out.h:97
@ ES_OUT_SET_PCR
Definition vlc_es_out.h:67
static thread_local struct @82 state
Definition vlc_es.h:633
Definition vlc_es_out.h:131
int(* control)(es_out_t *, input_source_t *in, int query, va_list)
Definition vlc_es_out.h:135
es_out_id_t *(* add)(es_out_t *, input_source_t *in, const es_format_t *)
Definition vlc_es_out.h:132
int(* send)(es_out_t *, es_out_id_t *, block_t *)
Definition vlc_es_out.h:133
void(* del)(es_out_t *, es_out_id_t *)
Definition vlc_es_out.h:134
void(* destroy)(es_out_t *)
Definition vlc_es_out.h:136
Definition es_out.c:115
Definition vlc_es_out.h:140
const struct es_out_callbacks * cbs
Definition vlc_es_out.h:141
Definition source.h:35
Definition vlc_frame.h:123
Definition meta.c:46
This file is a collection of common definitions and types.
This file defines the elementary streams format types.
es_format_category_e
ES Categories.
Definition vlc_es.h:616
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48