-- v2: qcap: Check the subtype of video format.
From: Haoyang Chen chenhaoyang@kylinos.cn
--- dlls/qcap/tests/videocapture.c | 8 ++++++++ dlls/qcap/v4l.c | 1 + 2 files changed, 9 insertions(+)
diff --git a/dlls/qcap/tests/videocapture.c b/dlls/qcap/tests/videocapture.c index 3569bf33da4..d94c3387c60 100644 --- a/dlls/qcap/tests/videocapture.c +++ b/dlls/qcap/tests/videocapture.c @@ -208,6 +208,14 @@ static void test_stream_config(IPin *pin) DeleteMediaType(format); }
+ if(winetest_platform_is_wine) + { + hr = IAMStreamConfig_GetFormat(stream_config, &format); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + format->subtype = MEDIASUBTYPE_UYVY; /* we currently only support rgb24, so setting yuv should fail. */ + hr = IAMStreamConfig_SetFormat(stream_config, format); + ok(hr == E_FAIL, "Got hr %#lx.\n", hr); + } IAMStreamConfig_Release(stream_config); }
diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index 5ab9613b4e2..5efb4b7e505 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -141,6 +141,7 @@ static const struct caps *find_caps(struct video_capture_device *device, const A struct caps *caps = &device->caps[index];
if (IsEqualGUID(&mt->formattype, &caps->media_type.formattype) + && IsEqualGUID(&mt->subtype, &caps->media_type.subtype) && video_info->bmiHeader.biWidth == caps->video_info.bmiHeader.biWidth && video_info->bmiHeader.biHeight == caps->video_info.bmiHeader.biHeight) return caps;