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 *);
135
136struct es_out_t
138 const struct es_out_callbacks *cbs;
140
142static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt )
144 return out->cbs->add( out, NULL, fmt );
145}
146
147static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
149 out->cbs->del( out, id );
150}
151
152static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
153 block_t *p_block )
154{
155 return out->cbs->send( out, id, p_block );
156}
157
158static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
160 return out->cbs->control( out, NULL, i_query, args );
161}
162
163static inline int es_out_Control( es_out_t *out, int i_query, ... )
165 va_list args;
166 int i_result;
167
168 va_start( args, i_query );
169 i_result = es_out_vaControl( out, i_query, args );
170 va_end( args );
171 return i_result;
172}
173
174static inline void es_out_Delete( es_out_t *p_out )
176 p_out->cbs->destroy( p_out );
177}
178
179/* PCR handling, DTS/PTS will be automatically computed using those PCR
180 * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
181 * to slow down the demuxer so that it reads at the right speed.
182 * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
183 * as you would normally do.
184 */
185static inline int es_out_SetPCR( es_out_t *out, vlc_tick_t pcr )
187 return es_out_Control( out, ES_OUT_SET_PCR, pcr );
188}
189
190/* Reset the PCR */
191VLC_USED static inline int es_out_ResetPCR( es_out_t *out )
193 return es_out_Control( out, ES_OUT_RESET_PCR );
194}
195
196/* Set or change the selected ES in its category (audio/video/spu) */
197VLC_USED static inline int es_out_SetES( es_out_t *out, es_out_id_t *id )
199 return es_out_Control( out, ES_OUT_SET_ES, id );
200}
201
202/* Unset selected ES */
203VLC_USED static inline int es_out_UnsetES( es_out_t *out, es_out_id_t *id )
205 return es_out_Control( out, ES_OUT_UNSET_ES, id );
206}
207
208/* Restart the selected ES */
209VLC_USED static inline int es_out_RestartES( es_out_t *out, es_out_id_t *id )
211 return es_out_Control( out, ES_OUT_RESTART_ES, id );
212}
213
214/* Set or change the default ES */
215VLC_USED static inline int es_out_SetESDefault( es_out_t *out, es_out_id_t *id )
217 return es_out_Control( out, ES_OUT_SET_ES_DEFAULT, id );
218}
219
220/* Force (un)selection of the ES (bypass current mode) */
221VLC_USED static inline int es_out_SetESState( es_out_t *out, es_out_id_t *id, bool state )
223 return es_out_Control( out, ES_OUT_SET_ES_STATE, id, state );
224}
225
226/* This will update the fmt, drain and restart the decoder (if any).
227 * The new fmt must have the same i_cat and i_id. */
228VLC_USED static inline int es_out_SetESFmt( es_out_t *out, es_format_t *fmt )
230 return es_out_Control( out, ES_OUT_SET_ES_FMT, fmt );
231}
232
233/* Sets ES selection policy when in auto mode */
234VLC_USED static inline int es_out_SetESCatPolicy( es_out_t *out, enum es_format_category_e cat, enum es_out_policy_e policy )
236 return es_out_Control( out, ES_OUT_SET_ES_CAT_POLICY, cat, policy );
237}
238
239/* Get the selected state of the ES */
240VLC_USED static inline bool es_out_GetESState( es_out_t *out, es_out_id_t *id)
242 bool state = false;
243
245 return state;
246}
247
248/* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed) */
249VLC_USED static inline int es_out_SetNextDisplayTime( es_out_t *out, vlc_tick_t ndt )
252}
253
254/* Set global meta data (The vlc_meta_t is not modified nor released) */
255VLC_USED static inline int es_out_SetMeta( es_out_t *out, const vlc_meta_t *meta )
257 return es_out_Control( out, ES_OUT_SET_META, meta );
258}
259#define es_out_ControlSetMeta es_out_SetMeta
261/**
262 * @}
263 */
264
265#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:256
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:235
static int es_out_SetESDefault(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:216
static es_out_id_t * es_out_Add(es_out_t *out, const es_format_t *fmt)
Definition vlc_es_out.h:143
static int es_out_RestartES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:210
static int es_out_Send(es_out_t *out, es_out_id_t *id, block_t *p_block)
Definition vlc_es_out.h:153
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:186
static int es_out_ResetPCR(es_out_t *out)
Definition vlc_es_out.h:192
static int es_out_SetESState(es_out_t *out, es_out_id_t *id, bool state)
Definition vlc_es_out.h:222
static int es_out_SetNextDisplayTime(es_out_t *out, vlc_tick_t ndt)
Definition vlc_es_out.h:250
static int es_out_SetESFmt(es_out_t *out, es_format_t *fmt)
Definition vlc_es_out.h:229
static int es_out_Control(es_out_t *out, int i_query,...)
Definition vlc_es_out.h:164
static bool es_out_GetESState(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:241
static void es_out_Del(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:148
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:204
static void es_out_Delete(es_out_t *p_out)
Definition vlc_es_out.h:175
static int es_out_SetES(es_out_t *out, es_out_id_t *id)
Definition vlc_es_out.h:198
static int es_out_vaControl(es_out_t *out, int i_query, va_list args)
Definition vlc_es_out.h:159
@ 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 @85 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
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:138
const struct es_out_callbacks * cbs
Definition vlc_es_out.h:139
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