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
421#undef D421#undef D
422#undef DEFAULT422#undef DEFAULT
423 423
424static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };424static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
425 425
426void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){426void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
427 int flags=0;427 int flags=0;
libavcodec/resample.c+1−1
@@ -36,7 +36,7 @@ static const char *context_to_name(void *ptr) · 35 unmodified lines
36}36}
37 37
38static const AVOption options[] = {{NULL}};38static const AVOption options[] = {{NULL}};
39static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options };39static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
40 40
41struct ReSampleContext {41struct ReSampleContext {
42 struct AVResampleContext *resample_context;42 struct AVResampleContext *resample_context;
libavfilter/avfilter.c+3−1
@@ -385,7 +385,9 @@ static const char *filter_name(void *p) · 384 unmodified lines
385 385
386static const AVClass avfilter_class = {386static const AVClass avfilter_class = {
387 "AVFilter",387 "AVFilter",
388 filter_name388 filter_name,
389 NULL,
390 LIBAVUTIL_VERSION_INT,
389};391};
390 392
391AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name)393AVFilterContext *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
41}41}
42static const AVOption options[] = {{NULL}};42static const AVOption options[] = {{NULL}};
43static const AVClass urlcontext_class =43static const AVClass urlcontext_class =
44 { "URLContext", urlcontext_to_name, options };44 { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT };
45/*@}*/45/*@}*/
46#endif46#endif
47 47
libavformat/options.c+1−1
@@ -66,7 +66,7 @@ static const AVOption options[]={ · 65 unmodified lines
66#undef D66#undef D
67#undef DEFAULT67#undef DEFAULT
68 68
69static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options };69static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options, LIBAVUTIL_VERSION_INT };
70 70
71static void avformat_get_context_defaults(AVFormatContext *s)71static void avformat_get_context_defaults(AVFormatContext *s)
72{72{
libavutil/avutil.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
40#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)40#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
41 41
42#define LIBAVUTIL_VERSION_MAJOR 5042#define LIBAVUTIL_VERSION_MAJOR 50
43#define LIBAVUTIL_VERSION_MINOR 1443#define LIBAVUTIL_VERSION_MINOR 15
44#define LIBAVUTIL_VERSION_MICRO 044#define LIBAVUTIL_VERSION_MICRO 0
45 45
46#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \46#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/log.h+8−0
@@ -48,6 +48,14 @@ typedef struct { · 47 unmodified lines
48 * @see av_set_default_options()48 * @see av_set_default_options()
49 */49 */
50 const struct AVOption *option;50 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;
51} AVClass;59} AVClass;
52 60
53/* av_log API */61/* 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