summaryrefslogtreecommitdiffstats
path: root/video/hwdec.h
diff options
context:
space:
mode:
Diffstat (limited to 'video/hwdec.h')
-rw-r--r--video/hwdec.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/video/hwdec.h b/video/hwdec.h
new file mode 100644
index 0000000000..3ff7e32a50
--- /dev/null
+++ b/video/hwdec.h
@@ -0,0 +1,20 @@
+#ifndef MP_HWDEC_H_
+#define MP_HWDEC_H_
+
+// Used to communicate hardware decoder API handles from VO to video decoder.
+// The VO can set the context pointer for supported APIs.
+struct mp_hwdec_info {
+ struct mp_vdpau_ctx *vdpau_ctx;
+ struct mp_vaapi_ctx *vaapi_ctx;
+ // Can be used to lazily load a requested API.
+ // api_name is e.g. "vdpau" (like the fields above, without "_ctx")
+ // Can be NULL, is idempotent, caller checks _ctx fields for success/access.
+ void (*load_api)(struct mp_hwdec_info *info, const char *api_name);
+ void *load_api_ctx;
+};
+
+// Trivial helper to call info->load_api().
+// Implemented in vd_lavc.c.
+void hwdec_request_api(struct mp_hwdec_info *info, const char *api_name);
+
+#endif