qcap/tests: Refactor interface testing.
Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f348b87bf8
commit
84f89605fe
|
@ -174,27 +174,12 @@ static void test_stream_config(IPin *pin)
|
||||||
IAMStreamConfig_Release(stream_config);
|
IAMStreamConfig_Release(stream_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_capture(IBaseFilter *filter)
|
static void test_pin_interfaces(IPin *pin)
|
||||||
{
|
{
|
||||||
IEnumPins *enum_pins;
|
|
||||||
IPin *pin;
|
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
hr = IBaseFilter_EnumPins(filter, &enum_pins);
|
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
|
||||||
|
|
||||||
while ((hr = IEnumPins_Next(enum_pins, 1, &pin, NULL)) == S_OK)
|
|
||||||
{
|
|
||||||
PIN_DIRECTION pin_direction;
|
|
||||||
IPin_QueryDirection(pin, &pin_direction);
|
|
||||||
if (pin_direction == PINDIR_OUTPUT)
|
|
||||||
{
|
|
||||||
test_media_types(pin);
|
|
||||||
test_stream_config(pin);
|
|
||||||
|
|
||||||
todo_wine check_interface(pin, &IID_IAMBufferNegotiation, TRUE);
|
todo_wine check_interface(pin, &IID_IAMBufferNegotiation, TRUE);
|
||||||
check_interface(pin, &IID_IAMStreamConfig, TRUE);
|
check_interface(pin, &IID_IAMStreamConfig, TRUE);
|
||||||
todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE);
|
todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE);
|
||||||
|
todo_wine check_interface(pin, &IID_IKsPin, TRUE);
|
||||||
check_interface(pin, &IID_IKsPropertySet, TRUE);
|
check_interface(pin, &IID_IKsPropertySet, TRUE);
|
||||||
todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE);
|
todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE);
|
||||||
check_interface(pin, &IID_IPin, TRUE);
|
check_interface(pin, &IID_IPin, TRUE);
|
||||||
|
@ -209,12 +194,36 @@ static void test_capture(IBaseFilter *filter)
|
||||||
check_interface(pin, &IID_IAMVideoCompression, FALSE);
|
check_interface(pin, &IID_IAMVideoCompression, FALSE);
|
||||||
check_interface(pin, &IID_IAMVideoProcAmp, FALSE);
|
check_interface(pin, &IID_IAMVideoProcAmp, FALSE);
|
||||||
check_interface(pin, &IID_IPersistPropertyBag, FALSE);
|
check_interface(pin, &IID_IPersistPropertyBag, FALSE);
|
||||||
|
check_interface(pin, &IID_IStreamBuilder, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_pins(IBaseFilter *filter)
|
||||||
|
{
|
||||||
|
IEnumPins *enum_pins;
|
||||||
|
IPin *pin;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = IBaseFilter_EnumPins(filter, &enum_pins);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
while ((hr = IEnumPins_Next(enum_pins, 1, &pin, NULL)) == S_OK)
|
||||||
|
{
|
||||||
|
PIN_DIRECTION pin_direction;
|
||||||
|
IPin_QueryDirection(pin, &pin_direction);
|
||||||
|
if (pin_direction == PINDIR_OUTPUT)
|
||||||
|
{
|
||||||
|
test_pin_interfaces(pin);
|
||||||
|
test_media_types(pin);
|
||||||
|
test_stream_config(pin);
|
||||||
}
|
}
|
||||||
IPin_Release(pin);
|
IPin_Release(pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumPins_Release(enum_pins);
|
IEnumPins_Release(enum_pins);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_filter_interfaces(IBaseFilter *filter)
|
||||||
|
{
|
||||||
check_interface(filter, &IID_IAMFilterMiscFlags, TRUE);
|
check_interface(filter, &IID_IAMFilterMiscFlags, TRUE);
|
||||||
check_interface(filter, &IID_IAMVideoControl, TRUE);
|
check_interface(filter, &IID_IAMVideoControl, TRUE);
|
||||||
check_interface(filter, &IID_IAMVideoProcAmp, TRUE);
|
check_interface(filter, &IID_IAMVideoProcAmp, TRUE);
|
||||||
|
@ -287,7 +296,8 @@ START_TEST(videocapture)
|
||||||
hr = IMoniker_BindToObject(moniker, NULL, NULL, &IID_IBaseFilter, (void**)&filter);
|
hr = IMoniker_BindToObject(moniker, NULL, NULL, &IID_IBaseFilter, (void**)&filter);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
test_capture(filter);
|
test_filter_interfaces(filter);
|
||||||
|
test_pins(filter);
|
||||||
test_misc_flags(filter);
|
test_misc_flags(filter);
|
||||||
ref = IBaseFilter_Release(filter);
|
ref = IBaseFilter_Release(filter);
|
||||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||||
|
|
Loading…
Reference in New Issue