diff options
author | wm4 <wm4@nowhere> | 2013-05-03 20:33:25 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-04 01:36:15 +0200 |
commit | 844249317b350ad2a9f71b4382252027861d9e20 (patch) | |
tree | 2b44bae54100252f53598ac58272a4ff1a832998 /video | |
parent | 2cb147a2f40bcde48f5db321840f4dbd36ca796b (diff) | |
download | mpv-844249317b350ad2a9f71b4382252027861d9e20.tar.bz2 mpv-844249317b350ad2a9f71b4382252027861d9e20.tar.xz |
vd_lavc: allow explicitly selecting vdpau hw decoders
This allows using the vdpau decoders with -vd without having to use
the -hwdec switch (basically like in mplayer).
Note that this way of selecting the hardware decoder is still
deprecated. libavcodec went away from adding special decoder entries
for hardware decoding, and instead makes use of the "hwaccel"
architecture, where hardware decoders use the same decoder names as
the software decoders. The old vdpau special decoders will probably
be deprecated and removed in the future.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 8a989feea7..59eba1166b 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -101,7 +101,7 @@ enum hwdec_type { struct hwdec { enum hwdec_type api; - char *codec, *hw_codec; + const char *codec, *hw_codec; }; static const struct hwdec hwdec[] = { @@ -272,6 +272,16 @@ static void init_avctx(sh_video_t *sh, const char *decoder, struct hwdec *hwdec) avctx->thread_count = lavc_param->threads; + // Hack to allow explicitly selecting vdpau hw decoders + if (!hwdec && (lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { + ctx->hwdec = talloc(ctx, struct hwdec); + *ctx->hwdec = (struct hwdec) { + .api = HWDEC_VDPAU, + .codec = sh->gsh->codec, + .hw_codec = decoder, + }; + } + if (ctx->hwdec && ctx->hwdec->api == HWDEC_VDPAU) { assert(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU); ctx->do_hw_dr1 = true; |