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
645 * as a last resort.645 * as a last resort.
646 */646 */
647#define CODEC_CAP_SUBFRAMES 0x0100647#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
648 653
649//The following defines may change, don't expect compatibility if you use them.654//The following defines may change, don't expect compatibility if you use them.
650#define MB_TYPE_INTRA4x4 0x0001655#define MB_TYPE_INTRA4x4 0x0001
libavcodec/utils.c+8−4
@@ -725,14 +725,18 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 724 unmodified lines
725 725
726AVCodec *avcodec_find_encoder(enum CodecID id)726AVCodec *avcodec_find_encoder(enum CodecID id)
727{727{
728 AVCodec *p;728 AVCodec *p, *experimental=NULL;
729 p = first_avcodec;729 p = first_avcodec;
730 while (p) {730 while (p) {
731 if (p->encode != NULL && p->id == id)731 if (p->encode != NULL && p->id == id) {
732 return p;732 if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
733 experimental = p;
734 } else
735 return p;
736 }
733 p = p->next;737 p = p->next;
734 }738 }
735 return NULL;739 return experimental;
736}740}
737 741
738AVCodec *avcodec_find_encoder_by_name(const char *name)742AVCodec *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