[FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder
Lynne
dev at lynne.ee
Wed May 29 18:01:19 EEST 2019
May 29, 2019, 3:41 PM by derek.buitenhuis at gmail.com:
> +
> +static int librav1e_send_frame(AVCodecContext *avctx, const AVFrame *frame)
> +{
> + librav1eContext *ctx = avctx->priv_data;
> + int ret;
> +
> + if (!ctx->rframe && frame) {
> + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
> +
> + ctx->rframe = rav1e_frame_new(ctx->ctx);
> + if (!ctx->rframe) {
> + av_log(avctx, AV_LOG_ERROR, "Could not allocate new rav1e frame.\n");
> + return AVERROR(ENOMEM);
> + }
> +
> + for (int i = 0; i < 3; i++) {
>
for (int i = 0; i < desc->nb_components; i++) {
rav1e_frame_fill_plane() should probably return an error if the plane index is invalid.
More information about the ffmpeg-devel
mailing list