annotate opt.h @ 12409:91db982aaaad libavcodec

fixed some return values and deprecated CODEC_TYPE_VIDEO. dithering (faster) along a linear gradient now.
author bindhammer
date Tue, 24 Aug 2010 14:02:31 +0000
parents fdafbcef52f5
children 7220936dc29c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
1 /*
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
2 * AVOptions
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
3 * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
4 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
9 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
15 * Lesser General Public License for more details.
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
16 *
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3702
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
20 */
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 2967
diff changeset
21
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7427
diff changeset
22 #ifndef AVCODEC_OPT_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7427
diff changeset
23 #define AVCODEC_OPT_H
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
24
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
25 /**
11644
7dd2a45249a9 Remove explicit filename from Doxygen @file commands.
diego
parents: 10410
diff changeset
26 * @file
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
27 * AVOptions
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
28 */
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
29
6395
9259af8a686b Install headers in $prefix/include/$libname
mru
parents: 6034
diff changeset
30 #include "libavutil/rational.h"
8579
dc7bfff68156 add the necessary include for LIBAV*_VERSION_*
aurel
parents: 8407
diff changeset
31 #include "avcodec.h"
5162
4394344397d8 include all prerequisites in header files
mru
parents: 4629
diff changeset
32
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
33 enum AVOptionType{
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
34 FF_OPT_TYPE_FLAGS,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
35 FF_OPT_TYPE_INT,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
36 FF_OPT_TYPE_INT64,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
37 FF_OPT_TYPE_DOUBLE,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
38 FF_OPT_TYPE_FLOAT,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
39 FF_OPT_TYPE_STRING,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
40 FF_OPT_TYPE_RATIONAL,
6034
72bb141d9c05 Add FF_OPT_TYPE_BINARY and use it to add a cryptokey option
reimar
parents: 5830
diff changeset
41 FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
42 FF_OPT_TYPE_CONST=128,
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
43 };
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
44
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
45 /**
7007
fa39bba4c8a4 minor spelling/grammar fixes
diego
parents: 6395
diff changeset
46 * AVOption
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
47 */
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
48 typedef struct AVOption {
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
49 const char *name;
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
50
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
51 /**
7007
fa39bba4c8a4 minor spelling/grammar fixes
diego
parents: 6395
diff changeset
52 * short English help text
fa39bba4c8a4 minor spelling/grammar fixes
diego
parents: 6395
diff changeset
53 * @todo What about other languages?
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
54 */
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
55 const char *help;
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
56
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
57 /**
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
58 * The offset relative to the context structure where the option
7099
07172377ec9f Fix typo in libavcodec/opt.h.
stefano
parents: 7086
diff changeset
59 * value is stored. It should be 0 for named constants.
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
60 */
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
61 int offset;
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
62 enum AVOptionType type;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2876
diff changeset
63
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
64 /**
7175
4a635a1859f0 Clarify/simplify documentation for the default_val field in AVOption.
stefano
parents: 7099
diff changeset
65 * the default value for scalar options
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
66 */
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
67 double default_val;
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
68 double min; ///< minimum valid value for the option
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
69 double max; ///< maximum valid value for the option
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2876
diff changeset
70
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
71 int flags;
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
72 #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
73 #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
74 #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
75 #define AV_OPT_FLAG_AUDIO_PARAM 8
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
76 #define AV_OPT_FLAG_VIDEO_PARAM 16
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
77 #define AV_OPT_FLAG_SUBTITLE_PARAM 32
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
78 //FIXME think about enc-audio, ... style flags
7086
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
79
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
80 /**
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
81 * The logical unit to which the option belongs. Non-constant
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
82 * options and corresponding named constants share the same
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
83 * unit. May be NULL.
18279e49cd4a Extend documentation for AVOption.
stefano
parents: 7007
diff changeset
84 */
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
85 const char *unit;
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
86 } AVOption;
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
87
10410
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
88 /**
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
89 * AVOption2.
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
90 * THIS IS NOT PART OF THE API/ABI YET!
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
91 * This is identical to AVOption except that default_val was replaced by
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
92 * an union, it should be compatible with AVOption on normal platforms.
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
93 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
94 typedef struct AVOption2 {
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
95 const char *name;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
96
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
97 /**
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
98 * short English help text
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
99 * @todo What about other languages?
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
100 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
101 const char *help;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
102
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
103 /**
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
104 * The offset relative to the context structure where the option
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
105 * value is stored. It should be 0 for named constants.
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
106 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
107 int offset;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
108 enum AVOptionType type;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
109
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
110 /**
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
111 * the default value for scalar options
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
112 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
113 union {
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
114 double dbl;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
115 const char *str;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
116 } default_val;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
117
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
118 double min; ///< minimum valid value for the option
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
119 double max; ///< maximum valid value for the option
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
120
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
121 int flags;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
122 /*
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
123 #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
124 #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
125 #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
126 #define AV_OPT_FLAG_AUDIO_PARAM 8
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
127 #define AV_OPT_FLAG_VIDEO_PARAM 16
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
128 #define AV_OPT_FLAG_SUBTITLE_PARAM 32
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
129 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
130 //FIXME think about enc-audio, ... style flags
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
131
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
132 /**
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
133 * The logical unit to which the option belongs. Non-constant
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
134 * options and corresponding named constants share the same
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
135 * unit. May be NULL.
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
136 */
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
137 const char *unit;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
138 } AVOption2;
2d076fd5f927 Add an experimental AVOption2 that uses an union instead of double for default_val.
michael
parents: 9822
diff changeset
139
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
140
7205
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
141 /**
12024
fdafbcef52f5 Fix grammar errors in documentation
mru
parents: 11644
diff changeset
142 * Look for an option in obj. Look only for the options which
9822
2887f410011f Remove '\p', '\c' and '\e' doxygen markup from doxy, as it should
stefano
parents: 9642
diff changeset
143 * have the flags set as specified in mask and flags (that is,
7205
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
144 * for which it is the case that opt->flags & mask == flags).
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
145 *
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
146 * @param[in] obj a pointer to a struct whose first element is a
8309
f73e7117bf67 s/#AVClass/AVClass/, consistent with the rest of the doxy.
stefano
parents: 7760
diff changeset
147 * pointer to an AVClass
7205
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
148 * @param[in] name the name of the option to look for
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
149 * @param[in] unit the unit of the option to look for, or any if NULL
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
150 * @return a pointer to the option found, or NULL if no option
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
151 * has been found
68528efbc91f Document av_find_opt().
stefano
parents: 7175
diff changeset
152 */
4628
b0016ed89048 make av_find_opt() available to the public and add a mask+flags parameter to search for specific AVOptions
michael
parents: 4369
diff changeset
153 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
7224
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
154
8407
8903ad65c412 Put under #if LIBAVCODEC_VERSION_MAJOR < 53 the deprecated functions
stefano
parents: 8356
diff changeset
155 #if LIBAVCODEC_VERSION_MAJOR < 53
7427
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
156 /**
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
157 * @see av_set_string2()
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
158 */
7224
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
159 attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
160
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
161 /**
8356
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
162 * @return a pointer to the AVOption corresponding to the field set or
9822
2887f410011f Remove '\p', '\c' and '\e' doxygen markup from doxy, as it should
stefano
parents: 9642
diff changeset
163 * NULL if no matching AVOption exists, or if the value val is not
8356
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
164 * valid
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
165 * @see av_set_string3()
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
166 */
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
167 attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
8407
8903ad65c412 Put under #if LIBAVCODEC_VERSION_MAJOR < 53 the deprecated functions
stefano
parents: 8356
diff changeset
168 #endif
8356
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
169
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
170 /**
12024
fdafbcef52f5 Fix grammar errors in documentation
mru
parents: 11644
diff changeset
171 * Set the field of obj with the given name to value.
7427
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
172 *
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
173 * @param[in] obj A struct whose first element is a pointer to an
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
174 * AVClass.
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
175 * @param[in] name the name of the field to set
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
176 * @param[in] val The value to set. If the field is not of a string
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
177 * type, then the given string is parsed.
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
178 * SI postfixes and some named scalars are supported.
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
179 * If the field is of a numeric type, it has to be a numeric or named
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
180 * scalar. Behavior with more than one scalar and +- infix operators
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
181 * is undefined.
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
182 * If the field is of a flags type, it has to be a sequence of numeric
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
183 * scalars or named flags separated by '+' or '-'. Prefixing a flag
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
184 * with '+' causes it to be set without affecting the other flags;
a725aab8fe81 Complete documentation for av_set_string().
stefano
parents: 7224
diff changeset
185 * similarly, '-' unsets a flag.
8356
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
186 * @param[out] o_out if non-NULL put here a pointer to the AVOption
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
187 * found
7224
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
188 * @param alloc when 1 then the old value will be av_freed() and the
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
189 * new av_strduped()
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
190 * when 0 then no av_free() nor av_strdup() will be used
9642
d706b300b89f Document av_set_string3() returned error codes.
stefano
parents: 8718
diff changeset
191 * @return 0 if the value has been set, or an AVERROR code in case of
d706b300b89f Document av_set_string3() returned error codes.
stefano
parents: 8718
diff changeset
192 * error:
d706b300b89f Document av_set_string3() returned error codes.
stefano
parents: 8718
diff changeset
193 * AVERROR(ENOENT) if no matching option exists
d706b300b89f Document av_set_string3() returned error codes.
stefano
parents: 8718
diff changeset
194 * AVERROR(ERANGE) if the value is out of range
d706b300b89f Document av_set_string3() returned error codes.
stefano
parents: 8718
diff changeset
195 * AVERROR(EINVAL) if the value is not valid
7224
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
196 */
8356
0030146fc2ba Implement av_set_string3().
stefano
parents: 8309
diff changeset
197 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
7224
d5a52b28c9de Fix the av_set_string() free / alloc issue.
michael
parents: 7205
diff changeset
198
4369
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
199 const AVOption *av_set_double(void *obj, const char *name, double n);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
200 const AVOption *av_set_q(void *obj, const char *name, AVRational n);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
201 const AVOption *av_set_int(void *obj, const char *name, int64_t n);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
202 double av_get_double(void *obj, const char *name, const AVOption **o_out);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
203 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
204 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
205 const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
e10acab2322a Constantize AVOption, solve few warnings, patch from flameeyes@gentoo.org aka "the other Diego"
lu_zero
parents: 3947
diff changeset
206 const AVOption *av_next_option(void *obj, const AVOption *last);
2876
8026edf6a349 avoid stdio.h
michael
parents: 2874
diff changeset
207 int av_opt_show(void *obj, void *av_log_obj);
3702
7e7d8a3fe080 make AVOptions default value field work.
gpoirier
parents: 3699
diff changeset
208 void av_opt_set_defaults(void *s);
4629
2faa1399dd68 add av_opt_set_defaults2() which sets just defaults from AVOptions whos flags match a user specified & mask = flags
michael
parents: 4628
diff changeset
209 void av_opt_set_defaults2(void *s, int mask, int flags);
2874
b6def74f5811 flags and named constants with type checking of course for AVOption
michael
parents:
diff changeset
210
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7427
diff changeset
211 #endif /* AVCODEC_OPT_H */