X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fvdpau_mpeg12.c;h=c47e50e0ece79eb42389b7b5da681231699f5c6c;hp=84a971c5b17015bb6c42828b36e9c5798ebc8778;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/vdpau_mpeg12.c b/ffmpeg/libavcodec/vdpau_mpeg12.c index 84a971c..c47e50e 100644 --- a/ffmpeg/libavcodec/vdpau_mpeg12.c +++ b/ffmpeg/libavcodec/vdpau_mpeg12.c @@ -95,6 +95,12 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx, } #if CONFIG_MPEG1_VDPAU_HWACCEL +static int vdpau_mpeg1_init(AVCodecContext *avctx) +{ + return ff_vdpau_common_init(avctx, VDP_DECODER_PROFILE_MPEG1, + VDP_DECODER_LEVEL_MPEG1_NA); +} + AVHWAccel ff_mpeg1_vdpau_hwaccel = { .name = "mpeg1_vdpau", .type = AVMEDIA_TYPE_VIDEO, @@ -104,10 +110,31 @@ AVHWAccel ff_mpeg1_vdpau_hwaccel = { .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, .frame_priv_data_size = sizeof(struct vdpau_picture_context), + .init = vdpau_mpeg1_init, + .uninit = ff_vdpau_common_uninit, + .priv_data_size = sizeof(VDPAUContext), }; #endif #if CONFIG_MPEG2_VDPAU_HWACCEL +static int vdpau_mpeg2_init(AVCodecContext *avctx) +{ + VdpDecoderProfile profile; + + switch (avctx->profile) { + case FF_PROFILE_MPEG2_MAIN: + profile = VDP_DECODER_PROFILE_MPEG2_MAIN; + break; + case FF_PROFILE_MPEG2_SIMPLE: + profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; + break; + default: + return AVERROR(EINVAL); + } + + return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL); +} + AVHWAccel ff_mpeg2_vdpau_hwaccel = { .name = "mpeg2_vdpau", .type = AVMEDIA_TYPE_VIDEO, @@ -117,5 +144,8 @@ AVHWAccel ff_mpeg2_vdpau_hwaccel = { .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, .frame_priv_data_size = sizeof(struct vdpau_picture_context), + .init = vdpau_mpeg2_init, + .uninit = ff_vdpau_common_uninit, + .priv_data_size = sizeof(VDPAUContext), }; #endif