summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau_mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-06 13:21:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-06 13:21:52 +0200
commit0ba887bbf4d99b609247a5447dc63dc2e7550ff5 (patch)
treeceeab3191d427df6dfdca35962ec23d6e00d57de /libavcodec/vdpau_mpeg12.c
parent8df41976b7cd2e3ae0fd83ec585c886e94734acf (diff)
parent89ac99ba5f2dc9f69ad3bc294753930eb0b3e4a4 (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_mpeg12.c')
-rw-r--r--libavcodec/vdpau_mpeg12.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
index 84a971c5b1..c47e50e0ec 100644
--- a/libavcodec/vdpau_mpeg12.c
+++ b/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