[PATCH v2] qcap: implement and test VfwPin_CheckMediaType()
VfwPin_CheckMediaType() always return a hardcoded E_NOTIMPL, preventing any media format from being negotiated, and limiting video capture devices from connecting to many other filters. Implement it and test. In try 2, instead of the high-level test of connecting to a NullRenderer, more elaborate lower-level testing is done: we test that the device can accept all of its own media types, and prove that AM_MEDIA_TYPEs of NULL, GUID_NULL, FORMAT_Empty, and a NULL pbFormat, all fail. The implementation matches results obtained by testing against 2 webcams on Windows. Also coding style was cleaned up. Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com> --- dlls/qcap/capture.h | 1 + dlls/qcap/tests/Makefile.in | 3 +- dlls/qcap/tests/videocapture.c | 149 +++++++++++++++++++++++++++++++++ dlls/qcap/v4l.c | 50 +++++++++-- dlls/qcap/vfwcapture.c | 4 +- 5 files changed, 198 insertions(+), 9 deletions(-) create mode 100644 dlls/qcap/tests/videocapture.c
On 4/24/19 1:18 AM, Damjan Jovanovic wrote:
+ memset(&empty_media_type, 0, sizeof(empty_media_type)); + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.majortype = MEDIATYPE_Video; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.formattype = FORMAT_VideoInfo; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.formattype = FORMAT_None; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr);
Is it possible to test for S_FALSE directly here? I unfortunately don't have a camera with me at the moment to test.
On Mon, Apr 29, 2019 at 2:28 AM Zebediah Figura <z.figura12(a)gmail.com> wrote:
On 4/24/19 1:18 AM, Damjan Jovanovic wrote:
+ memset(&empty_media_type, 0, sizeof(empty_media_type)); + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.majortype = MEDIATYPE_Video; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.formattype = FORMAT_VideoInfo; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr); + + empty_media_type.formattype = FORMAT_None; + hr = IPin_QueryAccept(pin, &empty_media_type); + ok(hr != S_OK, "Got hr %#x.\n", hr);
Is it possible to test for S_FALSE directly here? I unfortunately don't have a camera with me at the moment to test.
Mine returns E_FAIL and others.
participants (2)
-
Damjan Jovanovic -
Zebediah Figura