summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-16 16:56:24 +0200
committerwm4 <wm4@nowhere>2017-10-16 17:00:38 +0200
commit1ff6a1c8c7eae341a4052b115083005663c44503 (patch)
tree65ac79f7872ec630c39946eb734eca084dc49ba4 /video/decode
parent0a7c5a130e73c7c96faafc7da80fa56ee9b7bf00 (diff)
downloadmpv-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/decode')
-rw-r--r--video/decode/d3d.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/video/decode/d3d.c b/video/decode/d3d.c
index 0a44c0f507..cb323f9b01 100644
--- a/video/decode/d3d.c
+++ b/video/decode/d3d.c
@@ -138,12 +138,13 @@ AVBufferRef *d3d11_wrap_device_ref(ID3D11Device *device)
return device_ref;
}
-static void d3d11_complete_image_params(struct AVHWFramesContext *hw_frames,
- struct mp_image_params *p)
+static void d3d11_complete_image_params(struct mp_image *img)
{
+ AVHWFramesContext *hw_frames = (void *)img->hwctx->data;
+
// According to hwcontex_d3d11va.h, this means DXGI_FORMAT_420_OPAQUE.
- p->hw_flags = hw_frames->sw_format == AV_PIX_FMT_YUV420P
- ? MP_IMAGE_HW_FLAG_OPAQUE : 0;
+ img->params.hw_flags = hw_frames->sw_format == AV_PIX_FMT_YUV420P
+ ? MP_IMAGE_HW_FLAG_OPAQUE : 0;
}
const struct hwcontext_fns hwcontext_fns_d3d11 = {