diff options
author | wm4 <wm4@nowhere> | 2016-05-09 19:42:03 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-05-09 20:03:22 +0200 |
commit | 46fff8d31af0b79fe3de4aaee93bb66c248118a0 (patch) | |
tree | efe5b04a4e9daf89195a4c758fe93ace9bee385f /video/decode/lavc.h | |
parent | ee4c00698f7e4b04579494f262e668840c2668b3 (diff) | |
download | mpv-46fff8d31af0b79fe3de4aaee93bb66c248118a0.tar.bz2 mpv-46fff8d31af0b79fe3de4aaee93bb66c248118a0.tar.xz |
video: refactor how VO exports hwdec device handles
The main change is with video/hwdec.h. mp_hwdec_info is made opaque (and
renamed to mp_hwdec_devices). Its accessors are mainly thread-safe (or
documented where not), which makes the whole thing saner and cleaner. In
particular, thread-safety rules become less subtle and more obvious.
The new internal API makes it easier to support multiple OpenGL interop
backends. (Although this is not done yet, and it's not clear whether it
ever will.)
This also removes all the API-specific fields from mp_hwdec_ctx and
replaces them with a "ctx" field. For d3d in particular, we drop the
mp_d3d_ctx struct completely, and pass the interfaces directly.
Remove the emulation checks from vaapi.c and vdpau.c; they are
pointless, and the checks that matter are done on the VO layer.
The d3d hardware decoders might slightly change behavior: dxva2-copy
will not use the VO device anymore if the VO supports proper interop.
This pretty much assumes that any in such cases the VO will not use any
form of exclusive mode, which makes using the VO device in copy mode
unnecessary.
This is a big refactor. Some things may be untested and could be broken.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r-- | video/decode/lavc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index 73243e16c4..dbefe79ad9 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -30,7 +30,7 @@ typedef struct lavc_ctx { int max_delay_queue; // From VO - struct mp_hwdec_info *hwdec_info; + struct mp_hwdec_devices *hwdec_devs; // For free use by hwdec implementation void *hwdec_priv; @@ -54,7 +54,7 @@ struct vd_lavc_hwdec { // efficiency by not blocking on the hardware pipeline by reading back // immediately after decoding. int delay_queue; - int (*probe)(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info, + int (*probe)(struct lavc_ctx *ctx, struct vd_lavc_hwdec *hwdec, const char *codec); int (*init)(struct lavc_ctx *ctx); int (*init_decoder)(struct lavc_ctx *ctx, int w, int h); |