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
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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.
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.
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 *****************************************************************************/
24 #ifndef LIBVLC_INPUT_ES_OUT_H
25 #define LIBVLC_INPUT_ES_OUT_H 1
27 #include <vlc_common.h>
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 */
38 enum es_out_query_private_e
41 ES_OUT_SET_MODE
= ES_OUT_PRIVATE_START
, /* arg1= int */
43 /* Get date to wait before demuxing more data */
44 ES_OUT_GET_WAKE_UP
, /* arg1=vlc_tick_t* res=cannot fail */
46 /* Wrapper for some ES command to work with id */
47 ES_OUT_SET_ES_BY_ID
, /* arg1= int, arg2= bool (forced) */
48 ES_OUT_RESTART_ES_BY_ID
,
49 ES_OUT_SET_ES_DEFAULT_BY_ID
,
50 ES_OUT_GET_ES_OBJECTS_BY_ID
, /* arg1=int id, vlc_object_t **dec, vout_thread_t **, audio_output_t ** res=can fail*/
52 /* Stop all selected ES and save the stopped state in a context. free the
53 * context or call ES_OUT_STOP_ALL_ES */
54 ES_OUT_STOP_ALL_ES
, /* arg1=void ** */
55 /* Start all ES from the context returned by ES_OUT_STOP_ALL_ES */
56 ES_OUT_START_ALL_ES
, /* arg1=void * */
58 /* Get buffering state */
59 ES_OUT_GET_BUFFERING
, /* arg1=bool* res=cannot fail */
61 /* Set delay for a ES category */
62 ES_OUT_SET_DELAY
, /* arg1=es_category_e, res=cannot fail */
64 /* Set record state */
65 ES_OUT_SET_RECORD_STATE
, /* arg1=bool res=can fail */
68 ES_OUT_SET_PAUSE_STATE
, /* arg1=bool b_source_paused, bool b_paused arg2=vlc_tick_t res=can fail */
71 ES_OUT_SET_RATE
, /* arg1=double source_rate arg2=double rate res=can fail */
74 ES_OUT_SET_FRAME_NEXT
, /* res=can fail */
76 /* Set position/time/length */
77 ES_OUT_SET_TIMES
, /* arg1=double f_position arg2=vlc_tick_t i_time arg3=vlc_tick_t i_length res=cannot fail */
80 ES_OUT_SET_JITTER
, /* arg1=vlc_tick_t i_pts_delay arg2= vlc_tick_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
82 /* Get forced group */
83 ES_OUT_GET_GROUP_FORCED
, /* arg1=int * res=cannot fail */
85 /* Set End Of Stream */
86 ES_OUT_SET_EOS
, /* res=cannot fail */
88 /* Set a VBI/Teletext page */
89 ES_OUT_SET_VBI_PAGE
, /* arg1=unsigned res=can fail */
91 /* Set VBI/Teletext menu transparent */
92 ES_OUT_SET_VBI_TRANSPARENCY
/* arg1=bool res=can fail */
95 static inline void es_out_SetMode( es_out_t
*p_out
, int i_mode
)
97 int i_ret
= es_out_Control( p_out
, ES_OUT_SET_MODE
, i_mode
);
100 static inline vlc_tick_t
es_out_GetWakeup( es_out_t
*p_out
)
103 int i_ret
= es_out_Control( p_out
, ES_OUT_GET_WAKE_UP
, &i_wu
);
108 static inline bool es_out_GetBuffering( es_out_t
*p_out
)
111 int i_ret
= es_out_Control( p_out
, ES_OUT_GET_BUFFERING
, &b
);
116 static inline bool es_out_GetEmpty( es_out_t
*p_out
)
119 int i_ret
= es_out_Control( p_out
, ES_OUT_GET_EMPTY
, &b
);
124 static inline void es_out_SetDelay( es_out_t
*p_out
, int i_cat
, vlc_tick_t i_delay
)
126 int i_ret
= es_out_Control( p_out
, ES_OUT_SET_DELAY
, i_cat
, i_delay
);
129 static inline int es_out_SetRecordState( es_out_t
*p_out
, bool b_record
)
131 return es_out_Control( p_out
, ES_OUT_SET_RECORD_STATE
, b_record
);
133 static inline int es_out_SetPauseState( es_out_t
*p_out
, bool b_source_paused
, bool b_paused
, vlc_tick_t i_date
)
135 return es_out_Control( p_out
, ES_OUT_SET_PAUSE_STATE
, b_source_paused
, b_paused
, i_date
);
137 static inline int es_out_SetRate( es_out_t
*p_out
, float source_rate
, float rate
)
139 return es_out_Control( p_out
, ES_OUT_SET_RATE
, source_rate
, rate
);
141 static inline int es_out_SetFrameNext( es_out_t
*p_out
)
143 return es_out_Control( p_out
, ES_OUT_SET_FRAME_NEXT
);
145 static inline void es_out_SetTimes( es_out_t
*p_out
, double f_position
, vlc_tick_t i_time
, vlc_tick_t i_length
)
147 int i_ret
= es_out_Control( p_out
, ES_OUT_SET_TIMES
, f_position
, i_time
, i_length
);
150 static inline void es_out_SetJitter( es_out_t
*p_out
,
151 vlc_tick_t i_pts_delay
, vlc_tick_t i_pts_jitter
, int i_cr_average
)
153 int i_ret
= es_out_Control( p_out
, ES_OUT_SET_JITTER
,
154 i_pts_delay
, i_pts_jitter
, i_cr_average
);
157 static inline int es_out_GetEsObjects( es_out_t
*p_out
, int i_id
,
158 vlc_object_t
**pp_decoder
, vout_thread_t
**pp_vout
, audio_output_t
**pp_aout
)
160 return es_out_Control( p_out
, ES_OUT_GET_ES_OBJECTS_BY_ID
, i_id
, pp_decoder
, pp_vout
, pp_aout
);
162 static inline int es_out_GetGroupForced( es_out_t
*p_out
)
165 int i_ret
= es_out_Control( p_out
, ES_OUT_GET_GROUP_FORCED
, &i_group
);
169 static inline void es_out_Eos( es_out_t
*p_out
)
171 int i_ret
= es_out_Control( p_out
, ES_OUT_SET_EOS
);
175 es_out_t
*input_EsOutNew( input_thread_t
*, float rate
);
176 es_out_t
*input_EsOutTimeshiftNew( input_thread_t
*, es_out_t
*, float i_rate
);