[FFmpeg-devel] [PATCH 2/5] ffmpeg: hwaccel helper for VAAPI decode

Michael Niedermayer michael at niedermayer.cc
Sun Jan 17 21:45:59 CET 2016


On Sun, Jan 17, 2016 at 05:35:36PM +0000, Mark Thompson wrote:
[...]
> +static int vaapi_retrieve_data(AVCodecContext *avctx, AVFrame *input_frame)
> +{
> +    InputStream *ist = avctx->opaque;
> +    VAAPIDecoderContext *ctx = ist->hwaccel_ctx;
> +    AVVAAPISurfaceConfig *output = &ctx->output;
> +    AVVAAPISurface *surface;
> +    AVFrame *output_frame;
> +    int err, copying;
> +
> +    surface = (AVVAAPISurface*)input_frame->buf[0]->data;
> +    av_log(ctx, AV_LOG_DEBUG, "Retrieve data from surface %#x
> (format %#x).\n",
> +           surface->id, output->av_format);
> +
> +    if(output->av_format == AV_PIX_FMT_VAAPI) {
> +        copying = 0;
> +        av_log(ctx, AV_LOG_VERBOSE, "Surface %#x retrieved without
> copy.\n",
> +               surface->id);
> +
> +    } else {
> +        err = av_vaapi_map_surface(surface, 1);
> +        if(err) {
> +            av_log(ctx, AV_LOG_ERROR, "Failed to map surface %#x.",
> +                   surface->id);
> +            goto fail;
> +        }
> +
> +        copying = 1;
> +        av_log(ctx, AV_LOG_VERBOSE, "Surface %#x mapped: image %#x
> data %p.\n",
> +               surface->id, surface->image.image_id,
> surface->mapped_address);
> +    }

this patch is corrupted by some automatic word/line wrap, newlines

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160117/2ec8a107/attachment.sig>


More information about the ffmpeg-devel mailing list