summaryrefslogtreecommitdiffstats
path: root/video/hwdec.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-01 21:05:54 +0100
committerwm4 <wm4@nowhere>2017-12-01 21:11:43 +0100
commiteb8957cea110a9aa652894d8bb897a9b1ff91e0b (patch)
treea418036f0b8da42fac96921e3075c4dc92462ef6 /video/hwdec.h
parent43af055a70a7b604e1e936575213aa561ac915d1 (diff)
downloadmpv-eb8957cea110a9aa652894d8bb897a9b1ff91e0b.tar.bz2
mpv-eb8957cea110a9aa652894d8bb897a9b1ff91e0b.tar.xz
vd_lavc: rewrite how --hwdec is handled
Change it from explicit metadata about every hwaccel method to trying to get it from libavcodec. As shown by add_all_hwdec_methods(), this is a quite bumpy road, and a bit worse than expected. This will probably cause a bunch of regressions. In particular I didn't check all the strange decoder wrappers, which all cause some sort of special cases each. You're volunteering for beta testing by using this commit. One interesting thing is that we completely get rid of mp_hwdec_ctx in vd_lavc.c, and that HWDEC_* mostly goes away (some filters still use it, and the VO hwdec interops still have a lot of code to set it up, so it's not going away completely for now).
Diffstat (limited to 'video/hwdec.h')
-rw-r--r--video/hwdec.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/video/hwdec.h b/video/hwdec.h
index 69fb86a277..a78bc09517 100644
--- a/video/hwdec.h
+++ b/video/hwdec.h
@@ -5,7 +5,7 @@
struct mp_image_pool;
-// keep in sync with --hwdec option (see mp_hwdec_names)
+// (for some legacy stuff)
enum hwdec_type {
HWDEC_NONE = 0,
HWDEC_AUTO,
@@ -34,9 +34,6 @@ enum hwdec_type {
#define HWDEC_IS_AUTO(x) ((x) == HWDEC_AUTO || (x) == HWDEC_AUTO_COPY)
-// hwdec_type names (options.c)
-extern const struct m_opt_choice_alternatives mp_hwdec_names[];
-
struct mp_hwdec_ctx {
enum hwdec_type type; // (never HWDEC_NONE or HWDEC_IS_AUTO)
const char *driver_name; // NULL if unknown/not loaded
@@ -79,6 +76,14 @@ void hwdec_devices_destroy(struct mp_hwdec_devices *devs);
struct mp_hwdec_ctx *hwdec_devices_get(struct mp_hwdec_devices *devs,
enum hwdec_type type);
+struct AVBufferRef;
+
+// Like hwdec_devices_get(), but search by AV_HWDEVICE_TYPE_* type.
+// Contains a wrapped AVHWDeviceContext.
+// Beware that this creates a _new_ reference.
+struct AVBufferRef *hwdec_devices_get_lavc(struct mp_hwdec_devices *devs,
+ int av_hwdevice_type);
+
// For code which still strictly assumes there is 1 (or none) device.
struct mp_hwdec_ctx *hwdec_devices_get_first(struct mp_hwdec_devices *devs);