diff options
author | wm4 <wm4@nowhere> | 2014-05-28 01:37:53 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-28 02:08:45 +0200 |
commit | d99f30d7266aeaa13504bce181c4410b41e9cb46 (patch) | |
tree | 91261366e7606e53cfc508bfac85ddeb9ab3f9a1 /video/out | |
parent | 8dfd93c6fbaa2af1f0f996072f0db52bd83ee28d (diff) | |
download | mpv-d99f30d7266aeaa13504bce181c4410b41e9cb46.tar.bz2 mpv-d99f30d7266aeaa13504bce181c4410b41e9cb46.tar.xz |
video: warn if an emulated hwdec API is used
mpv supports two hardware decoding APIs on Linux: vdpau and vaapi. Each
of these has emulation wrappers. The wrappers are usually slower and
have fewer features than their native opposites. In particular the libva
vdpau driver is practically unmaintained.
Check the vendor string and print a warning if emulation is detected.
Checking vendor strings is a very stupid thing to do, but I find the
thought of people using an emulated API for no reason worse.
Also, make --hwdec=auto never use an API that is detected as emulated.
This doesn't work quite right yet, because once one API is loaded,
vo_opengl doesn't unload it, so no hardware decoding will be used if the
first probed API (usually vdpau) is rejected. But good enough.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_vaapi.c | 5 | ||||
-rw-r--r-- | video/out/vo_vdpau.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c index 8fb863ece6..7d167ea82e 100644 --- a/video/out/vo_vaapi.c +++ b/video/out/vo_vaapi.c @@ -584,6 +584,11 @@ static int preinit(struct vo *vo) goto fail; } + if (va_guess_if_emulated(p->mpvaapi)) { + MP_WARN(vo, "VA-API is most likely emulated via VDPAU.\n" + "It's better to use VDPAU directly with: --vo=vdpau\n"); + } + p->pool = mp_image_pool_new(MAX_OUTPUT_SURFACES + 3); va_pool_set_allocator(p->pool, p->mpvaapi, VA_RT_FORMAT_YUV420); p->va_image_formats = p->mpvaapi->image_formats; diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index b6728e79d8..3deac1724b 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1005,6 +1005,11 @@ static int preinit(struct vo *vo) vc->video_mixer = mp_vdpau_mixer_create(vc->mpvdp, vo->log); + if (mp_vdpau_guess_if_emulated(vc->mpvdp)) { + MP_WARN(vo, "VDPAU is most likely emulated via VA-API.\n" + "This is inefficient. Use --vo=opengl instead.\n"); + } + // Mark everything as invalid first so uninit() can tell what has been // allocated mark_vdpau_objects_uninitialized(vo); |