summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2020-10-28 00:47:49 +0900
committerTim-Philipp Müller <tim@centricular.com>2020-10-29 23:30:13 +0000
commit6db6a8c7d9ffcf2b7e226b7e874ee67b82f24ac8 (patch)
tree6d54c71657466594fe72d280dc6086b0a22bd90d
parentc9bb28377f76f5ff8b8270131351cc18608c48ff (diff)
downloadgstreamer-plugins-bad-6db6a8c7d9ffcf2b7e226b7e874ee67b82f24ac8.tar.gz
d3d11videoprocessor: Fix wrong input/output supportability check
The flag argument of ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat method is output value, not input. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1736>
-rw-r--r--sys/d3d11/gstd3d11videoprocessor.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/d3d11/gstd3d11videoprocessor.c b/sys/d3d11/gstd3d11videoprocessor.c
index ed2bd748a..94e601dfe 100644
--- a/sys/d3d11/gstd3d11videoprocessor.c
+++ b/sys/d3d11/gstd3d11videoprocessor.c
@@ -190,20 +190,25 @@ gst_d3d11_video_processor_supports_format (GstD3D11VideoProcessor *
self, DXGI_FORMAT format, gboolean is_input)
{
HRESULT hr;
- UINT flag;
+ UINT flag = 0;
+
+ hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat
+ (self->enumerator, format, &flag);
+
+ if (!gst_d3d11_result (hr, self->device))
+ return FALSE;
if (is_input) {
/* D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT, missing in mingw header */
- flag = 1;
+ if ((flag & 0x1) != 0)
+ return TRUE;
} else {
/* D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT, missing in mingw header */
- flag = 2;
+ if ((flag & 0x2) != 0)
+ return TRUE;
}
- hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat
- (self->enumerator, format, &flag);
-
- return gst_d3d11_result (hr, self->device);
+ return FALSE;
}
gboolean