vlc_es_out.h

Go to the documentation of this file.
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$
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  * \defgroup es out Es Out
00029  * @{
00030  */
00031 
00032 enum es_out_mode_e
00033 {
00034     ES_OUT_MODE_NONE,   /* don't select anything */
00035     ES_OUT_MODE_ALL,    /* eg for stream output */
00036     ES_OUT_MODE_AUTO,   /* best audio/video or for input follow audio-track, sub-track */
00037     ES_OUT_MODE_PARTIAL /* select programs given after --programs */
00038 };
00039 
00040 enum es_out_query_e
00041 {
00042     /* activate application of mode */
00043     ES_OUT_SET_ACTIVE,  /* arg1= bool                     */
00044     /* see if mode is currently aplied or not */
00045     ES_OUT_GET_ACTIVE,  /* arg1= bool*                    */
00046 
00047     /* set/get mode */
00048     ES_OUT_SET_MODE,    /* arg1= int                            */
00049     ES_OUT_GET_MODE,    /* arg2= int*                           */
00050 
00051     /* set ES selected for the es category (audio/video/spu) */
00052     ES_OUT_SET_ES,      /* arg1= es_out_id_t*                   */
00053 
00054     /* set 'default' tag on ES (copied across from container) */
00055     ES_OUT_SET_DEFAULT, /* arg1= es_out_id_t*                   */
00056 
00057     /* force selection/unselection of the ES (bypass current mode) */
00058     ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=bool   */
00059     ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=bool*  */
00060 
00061     /* */
00062     ES_OUT_SET_GROUP,   /* arg1= int                            */
00063     ES_OUT_GET_GROUP,   /* arg1= int*                           */
00064 
00065     /* PCR handling, DTS/PTS will be automatically computed using thoses PCR
00066      * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
00067      * to slow down the demuxer so that it reads at the right speed.
00068      * XXX: if you want PREROLL just call RESET_PCR and
00069      * ES_OUT_SET_NEXT_DISPLAY_TIME and send data to the decoder *without*
00070      * calling SET_PCR until preroll is finished.
00071      */
00072     ES_OUT_SET_PCR,             /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
00073     ES_OUT_SET_GROUP_PCR,       /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
00074     ES_OUT_RESET_PCR,           /* no arg */
00075 
00076     /* Timestamp handling, convert an input timestamp to a global clock one.
00077      * (shouldn't have to be used by input plugins directly) */
00078     ES_OUT_GET_TS,             /* arg1=int64_t i_ts(microsecond!) (using default group 0), arg2=int64_t* converted i_ts */
00079 
00080     /* Try not to use this one as it is a bit hacky */
00081     ES_OUT_SET_FMT,     /* arg1= es_out_id_t* arg2=es_format_t* */
00082 
00083     /* Allow preroll of data (data with dts/pts < i_pts for one ES will be decoded but not displayed */
00084     ES_OUT_SET_NEXT_DISPLAY_TIME,   /* arg1=es_out_id_t* arg2=int64_t i_pts(microsecond) */
00085     /* Set meta data for group (dynamic) */
00086     ES_OUT_SET_GROUP_META,  /* arg1=int i_group arg2=vlc_meta_t */
00087     /* Set epg for group (dynamic) */
00088     ES_OUT_SET_GROUP_EPG,   /* arg1=int i_group arg2=vlc_epg_t */
00089     /* */
00090     ES_OUT_DEL_GROUP        /* arg1=int i_group */
00091 };
00092 
00093 struct es_out_t
00094 {
00095     es_out_id_t *(*pf_add)    ( es_out_t *, es_format_t * );
00096     int          (*pf_send)   ( es_out_t *, es_out_id_t *, block_t * );
00097     void         (*pf_del)    ( es_out_t *, es_out_id_t * );
00098     int          (*pf_control)( es_out_t *, int i_query, va_list );
00099     bool      b_sout;
00100 
00101     es_out_sys_t    *p_sys;
00102 };
00103 
00104 static inline es_out_id_t * es_out_Add( es_out_t *out, es_format_t *fmt )
00105 {
00106     return out->pf_add( out, fmt );
00107 }
00108 static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
00109 {
00110     out->pf_del( out, id );
00111 }
00112 static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
00113                                block_t *p_block )
00114 {
00115     return out->pf_send( out, id, p_block );
00116 }
00117 
00118 static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
00119 {
00120     return out->pf_control( out, i_query, args );
00121 }
00122 static inline int es_out_Control( es_out_t *out, int i_query, ... )
00123 {
00124     va_list args;
00125     int     i_result;
00126 
00127     va_start( args, i_query );
00128     i_result = es_out_vaControl( out, i_query, args );
00129     va_end( args );
00130     return i_result;
00131 }
00132 
00133 /**
00134  * @}
00135  */
00136 
00137 #endif

Generated on Wed Aug 13 08:02:37 2008 for VLC by  doxygen 1.5.1