History

Add version to AVClass so we can add to and use fields of AVClass without ABI issues.

Originally committed as revision 22987 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer committed 16 years ago

Commit 2308b6c1 parent b01dba17 files · +16 −6Browse files

Unified · Split

7 files
  1. libavcodec/options.c +1 −1
  2. libavcodec/resample.c +1 −1
  3. libavfilter/avfilter.c +3 −1
  4. libavformat/avio.c +1 −1
  5. libavformat/options.c +1 −1
  6. libavutil/avutil.h +1 −1
  7. libavutil/log.h +8 −0
libavcodec/options.c+1−1
@@ -421,7 +421,7 @@ static const AVOption options[]={ · 420 unmodified lines
421421 #undef D
422422 #undef DEFAULT
423423
424−static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
424+static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
425425
426426 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
427427 int flags=0;
libavcodec/resample.c+1−1
@@ -36,7 +36,7 @@ static const char *context_to_name(void *ptr) · 35 unmodified lines
3636 }
3737
3838 static const AVOption options[] = {{NULL}};
39−static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options };
39+static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
4040
4141 struct ReSampleContext {
4242 struct AVResampleContext *resample_context;
libavfilter/avfilter.c+3−1
@@ -385,7 +385,9 @@ static const char *filter_name(void *p) · 384 unmodified lines
385385
386386 static const AVClass avfilter_class = {
387387 "AVFilter",
388− filter_name
388+ filter_name,
389+ NULL,
390+ LIBAVUTIL_VERSION_INT,
389391 };
390392
391393 AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name)
libavformat/avio.c+1−1
@@ -41,7 +41,7 @@ static const char *urlcontext_to_name(void *ptr) · 40 unmodified lines
4141 }
4242 static const AVOption options[] = {{NULL}};
4343 static const AVClass urlcontext_class =
44− { "URLContext", urlcontext_to_name, options };
44+ { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT };
4545 /*@}*/
4646 #endif
4747
libavformat/options.c+1−1
@@ -66,7 +66,7 @@ static const AVOption options[]={ · 65 unmodified lines
6666 #undef D
6767 #undef DEFAULT
6868
69−static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options };
69+static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options, LIBAVUTIL_VERSION_INT };
7070
7171 static void avformat_get_context_defaults(AVFormatContext *s)
7272 {
libavutil/avutil.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
4141
4242 #define LIBAVUTIL_VERSION_MAJOR 50
43−#define LIBAVUTIL_VERSION_MINOR 14
43+#define LIBAVUTIL_VERSION_MINOR 15
4444 #define LIBAVUTIL_VERSION_MICRO 0
4545
4646 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/log.h+8−0
@@ -48,6 +48,14 @@ typedef struct { · 47 unmodified lines
4848 * @see av_set_default_options()
4949 */
5050 const struct AVOption *option;
51+
52+ /**
53+ * LIBAVUTIL_VERSION with which this structure was created.
54+ * This is used to allow fields to be added without requireing major
55+ * version bumps everywhere.
56+ */
57+
58+ int version;
5159 } AVClass;
5260
5361 /* av_log API */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t