mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/librav1e: support AV_CODEC_CAP_ENCODER_RECON_FRAME
This bumps the minimum required version to 0.5.0 Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
f58f238936
commit
1f63225f2b
2
configure
vendored
2
configure
vendored
@ -6675,7 +6675,7 @@ enabled libopus && {
|
||||
enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
|
||||
enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
|
||||
enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
|
||||
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.4.0" rav1e.h rav1e_context_new
|
||||
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
|
||||
enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
|
||||
enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
|
||||
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
|
||||
|
@ -538,6 +538,32 @@ retry:
|
||||
|
||||
pkt->pts = pkt->dts = *((int64_t *) rpkt->opaque);
|
||||
av_free(rpkt->opaque);
|
||||
|
||||
if (avctx->flags & AV_CODEC_FLAG_RECON_FRAME) {
|
||||
AVCodecInternal *avci = avctx->internal;
|
||||
AVFrame *frame = avci->recon_frame;
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
|
||||
av_frame_unref(frame);
|
||||
|
||||
frame->format = avctx->pix_fmt;
|
||||
frame->width = avctx->width;
|
||||
frame->height = avctx->height;
|
||||
|
||||
ret = ff_encode_alloc_frame(avctx, frame);
|
||||
if (ret < 0) {
|
||||
rav1e_packet_unref(rpkt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (int i = 0; i < desc->nb_components; i++) {
|
||||
int shift = i ? desc->log2_chroma_h : 0;
|
||||
rav1e_frame_extract_plane(rpkt->rec, i, frame->data[i],
|
||||
(frame->height >> shift) * frame->linesize[i],
|
||||
frame->linesize[i], desc->comp[i].step);
|
||||
}
|
||||
}
|
||||
|
||||
rav1e_packet_unref(rpkt);
|
||||
|
||||
return 0;
|
||||
@ -601,7 +627,7 @@ const FFCodec ff_librav1e_encoder = {
|
||||
.defaults = librav1e_defaults,
|
||||
.p.pix_fmts = librav1e_pix_fmts,
|
||||
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS |
|
||||
AV_CODEC_CAP_DR1,
|
||||
AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_RECON_FRAME,
|
||||
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
|
||||
FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS,
|
||||
.p.wrapper_name = "librav1e",
|
||||
|
Loading…
x
Reference in New Issue
Block a user