Skip to content

Commit

Permalink
Merge commit '1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec'
Browse files Browse the repository at this point in the history
* commit '1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec':
  avconv_vdpau: allocate video surface of VDPAU-specified size

Merged-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Dec 27, 2014
2 parents 7517315 + 1f9237f commit a6ab9ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ffmpeg_vdpau.c
Expand Up @@ -100,9 +100,14 @@ static int vdpau_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
VDPAUContext *ctx = ist->hwaccel_ctx;
VdpVideoSurface *surface;
VdpStatus err;
VdpChromaType chroma;
uint32_t width, height;

av_assert0(frame->format == AV_PIX_FMT_VDPAU);

if (av_vdpau_get_surface_parameters(s, &chroma, &width, &height))
return AVERROR(ENOSYS);

surface = av_malloc(sizeof(*surface));
if (!surface)
return AVERROR(ENOMEM);
Expand All @@ -118,8 +123,8 @@ static int vdpau_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
// properly we should keep a pool of surfaces instead of creating
// them anew for each frame, but since we don't care about speed
// much in this code, we don't bother
err = ctx->video_surface_create(ctx->device, VDP_CHROMA_TYPE_420,
frame->width, frame->height, surface);
err = ctx->video_surface_create(ctx->device, chroma, width, height,
surface);
if (err != VDP_STATUS_OK) {
av_log(NULL, AV_LOG_ERROR, "Error allocating a VDPAU video surface: %s\n",
ctx->get_error_string(err));
Expand Down

0 comments on commit a6ab9ed

Please sign in to comment.