summaryrefslogtreecommitdiffstats
path: root/video/hwdec.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-02 03:58:04 +0100
committerwm4 <wm4@nowhere>2017-12-02 04:53:51 +0100
commit0780d3832997056b581cdecb29e605132fae9417 (patch)
tree340313db84f48ed4d7f43a7601cfc27e4f7347a8 /video/hwdec.h
parent8b3dbab19eafee2da3685bb0a8550db448fad757 (diff)
downloadmpv-0780d3832997056b581cdecb29e605132fae9417.tar.bz2
mpv-0780d3832997056b581cdecb29e605132fae9417.tar.xz
hwdec: don't require setting legacy hwdec fields
With the recent changes, mpv's internal mechanisms got synced to libavcodec's once more. Some things are still needed for filters (until the mechanism gets replaced), but there's no need to require other hwdec methods to use these fields. So remove them where they are unnecessary. Also fix some minor leaks in the dxva2 backends, and set the driver_name field in the Apple ones. Untested on Apple crap.
Diffstat (limited to 'video/hwdec.h')
-rw-r--r--video/hwdec.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/video/hwdec.h b/video/hwdec.h
index 1ffd5ca266..34dd52e08b 100644
--- a/video/hwdec.h
+++ b/video/hwdec.h
@@ -1,6 +1,8 @@
#ifndef MP_HWDEC_H_
#define MP_HWDEC_H_
+#include <libavutil/buffer.h>
+
#include "options/m_option.h"
struct mp_image_pool;
@@ -9,24 +11,21 @@ struct mp_image_pool;
enum hwdec_type {
HWDEC_NONE = 0,
HWDEC_VDPAU,
- HWDEC_VIDEOTOOLBOX,
HWDEC_VAAPI,
- HWDEC_DXVA2,
HWDEC_D3D11VA,
- HWDEC_CUDA,
};
struct mp_hwdec_ctx {
- enum hwdec_type type; // (never HWDEC_NONE)
+ // Only needed for some filters. The main effect is that hwdec_devices_get()
+ // can be used. Leave unsert (i.e. HWDEC_NONE) if not needed.
+ enum hwdec_type type;
+
const char *driver_name; // NULL if unknown/not loaded
- // This is never NULL. Its meaning depends on the .type field:
+ // The meaning depends on the .type field:
// HWDEC_VDPAU: struct mp_vdpau_ctx*
- // HWDEC_VIDEOTOOLBOX: non-NULL dummy pointer
// HWDEC_VAAPI: struct mp_vaapi_ctx*
// HWDEC_D3D11VA: ID3D11Device*
- // HWDEC_DXVA2: IDirect3DDevice9*
- // HWDEC_CUDA: CUcontext*
void *ctx;
// libavutil-wrapped context, if available.