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: 3c425ebca6ad2d117f1d53530d320cbb01a59526 $
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     /* First value usable for private control */
00089     ES_OUT_PRIVATE_START = 0x10000,
00090 };
00091 
00092 struct es_out_t
00093 {
00094     es_out_id_t *(*pf_add)    ( es_out_t *, const es_format_t * );
00095     int          (*pf_send)   ( es_out_t *, es_out_id_t *, block_t * );
00096     void         (*pf_del)    ( es_out_t *, es_out_id_t * );
00097     int          (*pf_control)( es_out_t *, int i_query, va_list );
00098     void         (*pf_destroy)( es_out_t * );
00099 
00100     bool         b_sout;
00101 
00102     es_out_sys_t    *p_sys;
00103 };
00104 
00105 LIBVLC_USED
00106 static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt )
00107 {
00108     return out->pf_add( out, fmt );
00109 }
00110 
00111 static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
00112 {
00113     out->pf_del( out, id );
00114 }
00115 
00116 static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
00117                                block_t *p_block )
00118 {
00119     return out->pf_send( out, id, p_block );
00120 }
00121 
00122 static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
00123 {
00124     return out->pf_control( out, i_query, args );
00125 }
00126 
00127 static inline int es_out_Control( es_out_t *out, int i_query, ... )
00128 {
00129     va_list args;
00130     int     i_result;
00131 
00132     va_start( args, i_query );
00133     i_result = es_out_vaControl( out, i_query, args );
00134     va_end( args );
00135     return i_result;
00136 }
00137 
00138 static inline void es_out_Delete( es_out_t *p_out )
00139 {
00140     p_out->pf_destroy( p_out );
00141 }
00142 
00143 static inline int es_out_ControlSetMeta( es_out_t *out, const vlc_meta_t *p_meta )
00144 {
00145     return es_out_Control( out, ES_OUT_SET_META, p_meta );
00146 }
00147 
00148 /**
00149  * @}
00150  */
00151 
00152 #endif

Generated on Sun Nov 22 08:05:13 2009 for VLC by  doxygen 1.5.6