]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/opt.h
Make VP8 DSP functions take two strides
[ffmpeg] / libavcodec / opt.h
index c3e716ba961e3d46987c8ae0ea06439a33d4cf64..55ca4ea63e819eb834037d6437e121d370bbe2c3 100644 (file)
 #define AVCODEC_OPT_H
 
 /**
- * @file opt.h
+ * @file
  * AVOptions
  */
 
 #include "libavutil/rational.h"
+#include "avcodec.h"
 
 enum AVOptionType{
     FF_OPT_TYPE_FLAGS,
@@ -84,10 +85,62 @@ typedef struct AVOption {
     const char *unit;
 } AVOption;
 
+/**
+ * AVOption2.
+ * THIS IS NOT PART OF THE API/ABI YET!
+ * This is identical to AVOption except that default_val was replaced by
+ * an union, it should be compatible with AVOption on normal platforms.
+ */
+typedef struct AVOption2 {
+    const char *name;
+
+    /**
+     * short English help text
+     * @todo What about other languages?
+     */
+    const char *help;
+
+    /**
+     * The offset relative to the context structure where the option
+     * value is stored. It should be 0 for named constants.
+     */
+    int offset;
+    enum AVOptionType type;
+
+    /**
+     * the default value for scalar options
+     */
+    union {
+        double dbl;
+        const char *str;
+    } default_val;
+
+    double min;                 ///< minimum valid value for the option
+    double max;                 ///< maximum valid value for the option
+
+    int flags;
+/*
+#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
+#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
+#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
+#define AV_OPT_FLAG_AUDIO_PARAM     8
+#define AV_OPT_FLAG_VIDEO_PARAM     16
+#define AV_OPT_FLAG_SUBTITLE_PARAM  32
+*/
+//FIXME think about enc-audio, ... style flags
+
+    /**
+     * The logical unit to which the option belongs. Non-constant
+     * options and corresponding named constants share the same
+     * unit. May be NULL.
+     */
+    const char *unit;
+} AVOption2;
+
 
 /**
- * Looks for an option in \p obj. Looks only for the options which
- * have the flags set as specified in \p mask and \p flags (that is,
+ * Looks for an option in obj. Looks only for the options which
+ * have the flags set as specified in mask and flags (that is,
  * for which it is the case that opt->flags & mask == flags).
  *
  * @param[in] obj a pointer to a struct whose first element is a
@@ -99,6 +152,7 @@ typedef struct AVOption {
  */
 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
 
+#if LIBAVCODEC_VERSION_MAJOR < 53
 /**
  * @see av_set_string2()
  */
@@ -106,11 +160,12 @@ attribute_deprecated const AVOption *av_set_string(void *obj, const char *name,
 
 /**
  * @return a pointer to the AVOption corresponding to the field set or
- * NULL if no matching AVOption exists, or if the value \p val is not
+ * NULL if no matching AVOption exists, or if the value val is not
  * valid
  * @see av_set_string3()
  */
 attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
+#endif
 
 /**
  * Sets the field of obj with the given name to value.
@@ -133,8 +188,11 @@ attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name,
  * @param alloc when 1 then the old value will be av_freed() and the
  *                     new av_strduped()
  *              when 0 then no av_free() nor av_strdup() will be used
- * @return 0 if the value has been set, an AVERROR* error code if no
- * matching option exists, or if the value \p val is not valid
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR(ENOENT) if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
  */
 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);