• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/opt.h

Go to the documentation of this file.
00001 /*
00002  * AVOptions
00003  * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00022 #ifndef AVCODEC_OPT_H
00023 #define AVCODEC_OPT_H
00024 
00030 #include "libavutil/rational.h"
00031 #include "avcodec.h"
00032 
00033 enum AVOptionType{
00034     FF_OPT_TYPE_FLAGS,
00035     FF_OPT_TYPE_INT,
00036     FF_OPT_TYPE_INT64,
00037     FF_OPT_TYPE_DOUBLE,
00038     FF_OPT_TYPE_FLOAT,
00039     FF_OPT_TYPE_STRING,
00040     FF_OPT_TYPE_RATIONAL,
00041     FF_OPT_TYPE_BINARY,  
00042     FF_OPT_TYPE_CONST=128,
00043 };
00044 
00048 typedef struct AVOption {
00049     const char *name;
00050 
00055     const char *help;
00056 
00061     int offset;
00062     enum AVOptionType type;
00063 
00067     double default_val;
00068     double min;                 
00069     double max;                 
00070 
00071     int flags;
00072 #define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
00073 #define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
00074 #define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
00075 #define AV_OPT_FLAG_AUDIO_PARAM     8
00076 #define AV_OPT_FLAG_VIDEO_PARAM     16
00077 #define AV_OPT_FLAG_SUBTITLE_PARAM  32
00078 //FIXME think about enc-audio, ... style flags
00079 
00085     const char *unit;
00086 } AVOption;
00087 
00094 typedef struct AVOption2 {
00095     const char *name;
00096 
00101     const char *help;
00102 
00107     int offset;
00108     enum AVOptionType type;
00109 
00113     union {
00114         double dbl;
00115         const char *str;
00116     } default_val;
00117 
00118     double min;                 
00119     double max;                 
00120 
00121     int flags;
00122 /*
00123 #define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
00124 #define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
00125 #define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
00126 #define AV_OPT_FLAG_AUDIO_PARAM     8
00127 #define AV_OPT_FLAG_VIDEO_PARAM     16
00128 #define AV_OPT_FLAG_SUBTITLE_PARAM  32
00129 */
00130 //FIXME think about enc-audio, ... style flags
00131 
00137     const char *unit;
00138 } AVOption2;
00139 
00140 
00153 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
00154 
00155 #if LIBAVCODEC_VERSION_MAJOR < 53
00156 
00159 attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
00160 
00167 attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
00168 #endif
00169 
00197 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
00198 
00199 const AVOption *av_set_double(void *obj, const char *name, double n);
00200 const AVOption *av_set_q(void *obj, const char *name, AVRational n);
00201 const AVOption *av_set_int(void *obj, const char *name, int64_t n);
00202 double av_get_double(void *obj, const char *name, const AVOption **o_out);
00203 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
00204 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
00205 const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
00206 const AVOption *av_next_option(void *obj, const AVOption *last);
00207 int av_opt_show(void *obj, void *av_log_obj);
00208 void av_opt_set_defaults(void *s);
00209 void av_opt_set_defaults2(void *s, int mask, int flags);
00210 
00211 #endif /* AVCODEC_OPT_H */

Generated on Fri Sep 16 2011 17:17:41 for FFmpeg by  doxygen 1.7.1