Signed-off-by: James Almer <jamrial@gmail.com>tags/n4.4
@@ -452,7 +452,7 @@ static int amf_copy_buffer(AVCodecContext *avctx, AVPacket *pkt, AMFBuffer *buff | |||||
int64_t timestamp = AV_NOPTS_VALUE; | int64_t timestamp = AV_NOPTS_VALUE; | ||||
int64_t size = buffer->pVtbl->GetSize(buffer); | int64_t size = buffer->pVtbl->GetSize(buffer); | ||||
if ((ret = av_new_packet(pkt, size)) < 0) { | |||||
if ((ret = ff_get_encode_buffer(avctx, pkt, size, 0)) < 0) { | |||||
return ret; | return ret; | ||||
} | } | ||||
memcpy(pkt->data, buffer->pVtbl->GetNative(buffer), size); | memcpy(pkt->data, buffer->pVtbl->GetNative(buffer), size); | ||||
@@ -388,7 +388,8 @@ AVCodec ff_h264_amf_encoder = { | |||||
.priv_data_size = sizeof(AmfContext), | .priv_data_size = sizeof(AmfContext), | ||||
.priv_class = &h264_amf_class, | .priv_class = &h264_amf_class, | ||||
.defaults = defaults, | .defaults = defaults, | ||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, | |||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | | |||||
AV_CODEC_CAP_DR1, | |||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | ||||
.pix_fmts = ff_amf_pix_fmts, | .pix_fmts = ff_amf_pix_fmts, | ||||
.wrapper_name = "amf", | .wrapper_name = "amf", | ||||
@@ -320,7 +320,8 @@ AVCodec ff_hevc_amf_encoder = { | |||||
.priv_data_size = sizeof(AmfContext), | .priv_data_size = sizeof(AmfContext), | ||||
.priv_class = &hevc_amf_class, | .priv_class = &hevc_amf_class, | ||||
.defaults = defaults, | .defaults = defaults, | ||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, | |||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | | |||||
AV_CODEC_CAP_DR1, | |||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | ||||
.pix_fmts = ff_amf_pix_fmts, | .pix_fmts = ff_amf_pix_fmts, | ||||
.wrapper_name = "amf", | .wrapper_name = "amf", | ||||