summaryrefslogtreecommitdiff
path: root/libavcodec/common.h
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2003-02-10 09:40:23 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2003-02-10 09:40:23 +0000
commitfe1b62fb3e8757e9db791bd4c4f647ca50834f40 (patch)
treeedba7bf5442057133631466d9286698143a4a661 /libavcodec/common.h
parent97d96aaa76e11661967b7bd67cc7ef49d0212a8b (diff)
* still unfinished code for Options
* demo code - awating more comments Originally committed as revision 1569 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r--libavcodec/common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index e2bec49218..a6ad987510 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -37,6 +37,24 @@
#define M_PI 3.14159265358979323846
#endif
+#include <stddef.h>
+#ifndef offsetof
+# define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
+#endif
+
+#define AVOPTION_CODEC_BOOL(name, help, field) \
+ { name, help, offsetof(AVCodecContext, field), FF_OPT_TYPE_BOOL }
+#define AVOPTION_CODEC_FLAG(name, help, field, flag, defval) \
+ { name, help, offsetof(AVCodecContext, field), FF_OPT_TYPE_FLAG, flag, 0, defval }
+#define AVOPTION_CODEC_INT(name, help, field, minv, maxv, defval) \
+ { name, help, offsetof(AVCodecContext, field), FF_OPT_TYPE_INT, minv, maxv, defval }
+#define AVOPTION_CODEC_STRING(name, help, field, str, val) \
+ { name, help, offsetof(AVCodecContext, field), FF_OPT_TYPE_STRING, .defval = val, .defstr = str }
+#define AVOPTION_CODEC_RCOVERRIDE(name, help, field) \
+ { name, help, offsetof(AVCodecContext, field), FF_OPT_TYPE_RCOVERRIDE, .defval = 0, .defstr = NULL }
+#define AVOPTION_SUB(ptr) { .name = NULL, .sub = ptr }
+#define AVOPTION_END() AVOPTION_SUB(NULL)
+
#endif /* HAVE_AV_CONFIG_H */
/* Suppress restrict if it was not defined in config.h. */