|
|
@ -695,6 +695,7 @@ static int vaapi_encode_output(AVCodecContext *avctx, |
|
|
|
pkt->flags |= AV_PKT_FLAG_KEY; |
|
|
|
pkt->flags |= AV_PKT_FLAG_KEY; |
|
|
|
|
|
|
|
|
|
|
|
pkt->pts = pic->pts; |
|
|
|
pkt->pts = pic->pts; |
|
|
|
|
|
|
|
pkt->duration = pic->input_image->duration; |
|
|
|
|
|
|
|
|
|
|
|
vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); |
|
|
|
vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); |
|
|
|
if (vas != VA_STATUS_SUCCESS) { |
|
|
|
if (vas != VA_STATUS_SUCCESS) { |
|
|
@ -704,6 +705,13 @@ static int vaapi_encode_output(AVCodecContext *avctx, |
|
|
|
goto fail; |
|
|
|
goto fail; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for no-delay encoders this is handled in generic codec
|
|
|
|
|
|
|
|
if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY) { |
|
|
|
|
|
|
|
err = ff_encode_reordered_opaque(avctx, pkt, pic->input_image); |
|
|
|
|
|
|
|
if (err < 0) |
|
|
|
|
|
|
|
goto fail; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
av_buffer_unref(&pic->output_buffer_ref); |
|
|
|
av_buffer_unref(&pic->output_buffer_ref); |
|
|
|
pic->output_buffer = VA_INVALID_ID; |
|
|
|
pic->output_buffer = VA_INVALID_ID; |
|
|
|
|
|
|
|
|
|
|
|