summaryrefslogtreecommitdiffstats
path: root/video/decode/lavc.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-16 16:28:36 +0100
committerwm4 <wm4@nowhere>2017-02-16 17:00:20 +0100
commit807147d9c063bd8b9711f69f31579ccdef30efdf (patch)
treed90e88c7c4e70c1af927194fb2d444c494ac370a /video/decode/lavc.h
parentb949f2cee6af1ef47adcb6cf770e54c2787fa25c (diff)
downloadmpv-807147d9c063bd8b9711f69f31579ccdef30efdf.tar.bz2
mpv-807147d9c063bd8b9711f69f31579ccdef30efdf.tar.xz
vd_lavc: move most vaapi hwaccel setup code to generic code
Now hw_vaapi.c contains only the device setup, which could probably also be abstracted.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r--video/decode/lavc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index 46bf85a6e5..b41d56ce2f 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -55,6 +55,9 @@ typedef struct lavc_ctx {
// For free use by hwdec implementation
void *hwdec_priv;
+ // Set by generic hwaccels.
+ struct mp_hwdec_ctx *hwdec_dev;
+
int hwdec_fmt;
int hwdec_w;
int hwdec_h;
@@ -98,6 +101,16 @@ struct vd_lavc_hwdec {
// with hwdec_find_decoder.
// Intuitively, this will force the corresponding wrapper decoder.
const char *lavc_suffix;
+ // Generic hwaccels set AVCodecContext.hw_frames_ctx in get_format().
+ // pixfmt_map must be non-NULL.
+ // struct lavc_ctx.hwdec_dev must be set at runtime (in init).
+ bool generic_hwaccel;
+ // Array of pixfmt pairs. The first pixfmt is the AVCodecContext.sw_pix_fmt,
+ // the second the required AVHWFramesContext.sw_format.
+ const enum AVPixelFormat (*pixfmt_map)[2];
+ // The generic hwaccel has a fixed pool size. Enough surfaces need to be
+ // preallocated before decoding begins. If false, pool size is left to 0.
+ bool static_pool;
};
enum {