summaryrefslogtreecommitdiffstats
path: root/video/decode/lavc.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-05-03 05:23:25 +0200
committerwm4 <wm4@nowhere>2017-05-03 05:23:37 +0200
commitde225e3a6a471525fd2efebd9fbbcaf6849127b9 (patch)
treeb110fe12ffb8b4f8c7a588fa0c65dc51787d35b8 /video/decode/lavc.h
parentd1dbd97878b932db611622255abf04f0ccfa1db9 (diff)
downloadmpv-de225e3a6a471525fd2efebd9fbbcaf6849127b9.tar.bz2
mpv-de225e3a6a471525fd2efebd9fbbcaf6849127b9.tar.xz
vd_lavc: add support for decoders which use AVCodecContext.hw_device_ctx
These decoders can select the decoding device with hw_device_ctx, but don't use hw_frames_ctx (at least not in a meaningful way). Currently unused, but intended to be used for cuvid, as soon as it hits ffmpeg git master. Also make the vdpau and vaapi hwaccel definition structs static, as we have removed the old code which would have had clashing external declarations.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r--video/decode/lavc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index 4df92e40a6..a09929e29b 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -97,7 +97,7 @@ struct vd_lavc_hwdec {
// Process the image returned by the libavcodec decoder.
struct mp_image *(*process_image)(struct lavc_ctx *ctx, struct mp_image *img);
// For copy hwdecs. If probing is true, don't log errors if unavailable.
- // The returned device must be freed with mp_hwdec_ctx->destroy.
+ // The returned device will be freed with mp_hwdec_ctx->destroy.
struct mp_hwdec_ctx *(*create_dev)(struct mpv_global *global,
struct mp_log *log, bool probing);
// Suffix for libavcodec decoder. If non-NULL, the codec is overridden
@@ -105,9 +105,10 @@ struct vd_lavc_hwdec {
// 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;
+ // If set, AVCodecContext.hw_frames_ctx will be initialized in get_format,
+ // and pixfmt_map must be non-NULL.
+ bool set_hwframes;
// 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];