History

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

Janne Grunau committed 16 years ago

Commit 93ebfee1 parent 1ed87f82 files · +13 −4Browse files

Unified · Split

2 files
  1. libavcodec/avcodec.h +5 −0
  2. libavcodec/utils.c +8 −4
libavcodec/avcodec.h+5−0
@@ -645,6 +645,11 @@ typedef struct RcOverride{ · 644 unmodified lines
645645 * as a last resort.
646646 */
647647 #define CODEC_CAP_SUBFRAMES 0x0100
648+/**
649+ * Codec is experimental and is thus avoided in favor of non experimental
650+ * encoders
651+ */
652+#define CODEC_CAP_EXPERIMENTAL 0x0200
648653
649654 //The following defines may change, don't expect compatibility if you use them.
650655 #define MB_TYPE_INTRA4x4 0x0001
libavcodec/utils.c+8−4
@@ -725,14 +725,18 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 724 unmodified lines
725725
726726 AVCodec *avcodec_find_encoder(enum CodecID id)
727727 {
728− AVCodec *p;
728+ AVCodec *p, *experimental=NULL;
729729 p = first_avcodec;
730730 while (p) {
731− if (p->encode != NULL && p->id == id)
732− return p;
731+ if (p->encode != NULL && p->id == id) {
732+ if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
733+ experimental = p;
734+ } else
735+ return p;
736+ }
733737 p = p->next;
734738 }
735− return NULL;
739+ return experimental;
736740 }
737741
738742 AVCodec *avcodec_find_encoder_by_name(const char *name)

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