summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau_vc1.c
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-10-04 16:55:05 +0300
committerAnton Khirnov <anton@khirnov.net>2014-10-05 10:41:31 +0000
commit89ac99ba5f2dc9f69ad3bc294753930eb0b3e4a4 (patch)
treee7f7bd220d603c1755f045f350a5319ee355a334 /libavcodec/vdpau_vc1.c
parentce083282f0a8b7d63c4047c30b7bac498f9806dd (diff)
vdpau: pass codec-specific parameters from hwaccel
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vdpau_vc1.c')
-rw-r--r--libavcodec/vdpau_vc1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
index f7a7ecc3a5..4f87c52ecc 100644
--- a/libavcodec/vdpau_vc1.c
+++ b/libavcodec/vdpau_vc1.c
@@ -109,6 +109,27 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
return 0;
}
+static int vdpau_vc1_init(AVCodecContext *avctx)
+{
+ VdpDecoderProfile profile;
+
+ switch (avctx->profile) {
+ case FF_PROFILE_VC1_SIMPLE:
+ profile = VDP_DECODER_PROFILE_VC1_SIMPLE;
+ break;
+ case FF_PROFILE_VC1_MAIN:
+ profile = VDP_DECODER_PROFILE_VC1_MAIN;
+ break;
+ case FF_PROFILE_VC1_ADVANCED:
+ profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
+ break;
+ default:
+ return AVERROR(ENOTSUP);
+ }
+
+ return ff_vdpau_common_init(avctx, profile, avctx->level);
+}
+
#if CONFIG_WMV3_VDPAU_HWACCEL
AVHWAccel ff_wmv3_vdpau_hwaccel = {
.name = "wm3_vdpau",
@@ -119,6 +140,9 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_vc1_decode_slice,
.frame_priv_data_size = sizeof(struct vdpau_picture_context),
+ .init = vdpau_vc1_init,
+ .uninit = ff_vdpau_common_uninit,
+ .priv_data_size = sizeof(VDPAUContext),
};
#endif
@@ -131,4 +155,7 @@ AVHWAccel ff_vc1_vdpau_hwaccel = {
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_vc1_decode_slice,
.frame_priv_data_size = sizeof(struct vdpau_picture_context),
+ .init = vdpau_vc1_init,
+ .uninit = ff_vdpau_common_uninit,
+ .priv_data_size = sizeof(VDPAUContext),
};