X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fvdpau_vc1.c;h=ffd6505d13f476f0bfc230999dbf1fdf2800e02f;hp=13c41df66add65dc5cc6f93785507de52959e4d0;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/vdpau_vc1.c b/ffmpeg/libavcodec/vdpau_vc1.c index 13c41df..ffd6505 100644 --- a/ffmpeg/libavcodec/vdpau_vc1.c +++ b/ffmpeg/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), };