es_out.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * es_out.h: Input es_out functions
00003  *****************************************************************************
00004  * Copyright (C) 1998-2008 VLC authors and VideoLAN
00005  * Copyright (C) 2008 Laurent Aimar
00006  * $Id: 56cefed7c99acf5898d9a7064b1ee3dac50f5449 $
00007  *
00008  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
00009  *
00010  * This program is free software; you can redistribute it and/or modify it
00011  * under the terms of the GNU Lesser General Public License as published by
00012  * the Free Software Foundation; either version 2.1 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018  * GNU Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public License
00021  * along with this program; if not, write to the Free Software Foundation,
00022  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef LIBVLC_INPUT_ES_OUT_H
00026 #define LIBVLC_INPUT_ES_OUT_H 1
00027 
00028 #include <vlc_common.h>
00029 
00030 enum es_out_mode_e
00031 {
00032     ES_OUT_MODE_NONE,   /* don't select anything */
00033     ES_OUT_MODE_ALL,    /* eg for stream output */
00034     ES_OUT_MODE_AUTO,   /* best audio/video or for input follow audio-track, sub-track */
00035     ES_OUT_MODE_PARTIAL,/* select programs given after --programs */
00036     ES_OUT_MODE_END     /* mark the es_out as dead */
00037 };
00038 
00039 enum es_out_query_private_e
00040 {
00041     /* set/get mode */
00042     ES_OUT_SET_MODE = ES_OUT_PRIVATE_START,         /* arg1= int                            */
00043 
00044     /* Get date to wait before demuxing more data */
00045     ES_OUT_GET_WAKE_UP,                             /* arg1=mtime_t*            res=cannot fail */
00046 
00047     /* Wrapper for some ES command to work with id */
00048     ES_OUT_SET_ES_BY_ID,
00049     ES_OUT_RESTART_ES_BY_ID,
00050     ES_OUT_SET_ES_DEFAULT_BY_ID,
00051     ES_OUT_GET_ES_OBJECTS_BY_ID,                    /* arg1=int id, vlc_object_t **dec, vout_thread_t **, audio_output_t ** res=can fail*/
00052 
00053     /* Get buffering state */
00054     ES_OUT_GET_BUFFERING,                           /* arg1=bool*               res=cannot fail */
00055 
00056     /* Set delay for a ES category */
00057     ES_OUT_SET_DELAY,                               /* arg1=es_category_e,      res=cannot fail */
00058 
00059     /* Set record state */
00060     ES_OUT_SET_RECORD_STATE,                        /* arg1=bool                res=can fail */
00061 
00062     /* Set pause state */
00063     ES_OUT_SET_PAUSE_STATE,                         /* arg1=bool b_source_paused, bool b_paused arg2=mtime_t   res=can fail */
00064 
00065     /* Set rate */
00066     ES_OUT_SET_RATE,                                /* arg1=int i_source_rate arg2=int i_rate                  res=can fail */
00067 
00068     /* Set a new time */
00069     ES_OUT_SET_TIME,                                /* arg1=mtime_t             res=can fail */
00070 
00071     /* Set next frame */
00072     ES_OUT_SET_FRAME_NEXT,                          /*                          res=can fail */
00073 
00074     /* Set position/time/length */
00075     ES_OUT_SET_TIMES,                               /* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */
00076 
00077     /* Set jitter */
00078     ES_OUT_SET_JITTER,                              /* arg1=mtime_t i_pts_delay arg2= mtime_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
00079 
00080     /* Get forced group */
00081     ES_OUT_GET_GROUP_FORCED,                        /* arg1=int * res=cannot fail */
00082 
00083     /* Set End Of Stream */
00084     ES_OUT_SET_EOS,                                 /* res=cannot fail */
00085 };
00086 
00087 static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
00088 {
00089     int i_ret = es_out_Control( p_out, ES_OUT_SET_MODE, i_mode );
00090     assert( !i_ret );
00091 }
00092 static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
00093 {
00094     mtime_t i_wu;
00095     int i_ret = es_out_Control( p_out, ES_OUT_GET_WAKE_UP, &i_wu );
00096 
00097     assert( !i_ret );
00098     return i_wu;
00099 }
00100 static inline bool es_out_GetBuffering( es_out_t *p_out )
00101 {
00102     bool b;
00103     int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
00104 
00105     assert( !i_ret );
00106     return b;
00107 }
00108 static inline bool es_out_GetEmpty( es_out_t *p_out )
00109 {
00110     bool b;
00111     int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
00112 
00113     assert( !i_ret );
00114     return b;
00115 }
00116 static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
00117 {
00118     int i_ret = es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
00119     assert( !i_ret );
00120 }
00121 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
00122 {
00123     return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record );
00124 }
00125 static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, mtime_t i_date )
00126 {
00127     return es_out_Control( p_out, ES_OUT_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
00128 }
00129 static inline int es_out_SetRate( es_out_t *p_out, int i_source_rate, int i_rate )
00130 {
00131     return es_out_Control( p_out, ES_OUT_SET_RATE, i_source_rate, i_rate );
00132 }
00133 static inline int es_out_SetTime( es_out_t *p_out, mtime_t i_date )
00134 {
00135     return es_out_Control( p_out, ES_OUT_SET_TIME, i_date );
00136 }
00137 static inline int es_out_SetFrameNext( es_out_t *p_out )
00138 {
00139     return es_out_Control( p_out, ES_OUT_SET_FRAME_NEXT );
00140 }
00141 static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t i_time, mtime_t i_length )
00142 {
00143     int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length );
00144     assert( !i_ret );
00145 }
00146 static inline void es_out_SetJitter( es_out_t *p_out,
00147                                      mtime_t i_pts_delay, mtime_t i_pts_jitter, int i_cr_average )
00148 {
00149     int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER,
00150                                 i_pts_delay, i_pts_jitter, i_cr_average );
00151     assert( !i_ret );
00152 }
00153 static inline int es_out_GetEsObjects( es_out_t *p_out, int i_id,
00154                                        vlc_object_t **pp_decoder, vout_thread_t **pp_vout, audio_output_t **pp_aout )
00155 {
00156     return es_out_Control( p_out, ES_OUT_GET_ES_OBJECTS_BY_ID, i_id, pp_decoder, pp_vout, pp_aout );
00157 }
00158 static inline int es_out_GetGroupForced( es_out_t *p_out )
00159 {
00160     int i_group;
00161     int i_ret = es_out_Control( p_out, ES_OUT_GET_GROUP_FORCED, &i_group );
00162     assert( !i_ret );
00163     return i_group;
00164 }
00165 static inline void es_out_Eos( es_out_t *p_out )
00166 {
00167     int i_ret = es_out_Control( p_out, ES_OUT_SET_EOS );
00168     assert( !i_ret );
00169 }
00170 
00171 es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
00172 
00173 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines