diff options
author | wm4 <wm4@nowhere> | 2017-10-16 16:56:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-16 17:00:38 +0200 |
commit | 1ff6a1c8c7eae341a4052b115083005663c44503 (patch) | |
tree | 65ac79f7872ec630c39946eb734eca084dc49ba4 /video/hwdec.h | |
parent | 0a7c5a130e73c7c96faafc7da80fa56ee9b7bf00 (diff) | |
download | mpv-1ff6a1c8c7eae341a4052b115083005663c44503.tar.bz2 mpv-1ff6a1c8c7eae341a4052b115083005663c44503.tar.xz |
video: make previously added hwdec params mechanism more generic
The mechanism introduced in b135af6842bf assumed AVHWFramesContext would
be enough. Apparently it's not - the intended use with Rockchip (not
Rokchip btw.) requires accessing actual frame data in order to access
the AVDRMFrameDescriptor struct.
Just pass the entire mp_image to the new function. This is more
flexible, although it slightly worries me that it will be less reusable
for things which require setting up mp_image_params before any real
frames are processed (such as filters).
Diffstat (limited to 'video/hwdec.h')
-rw-r--r-- | video/hwdec.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/video/hwdec.h b/video/hwdec.h index 4376d47a14..d65db3bc1d 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -121,11 +121,12 @@ struct mp_image_params; // For now, all entries are strictly optional. struct hwcontext_fns { int av_hwdevice_type; - // Set any mp_image_params fields that can not be set in generic code. - // (Generic code sets width, height, hw_subfmt, etc., but some very specific - // flags or such might require specific code for some hwcontexts.) - void (*complete_image_params)(struct AVHWFramesContext *hw_frames, - struct mp_image_params *p); + // Set any mp_image fields that require hwcontext specific code, such as + // fields or flags not present in AVFrame or AVHWFramesContext in a + // portable way. This is called directly after img is converted from an + // AVFrame, with all other fields already set. img.hwctx will be set, and + // use the correct AV_HWDEVICE_TYPE_. + void (*complete_image_params)(struct mp_image *img); }; // The parameter is of type enum AVHWDeviceType (as in int to avoid extensive |