[FFmpeg-cvslog] r22987 - in trunk: libavcodec/options.c libavcodec/resample.c libavfilter/avfilter.c libavformat/avio.c libavformat/options.c libavutil/avutil.h libavutil/log.h

michael subversion
Wed Apr 28 22:00:24 CEST 2010


Author: michael
Date: Wed Apr 28 22:00:23 2010
New Revision: 22987

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

Modified:
   trunk/libavcodec/options.c
   trunk/libavcodec/resample.c
   trunk/libavfilter/avfilter.c
   trunk/libavformat/avio.c
   trunk/libavformat/options.c
   trunk/libavutil/avutil.h
   trunk/libavutil/log.h

Modified: trunk/libavcodec/options.c
==============================================================================
--- trunk/libavcodec/options.c	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavcodec/options.c	Wed Apr 28 22:00:23 2010	(r22987)
@@ -421,7 +421,7 @@ static const AVOption options[]={
 #undef D
 #undef DEFAULT
 
-static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
+static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
 
 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
     int flags=0;

Modified: trunk/libavcodec/resample.c
==============================================================================
--- trunk/libavcodec/resample.c	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavcodec/resample.c	Wed Apr 28 22:00:23 2010	(r22987)
@@ -36,7 +36,7 @@ static const char *context_to_name(void 
 }
 
 static const AVOption options[] = {{NULL}};
-static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options };
+static const AVClass audioresample_context_class = { "ReSampleContext", context_to_name, options, LIBAVUTIL_VERSION_INT };
 
 struct ReSampleContext {
     struct AVResampleContext *resample_context;

Modified: trunk/libavfilter/avfilter.c
==============================================================================
--- trunk/libavfilter/avfilter.c	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavfilter/avfilter.c	Wed Apr 28 22:00:23 2010	(r22987)
@@ -385,7 +385,9 @@ static const char *filter_name(void *p)
 
 static const AVClass avfilter_class = {
     "AVFilter",
-    filter_name
+    filter_name,
+    NULL,
+    LIBAVUTIL_VERSION_INT,
 };
 
 AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name)

Modified: trunk/libavformat/avio.c
==============================================================================
--- trunk/libavformat/avio.c	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavformat/avio.c	Wed Apr 28 22:00:23 2010	(r22987)
@@ -41,7 +41,7 @@ static const char *urlcontext_to_name(vo
 }
 static const AVOption options[] = {{NULL}};
 static const AVClass urlcontext_class =
-        { "URLContext", urlcontext_to_name, options };
+        { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT };
 /*@}*/
 #endif
 

Modified: trunk/libavformat/options.c
==============================================================================
--- trunk/libavformat/options.c	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavformat/options.c	Wed Apr 28 22:00:23 2010	(r22987)
@@ -66,7 +66,7 @@ static const AVOption options[]={
 #undef D
 #undef DEFAULT
 
-static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options };
+static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options, LIBAVUTIL_VERSION_INT };
 
 static void avformat_get_context_defaults(AVFormatContext *s)
 {

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavutil/avutil.h	Wed Apr 28 22:00:23 2010	(r22987)
@@ -40,7 +40,7 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 #define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 14
+#define LIBAVUTIL_VERSION_MINOR 15
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Modified: trunk/libavutil/log.h
==============================================================================
--- trunk/libavutil/log.h	Wed Apr 28 10:02:52 2010	(r22986)
+++ trunk/libavutil/log.h	Wed Apr 28 22:00:23 2010	(r22987)
@@ -48,6 +48,14 @@ typedef struct {
      * @see av_set_default_options()
      */
     const struct AVOption *option;
+
+    /**
+     * LIBAVUTIL_VERSION with which this structure was created.
+     * This is used to allow fields to be added without requireing major
+     * version bumps everywhere.
+     */
+
+    int version;
 } AVClass;
 
 /* av_log API */



More information about the ffmpeg-cvslog mailing list