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 ask if es_out has no more data to
90 * play.
91 * It will not block and so MUST be used carefully. The only good reason
92 * is for interactive playback (like for DVD menu).
93 * XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls. */
94 ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */
96 /* Set global meta data (The vlc_meta_t is not modified nor released) */
97 ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
99 ES_OUT_POST_SUBNODE, /* arg1=input_item_node_t *, res=can fail */
101 ES_OUT_VOUT_SET_MOUSE_EVENT, /* arg1= es_out_id_t* (video es),
102 arg2=vlc_mouse_event, arg3=void *(user_data),
103 res=can fail */
104
105 ES_OUT_VOUT_ADD_OVERLAY, /* arg1= es_out_id_t* (video es),
106 * arg2= subpicture_t *,
107 * arg3= size_t * (channel id), res= can fail */
108 ES_OUT_VOUT_DEL_OVERLAY, /* arg1= es_out_id_t* (video es),
109 * arg2= size_t (channel id), res= can fail */
110
111 ES_OUT_SPU_SET_HIGHLIGHT, /* arg1= es_out_id_t* (spu es),
112 arg2= const vlc_spu_highlight_t *, res=can fail */
113
114 /* First value usable for private control */
115 ES_OUT_PRIVATE_START = 0x10000,
117
120 ES_OUT_ES_POLICY_EXCLUSIVE = 0,/* Enforces single ES selection only */
121 ES_OUT_ES_POLICY_SIMULTANEOUS, /* Allows multiple ES per cat */
122 /* Exclusive by default, and simultaneous if specifically requested more
123 * than one track at once */
126
127struct es_out_callbacks
129 es_out_id_t *(*add)(es_out_t *, input_source_t *in, const es_format_t *);
131 void (*del)(es_out_t *, es_out_id_t *);
132 int (*control)(es_out_t *, input_source_t *in, int query, va_list);
133 void (*destroy)(es_out_t *);
134 /**
135 * Private control callback, must be NULL for es_out created from modules.
136 */
137 int (*priv_control)(es_out_t *, input_source_t *in, int query, va_list);
139
140struct es_out_t
142 const struct es_out_callbacks *cbs;
144
146static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt )
148 return out->cbs->add( out, NULL, fmt );
149}
150
151static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
153 out->cbs->del( out, id );
154}
155
156static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
157 block_t *p_block )
158{
159 return out->cbs->send( out, id, p_block );
160}
161
162static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
164 return out->cbs->control( out, NULL, i_query, args );
165}
166
167static inline int es_out_Control( es_out_t *out, int i_query, ... )
169 va_list args;
170 int i_result;
171
172 va_start( args, i_query );
173 i_result = es_out_vaControl( out, i_query, args );
174 va_end( args );
175 return i_result;
176}
177
178static inline void es_out_Delete( es_out_t *p_out )
180 p_out->cbs->destroy( p_out );
181}
182
183/* PCR handling, DTS/PTS will be automatically computed using those PCR
184 * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
185 * to slow down the demuxer so that it reads at the right speed.
186 * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
187 * as you would normally do.
188 */
189static inline int es_out_SetPCR( es_out_t *out, vlc_tick_t pcr )
191 return es_out_Control( out, ES_OUT_SET_PCR, pcr );
192}
193
194/* Reset the PCR */
195VLC_USED static inline int es_out_ResetPCR( es_out_t *out )
197 return es_out_Control( out, ES_OUT_RESET_PCR );
198}
199
200/* Set or change the selected ES in its category (audio/video/spu) */
201VLC_USED static inline int es_out_SetES( es_out_t *out, es_out_id_t *id )
203 return es_out_Control( out, ES_OUT_SET_ES, id );
204}
205
206/* Unset selected ES */
207VLC_USED static inline int es_out_UnsetES( es_out_t *out, es_out_id_t *id )
209 return es_out_Control( out, ES_OUT_UNSET_ES, id );
210}
211
212/* Restart the selected ES */
213VLC_USED static inline int es_out_RestartES( es_out_t *out, es_out_id_t *id )
215 return es_out_Control( out, ES_OUT_RESTART_ES, id );
216}
217
218/* Set or change the default ES */
219VLC_USED static inline int es_out_SetESDefault( es_out_t *out, es_out_id_t *id )
221 return es_out_Control( out, ES_OUT_SET_ES_DEFAULT, id );
222}
223
224/* Force (un)selection of the ES (bypass current mode) */
225VLC_USED static inline int es_out_SetESState( es_out_t *out, es_out_id_t *id, bool state )
227 return es_out_Control( out, ES_OUT_SET_ES_STATE, id, state );
228}
229
230/* This will update the fmt, drain and restart the decoder (if any).
231 * The new fmt must have the same i_cat and i_id. */
232VLC_USED static inline int es_out_SetESFmt( es_out_t *out, es_format_t *fmt )
234 return es_out_Control( out, ES_OUT_SET_ES_FMT, fmt );
235}
236
237/* Sets ES selection policy when in auto mode */
238VLC_USED static inline int es_out_SetESCatPolicy( es_out_t *out, enum es_format_category_e cat, enum es_out_policy_e policy )
240 return es_out_Control( out, ES_OUT_SET_ES_CAT_POLICY, cat, policy );
241}
242
243/* Get the selected state of the ES */
244VLC_USED static inline bool es_out_GetESState( es_out_t *out, es_out_id_t *id)
246 bool state = false;
247
249 return state;
250}
251
252/* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed) */
253VLC_USED static inline int es_out_SetNextDisplayTime( es_out_t *out, vlc_tick_t ndt )
256}
257
258/* Set global meta data (The vlc_meta_t is not modified nor released) */
259VLC_USED static inline int es_out_SetMeta( es_out_t *out, const vlc_meta_t *meta )
261 return es_out_Control( out, ES_OUT_SET_META, meta );
262}
263#define es_out_ControlSetMeta es_out_SetMeta
265/**
266 * @}
267 */
268
269#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:260
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:239
static int es_out_SetESDefault(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:220
static es_out_id_t * es_out_Add(es_out_t *out, const es_format_t *fmt)
Definition vlc_es_out.h:147
static int es_out_RestartES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:214
static int es_out_Send(es_out_t *out, es_out_id_t *id, block_t *p_block)
Definition vlc_es_out.h:157
es_out_policy_e
Definition vlc_es_out.h:120
static int es_out_SetPCR(es_out_t *out, vlc_tick_t pcr)
Definition vlc_es_out.h:190
static int es_out_ResetPCR(es_out_t *out)
Definition vlc_es_out.h:196
static int es_out_SetESState(es_out_t *out, es_out_id_t *id, bool state)
Definition vlc_es_out.h:226
static int es_out_SetNextDisplayTime(es_out_t *out, vlc_tick_t ndt)
Definition vlc_es_out.h:254
static int es_out_SetESFmt(es_out_t *out, es_format_t *fmt)
Definition vlc_es_out.h:233
static int es_out_Control(es_out_t *out, int i_query,...)
Definition vlc_es_out.h:168
static bool es_out_GetESState(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:245
static void es_out_Del(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:152
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:208
static void es_out_Delete(es_out_t *p_out)
Definition vlc_es_out.h:179
static int es_out_SetES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:202
static int es_out_vaControl(es_out_t *out, int i_query, va_list args)
Definition vlc_es_out.h:163
@ ES_OUT_ES_POLICY_EXCLUSIVE
Definition vlc_es_out.h:121
@ ES_OUT_ES_POLICY_AUTO
Definition vlc_es_out.h:125
@ ES_OUT_ES_POLICY_SIMULTANEOUS
Definition vlc_es_out.h:122
@ 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_UNSET_ES
Definition vlc_es_out.h:44
@ ES_OUT_VOUT_DEL_OVERLAY
Definition vlc_es_out.h:109
@ ES_OUT_RESTART_ES
Definition vlc_es_out.h:45
@ ES_OUT_VOUT_ADD_OVERLAY
Definition vlc_es_out.h:106
@ ES_OUT_SET_GROUP_EPG
Definition vlc_es_out.h:80
@ ES_OUT_POST_SUBNODE
Definition vlc_es_out.h:100
@ ES_OUT_RESET_PCR
Definition vlc_es_out.h:69
@ ES_OUT_SPU_SET_HIGHLIGHT
Definition vlc_es_out.h:112
@ ES_OUT_GET_EMPTY
Definition vlc_es_out.h:95
@ 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:102
@ 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:116
@ ES_OUT_SET_META
Definition vlc_es_out.h:98
@ ES_OUT_SET_ES_SCRAMBLED_STATE
Definition vlc_es_out.h:88
@ ES_OUT_SET_ES
Definition vlc_es_out.h:43
@ ES_OUT_SET_PCR
Definition vlc_es_out.h:67
static thread_local struct @83 state
Definition vlc_es.h:633
Definition vlc_es_out.h:129
int(* control)(es_out_t *, input_source_t *in, int query, va_list)
Definition vlc_es_out.h:133
es_out_id_t *(* add)(es_out_t *, input_source_t *in, const es_format_t *)
Definition vlc_es_out.h:130
int(* send)(es_out_t *, es_out_id_t *, block_t *)
Definition vlc_es_out.h:131
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
void(* del)(es_out_t *, es_out_id_t *)
Definition vlc_es_out.h:132
void(* destroy)(es_out_t *)
Definition vlc_es_out.h:134
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
Definition vlc_frame.h:123
Definition meta.c:40
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