@@ -438,7 +438,9 @@ AVCodec ff_libopenh264_encoder = {
.init = svc_encode_init,
.encode2 = svc_encode_frame,
.close = svc_encode_close,
- .capabilities = AV_CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_AUTO_THREADS |
+ AV_CODEC_CAP_VARIABLE_DIMENSIONS |
+ AV_CODEC_CAP_ENCODER_FLUSH,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
@@ -1789,7 +1789,9 @@ AVCodec ff_libvpx_vp9_encoder = {
.init = vp9_init,
.encode2 = vpx_encode,
.close = vpx_free,
- .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS |
+ AV_CODEC_CAP_VARIABLE_DIMENSIONS |
+ AV_CODEC_CAP_ENCODER_FLUSH,
.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
.priv_class = &class_vp9,
.defaults = defaults,
@@ -701,6 +701,8 @@ AVCodec ff_libx265_encoder = {
.priv_class = &class,
.defaults = x265_defaults,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS |
- AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+ AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE |
+ AV_CODEC_CAP_VARIABLE_DIMENSIONS |
+ AV_CODEC_CAP_ENCODER_FLUSH,
.wrapper_name = "libx265",
};
@@ -92,5 +92,6 @@ AVCodec ff_rawvideo_encoder = {
.id = AV_CODEC_ID_RAWVIDEO,
.init = raw_encode_init,
.encode2 = raw_encode,
- .capabilities = AV_CODEC_CAP_VARIABLE_DIMENSIONS,
+ .capabilities = AV_CODEC_CAP_VARIABLE_DIMENSIONS |
+ AV_CODEC_CAP_ENCODER_FLUSH,
};
@@ -116,7 +116,8 @@ AVCodec ff_wrapped_avframe_encoder = {
.id = AV_CODEC_ID_WRAPPED_AVFRAME,
.encode2 = wrapped_avframe_encode,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
- .capabilities = AV_CODEC_CAP_VARIABLE_DIMENSIONS,
+ .capabilities = AV_CODEC_CAP_VARIABLE_DIMENSIONS |
+ AV_CODEC_CAP_ENCODER_FLUSH,
};
AVCodec ff_wrapped_avframe_decoder = {
Signed-off-by: Linjie Fu <linjie.fu@intel.com> --- This patch is for RFC: Did some tests on some of the encoders and find some encoders not suitable for now, hence didn't declare the caps for them: 1. libx264: seems have frame drop. 2. hardware encoders like vaapi: failed. Hence before we got all encoders supported, I'd prefer to declare caps for specific encoder and add the enhancement step by step. libavcodec/libopenh264enc.c | 4 +++- libavcodec/libvpxenc.c | 4 +++- libavcodec/libx265.c | 4 +++- libavcodec/rawenc.c | 3 ++- libavcodec/wrapped_avframe.c | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-)