00001 /***************************************************************************** 00002 * vlc_es_out.h: es_out (demuxer output) descriptor, queries and methods 00003 ***************************************************************************** 00004 * Copyright (C) 1999-2004 the VideoLAN team 00005 * $Id: 57fc5c003ad3d319f75c6dcbae650c1f45e50d28 $ 00006 * 00007 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00022 *****************************************************************************/ 00023 00024 #ifndef VLC_ES_OUT_H 00025 #define VLC_ES_OUT_H 1 00026 00027 /** 00028 * \file 00029 * This file defines functions and structures for handling es_out in stream output 00030 */ 00031 00032 /** 00033 * \defgroup es out Es Out 00034 * @{ 00035 */ 00036 00037 enum es_out_query_e 00038 { 00039 /* set ES selected for the es category (audio/video/spu) */ 00040 ES_OUT_SET_ES, /* arg1= es_out_id_t* */ 00041 ES_OUT_RESTART_ES, /* arg1= es_out_id_t* */ 00042 00043 /* set 'default' tag on ES (copied across from container) */ 00044 ES_OUT_SET_ES_DEFAULT, /* arg1= es_out_id_t* */ 00045 00046 /* force selection/unselection of the ES (bypass current mode) */ 00047 ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=bool */ 00048 ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=bool* */ 00049 00050 /* */ 00051 ES_OUT_SET_GROUP, /* arg1= int */ 00052 00053 /* PCR handling, DTS/PTS will be automatically computed using thoses PCR 00054 * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait 00055 * to slow down the demuxer so that it reads at the right speed. 00056 * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send 00057 * as you would normally do. 00058 */ 00059 ES_OUT_SET_PCR, /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/ 00060 ES_OUT_SET_GROUP_PCR, /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/ 00061 ES_OUT_RESET_PCR, /* no arg */ 00062 00063 /* Try not to use this one as it is a bit hacky */ 00064 ES_OUT_SET_ES_FMT, /* arg1= es_out_id_t* arg2=es_format_t* */ 00065 00066 /* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed */ 00067 ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=int64_t i_pts(microsecond) */ 00068 /* Set meta data for group (dynamic) (The vlc_meta_t is not modified nor released) */ 00069 ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=const vlc_meta_t */ 00070 /* Set epg for group (dynamic) (The vlc_epg_t is not modified nor released) */ 00071 ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=const vlc_epg_t */ 00072 /* */ 00073 ES_OUT_DEL_GROUP, /* arg1=int i_group */ 00074 00075 /* Set scrambled state for one es */ 00076 ES_OUT_SET_ES_SCRAMBLED_STATE, /* arg1=int i_group arg2=es_out_id_t* */ 00077 00078 /* Stop any buffering being done, and ask if es_out has no more data to 00079 * play. 00080 * It will not block and so MUST be used carrefully. The only good reason 00081 * is for interactive playback (like for DVD menu). 00082 * XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls. */ 00083 ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */ 00084 00085 /* Set global meta data (The vlc_meta_t is not modified nor released) */ 00086 ES_OUT_SET_META, /* arg1=const vlc_meta_t * */ 00087 00088 /* PCR system clock manipulation for external clock synchronization */ 00089 ES_OUT_GET_PCR_SYSTEM, /* arg1=mtime_t *, arg2=mtime_t * res=can fail */ 00090 ES_OUT_MODIFY_PCR_SYSTEM, /* arg1=int is_absolute, arg2=mtime_t, res=can fail */ 00091 00092 /* First value usable for private control */ 00093 ES_OUT_PRIVATE_START = 0x10000, 00094 }; 00095 00096 struct es_out_t 00097 { 00098 es_out_id_t *(*pf_add) ( es_out_t *, const es_format_t * ); 00099 int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * ); 00100 void (*pf_del) ( es_out_t *, es_out_id_t * ); 00101 int (*pf_control)( es_out_t *, int i_query, va_list ); 00102 void (*pf_destroy)( es_out_t * ); 00103 00104 es_out_sys_t *p_sys; 00105 }; 00106 00107 LIBVLC_USED 00108 static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt ) 00109 { 00110 return out->pf_add( out, fmt ); 00111 } 00112 00113 static inline void es_out_Del( es_out_t *out, es_out_id_t *id ) 00114 { 00115 out->pf_del( out, id ); 00116 } 00117 00118 static inline int es_out_Send( es_out_t *out, es_out_id_t *id, 00119 block_t *p_block ) 00120 { 00121 return out->pf_send( out, id, p_block ); 00122 } 00123 00124 static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args ) 00125 { 00126 return out->pf_control( out, i_query, args ); 00127 } 00128 00129 static inline int es_out_Control( es_out_t *out, int i_query, ... ) 00130 { 00131 va_list args; 00132 int i_result; 00133 00134 va_start( args, i_query ); 00135 i_result = es_out_vaControl( out, i_query, args ); 00136 va_end( args ); 00137 return i_result; 00138 } 00139 00140 static inline void es_out_Delete( es_out_t *p_out ) 00141 { 00142 p_out->pf_destroy( p_out ); 00143 } 00144 00145 static inline int es_out_ControlSetMeta( es_out_t *out, const vlc_meta_t *p_meta ) 00146 { 00147 return es_out_Control( out, ES_OUT_SET_META, p_meta ); 00148 } 00149 00150 static inline int es_out_ControlGetPcrSystem( es_out_t *out, mtime_t *pi_system, mtime_t *pi_delay ) 00151 { 00152 return es_out_Control( out, ES_OUT_GET_PCR_SYSTEM, pi_system, pi_delay ); 00153 } 00154 static inline int es_out_ControlModifyPcrSystem( es_out_t *out, bool b_absolute, mtime_t i_system ) 00155 { 00156 return es_out_Control( out, ES_OUT_MODIFY_PCR_SYSTEM, b_absolute, i_system ); 00157 } 00158 00159 /** 00160 * @} 00161 */ 00162 00163 #endif
1.5.6