comparison opt.h @ 10410:2d076fd5f927 libavcodec

Add an experimental AVOption2 that uses an union instead of double for default_val.
author michael
date Fri, 16 Oct 2009 12:31:32 +0000
parents 2887f410011f
children 7dd2a45249a9
comparison
equal deleted inserted replaced
10409:3c13cad19e29 10410:2d076fd5f927
82 * options and corresponding named constants share the same 82 * options and corresponding named constants share the same
83 * unit. May be NULL. 83 * unit. May be NULL.
84 */ 84 */
85 const char *unit; 85 const char *unit;
86 } AVOption; 86 } AVOption;
87
88 /**
89 * AVOption2.
90 * THIS IS NOT PART OF THE API/ABI YET!
91 * This is identical to AVOption except that default_val was replaced by
92 * an union, it should be compatible with AVOption on normal platforms.
93 */
94 typedef struct AVOption2 {
95 const char *name;
96
97 /**
98 * short English help text
99 * @todo What about other languages?
100 */
101 const char *help;
102
103 /**
104 * The offset relative to the context structure where the option
105 * value is stored. It should be 0 for named constants.
106 */
107 int offset;
108 enum AVOptionType type;
109
110 /**
111 * the default value for scalar options
112 */
113 union {
114 double dbl;
115 const char *str;
116 } default_val;
117
118 double min; ///< minimum valid value for the option
119 double max; ///< maximum valid value for the option
120
121 int flags;
122 /*
123 #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
124 #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
125 #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
126 #define AV_OPT_FLAG_AUDIO_PARAM 8
127 #define AV_OPT_FLAG_VIDEO_PARAM 16
128 #define AV_OPT_FLAG_SUBTITLE_PARAM 32
129 */
130 //FIXME think about enc-audio, ... style flags
131
132 /**
133 * The logical unit to which the option belongs. Non-constant
134 * options and corresponding named constants share the same
135 * unit. May be NULL.
136 */
137 const char *unit;
138 } AVOption2;
87 139
88 140
89 /** 141 /**
90 * Looks for an option in obj. Looks only for the options which 142 * Looks for an option in obj. Looks only for the options which
91 * have the flags set as specified in mask and flags (that is, 143 * have the flags set as specified in mask and flags (that is,