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

Generated on Mon Nov 22 07:55:20 2010 for VLC by  doxygen 1.5.6