[SCM] libav/experimental: Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:07:44 UTC 2013


The following commit has been merged in the experimental branch:
commit 93ebfeea90be8cc270226ac4d282efffed7ca0c7
Author: Janne Grunau <janne-ffmpeg at jannau.net>
Date:   Wed May 26 10:38:48 2010 +0000

    Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.
    
    Patch by Janne Grunau, janne-ffmpeg jannau net
    
    Originally committed as revision 23334 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 239f605..9cb101d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -645,6 +645,11 @@ typedef struct RcOverride{
  * as a last resort.
  */
 #define CODEC_CAP_SUBFRAMES        0x0100
+/**
+ * Codec is experimental and is thus avoided in favor of non experimental
+ * encoders
+ */
+#define CODEC_CAP_EXPERIMENTAL     0x0200
 
 //The following defines may change, don't expect compatibility if you use them.
 #define MB_TYPE_INTRA4x4   0x0001
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 56d4dbd..54db3da 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -725,14 +725,18 @@ av_cold int avcodec_close(AVCodecContext *avctx)
 
 AVCodec *avcodec_find_encoder(enum CodecID id)
 {
-    AVCodec *p;
+    AVCodec *p, *experimental=NULL;
     p = first_avcodec;
     while (p) {
-        if (p->encode != NULL && p->id == id)
-            return p;
+        if (p->encode != NULL && p->id == id) {
+            if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
+                experimental = p;
+            } else
+                return p;
+        }
         p = p->next;
     }
-    return NULL;
+    return experimental;
 }
 
 AVCodec *avcodec_find_encoder_by_name(const char *name)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list