summaryrefslogtreecommitdiffstats
path: root/video/vdpau.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-05 22:06:32 +0100
committerwm4 <wm4@nowhere>2013-11-05 22:13:05 +0100
commit5cca9143abdbf413641dc8a657ca869a9425b5a9 (patch)
tree7cd5f471894f5904f0c1e020f57602711ac0744a /video/vdpau.h
parentff5a90832814fe583b006d1943fced4dd0fa786d (diff)
downloadmpv-5cca9143abdbf413641dc8a657ca869a9425b5a9.tar.bz2
mpv-5cca9143abdbf413641dc8a657ca869a9425b5a9.tar.xz
vdpau: move device and video surface management from vo_vdpau.c to vdpau.c
The goal is being able to use vdpau decoding independently from vo_vdpau.c.
Diffstat (limited to 'video/vdpau.h')
-rw-r--r--video/vdpau.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/video/vdpau.h b/video/vdpau.h
index 79fc842971..9b67025347 100644
--- a/video/vdpau.h
+++ b/video/vdpau.h
@@ -31,19 +31,38 @@ struct vdp_functions {
#undef VDP_FUNCTION
};
+
+#define MAX_VIDEO_SURFACES 50
+
// Shared state. Objects created from different VdpDevices are often (always?)
// incompatible to each other, so all code must use a shared VdpDevice.
struct mp_vdpau_ctx {
struct vdp_functions *vdp;
+ VdpGetProcAddress *get_proc_address;
VdpDevice vdp_device;
bool is_preempted; // set to true during unavailability
uint64_t preemption_counter; // incremented after _restoring_
- bool (*status_ok)(struct mp_vdpau_ctx *ctx);
- struct mp_image *(*get_video_surface)(struct mp_vdpau_ctx *ctx, int fmt,
- VdpChromaType chroma, int w, int h);
- void *priv; // for VO
+
+ bool preemption_user_notified;
+ double last_preemption_retry_fail;
+
+ struct vo_x11_state *x11;
+
+ // Surface pool
+ struct surface_entry {
+ VdpVideoSurface surface;
+ int fmt, w, h;
+ VdpChromaType chroma;
+ bool in_use;
+ } video_surfaces[MAX_VIDEO_SURFACES];
+
+ struct mp_log *log;
};
+struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log,
+ struct vo_x11_state *x11);
+void mp_vdpau_destroy(struct mp_vdpau_ctx *ctx);
+
bool mp_vdpau_status_ok(struct mp_vdpau_ctx *ctx);
struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx, int fmt,