mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/nvenc: use AVCodecContext.get_encode_buffer()
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
b86af93cea
commit
238e08b12e
|
@ -1971,7 +1971,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = av_new_packet(pkt, lock_params.bitstreamSizeInBytes);
|
res = ff_get_encode_buffer(avctx, pkt, lock_params.bitstreamSizeInBytes, 0);
|
||||||
|
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface);
|
p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface);
|
||||||
|
|
|
@ -287,7 +287,7 @@ AVCodec ff_h264_nvenc_encoder = {
|
||||||
.priv_class = &h264_nvenc_class,
|
.priv_class = &h264_nvenc_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_ENCODER_FLUSH,
|
AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1,
|
||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.pix_fmts = ff_nvenc_pix_fmts,
|
.pix_fmts = ff_nvenc_pix_fmts,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
|
|
@ -237,7 +237,7 @@ AVCodec ff_hevc_nvenc_encoder = {
|
||||||
.defaults = defaults,
|
.defaults = defaults,
|
||||||
.pix_fmts = ff_nvenc_pix_fmts,
|
.pix_fmts = ff_nvenc_pix_fmts,
|
||||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
|
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
|
||||||
AV_CODEC_CAP_ENCODER_FLUSH,
|
AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1,
|
||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
.hw_configs = ff_nvenc_hw_configs,
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
|
|
Loading…
Reference in New Issue