[FFmpeg-cvslog] r23334 - in trunk/libavcodec: avcodec.h utils.c

cehoyos subversion
Wed May 26 12:38:48 CEST 2010


Author: cehoyos
Date: Wed May 26 12:38:48 2010
New Revision: 23334

Log:
Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.

Patch by Janne Grunau, janne-ffmpeg jannau net

Modified:
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Wed May 26 06:22:52 2010	(r23333)
+++ trunk/libavcodec/avcodec.h	Wed May 26 12:38:48 2010	(r23334)
@@ -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

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Wed May 26 06:22:52 2010	(r23333)
+++ trunk/libavcodec/utils.c	Wed May 26 12:38:48 2010	(r23334)
@@ -725,14 +725,18 @@ av_cold int avcodec_close(AVCodecContext
 
 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)



More information about the ffmpeg-cvslog mailing list