summaryrefslogtreecommitdiffstats
path: root/ffmpeg_vdpau.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-27 13:25:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-27 13:26:38 +0100
commita6ab9ed50d8a5b749f3e0a670e4fd6ee52d92b94 (patch)
tree1cf5a875152433a8c7b95d693a0006e8c2e91a8f /ffmpeg_vdpau.c
parent751731540f5bae608a3b7755267d5a65623e35ea (diff)
parent1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec (diff)
downloadffmpeg-streaming-a6ab9ed50d8a5b749f3e0a670e4fd6ee52d92b94.zip
ffmpeg-streaming-a6ab9ed50d8a5b749f3e0a670e4fd6ee52d92b94.tar.gz
Merge commit '1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec'
* commit '1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec': avconv_vdpau: allocate video surface of VDPAU-specified size Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_vdpau.c')
-rw-r--r--ffmpeg_vdpau.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ffmpeg_vdpau.c b/ffmpeg_vdpau.c
index 14a3773..b05e557 100644
--- a/ffmpeg_vdpau.c
+++ b/ffmpeg_vdpau.c
@@ -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);
@@ -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));
OpenPOWER on IntegriCloud