diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-06 15:21:52 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-06 15:21:52 +0400 |
commit | 0ba887bbf4d99b609247a5447dc63dc2e7550ff5 (patch) | |
tree | ceeab3191d427df6dfdca35962ec23d6e00d57de /libavcodec/vdpau_vc1.c | |
parent | 8df41976b7cd2e3ae0fd83ec585c886e94734acf (diff) | |
parent | 89ac99ba5f2dc9f69ad3bc294753930eb0b3e4a4 (diff) |
Merge commit '89ac99ba5f2dc9f69ad3bc294753930eb0b3e4a4'
* commit '89ac99ba5f2dc9f69ad3bc294753930eb0b3e4a4':
vdpau: pass codec-specific parameters from hwaccel
Conflicts:
libavcodec/vdpau.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vdpau_vc1.c')
-rw-r--r-- | libavcodec/vdpau_vc1.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c index 13c41df66a..ffd6505d13 100644 --- a/libavcodec/vdpau_vc1.c +++ b/libavcodec/vdpau_vc1.c @@ -113,6 +113,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", @@ -123,6 +144,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 @@ -135,4 +159,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), }; |