[PATCH 1/4] evr/tests: Add basic creation test for default mixer object.

Nikolay Sivov nsivov at codeweavers.com
Wed Jun 17 10:16:15 CDT 2020



On 6/17/20 6:12 PM, Zebediah Figura wrote:
> On 6/17/20 6:59 AM, Nikolay Sivov wrote:
>> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
>> ---
>>   dlls/evr/Makefile.in       |  3 ++-
>>   dlls/evr/evr.spec          |  2 +-
>>   dlls/evr/mixer.c           | 28 ++++++++++++++++++++
>>   dlls/evr/tests/Makefile.in |  2 +-
>>   dlls/evr/tests/evr.c       | 32 ++++++++++++++++++++++
>>   include/evr.idl            | 54 ++++++++++++++++++++++++++++++++++++++
>>   6 files changed, 118 insertions(+), 3 deletions(-)
>>   create mode 100644 dlls/evr/mixer.c
>>
>> diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in
>> index 053d80e61d7..b1db77e639f 100644
>> --- a/dlls/evr/Makefile.in
>> +++ b/dlls/evr/Makefile.in
>> @@ -5,6 +5,7 @@ EXTRADLLFLAGS = -mno-cygwin
>>   
>>   C_SRCS = \
>>   	evr.c \
>> -	main.c
>> +	main.c \
>> +	mixer.c
>>   
>>   IDL_SRCS = evr_classes.idl
>> diff --git a/dlls/evr/evr.spec b/dlls/evr/evr.spec
>> index c78900c5762..ea87f16da15 100644
>> --- a/dlls/evr/evr.spec
>> +++ b/dlls/evr/evr.spec
>> @@ -13,7 +13,7 @@
>>   @ stub MFCreateVideoMediaTypeFromSubtype
>>   @ stub MFCreateVideoMediaTypeFromVideoInfoHeader2
>>   @ stub MFCreateVideoMediaTypeFromVideoInfoHeader
>> -@ stub MFCreateVideoMixer
>> +@ stdcall MFCreateVideoMixer(ptr ptr ptr ptr)
>>   @ stub MFCreateVideoMixerAndPresenter
>>   @ stub MFCreateVideoOTA
>>   @ stub MFCreateVideoPresenter2
>> diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c
>> new file mode 100644
>> index 00000000000..fe2f4bab1df
>> --- /dev/null
>> +++ b/dlls/evr/mixer.c
>> @@ -0,0 +1,28 @@
>> +/*
>> + * Copyright 2020 Nikolay Sivov
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
>> + */
>> +
>> +#include "wine/debug.h"
>> +#include "evr.h"
>> +
>> +WINE_DEFAULT_DEBUG_CHANNEL(evr);
>> +
>> +HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj)
>> +{
>> +    FIXME("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj);
>> +    return E_NOTIMPL;
>> +}
>> diff --git a/dlls/evr/tests/Makefile.in b/dlls/evr/tests/Makefile.in
>> index 8dc11e5e558..529c5354508 100644
>> --- a/dlls/evr/tests/Makefile.in
>> +++ b/dlls/evr/tests/Makefile.in
>> @@ -1,5 +1,5 @@
>>   TESTDLL   = evr.dll
>> -IMPORTS   = mfuuid strmiids uuid ole32 oleaut32
>> +IMPORTS   = mfuuid strmiids uuid dxguid ole32 oleaut32 evr
>>   
>>   C_SRCS = \
>>   	evr.c
>> diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
>> index 489b7b949db..adb2b777a2e 100644
>> --- a/dlls/evr/tests/evr.c
>> +++ b/dlls/evr/tests/evr.c
>> @@ -22,6 +22,7 @@
>>   #include "dshow.h"
>>   #include "wine/test.h"
>>   #include "d3d9.h"
>> +#include "evr.h"
>>   #include "initguid.h"
>>   #include "dxva2api.h"
>>   
>> @@ -337,6 +338,36 @@ static void test_pin_info(void)
>>       ok(!ref, "Got outstanding refcount %d.\n", ref);
>>   }
>>   
>> +static void test_default_mixer(void)
>> +{
>> +    IMFTransform *transform;
>> +    IUnknown *unk;
>> +    HRESULT hr;
>> +
>> +    hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform);
>> +todo_wine
>> +    ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
>> +    if (FAILED(hr))
>> +        return;
>> +
>> +    hr = IMFTransform_QueryInterface(transform, &IID_IMFTopologyServiceLookupClient, (void **)&unk);
>> +    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
>> +    IUnknown_Release(unk);
>> +
>> +    hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&unk);
>> +    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
>> +    IUnknown_Release(unk);
>> +
>> +    IMFTransform_Release(transform);
>> +
>> +    hr = MFCreateVideoMixer(NULL, &IID_IMFTransform, &IID_IMFTransform, (void **)&transform);
>> +    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
>> +
>> +    hr = CoCreateInstance(&CLSID_MFVideoMixer9, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)&transform);
>> +    ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
>> +    IMFTransform_Release(transform);
>> +}
>> +
>>   START_TEST(evr)
>>   {
>>       CoInitialize(NULL);
>> @@ -346,6 +377,7 @@ START_TEST(evr)
>>       test_enum_pins();
>>       test_find_pin();
>>       test_pin_info();
>> +    test_default_mixer();
>>   
>>       CoUninitialize();
>>   }
> I think it would probably be a good idea to separate mfplat tests from
> quartz tests, i.e. by putting them in a separate file.

Why? IMF* interfaces are also used in DirectShow situation for EVR. I 
don't see a reason to make tests more separate
than the thing it's testing.

>
>> diff --git a/include/evr.idl b/include/evr.idl
>> index 3768b41b16e..39b4853b2e3 100644
>> --- a/include/evr.idl
>> +++ b/include/evr.idl
>> @@ -107,3 +107,57 @@ interface IMFVideoRenderer : IUnknown
>>           [in] IMFVideoPresenter *pVideoPresenter
>>       );
>>   }
>> +
>> +typedef enum _MF_SERVICE_LOOKUP_TYPE
>> +{
>> +    MF_SERVICE_LOOKUP_UPSTREAM,
>> +    MF_SERVICE_LOOKUP_UPSTREAM_DIRECT,
>> +    MF_SERVICE_LOOKUP_DOWNSTREAM,
>> +    MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT,
>> +    MF_SERVICE_LOOKUP_ALL,
>> +    MF_SERVICE_LOOKUP_GLOBAL,
>> +} MF_SERVICE_LOOKUP_TYPE;
>> +
>> +[
>> +    object,
>> +    uuid(fa993889-4383-415a-a930-dd472a8cf6f7),
>> +    local
>> +]
>> +interface IMFTopologyServiceLookup : IUnknown
>> +{
>> +    HRESULT LookupService(
>> +        [in] MF_SERVICE_LOOKUP_TYPE lookup_type,
>> +        [in] DWORD index,
>> +        [in] REFGUID service,
>> +        [in] REFIID riid,
>> +        [out, iid_is(riid)] void **objects,
>> +        [in, out] DWORD *num_objects
>> +    );
>> +}
>> +
>> +[
>> +    object,
>> +    uuid(fa99388a-4383-415a-a930-dd472a8cf6f7),
>> +    local
>> +]
>> +interface IMFTopologyServiceLookupClient : IUnknown
>> +{
>> +    HRESULT InitServicePointers(
>> +        [in] IMFTopologyServiceLookup *service_lookup
>> +    );
>> +    HRESULT ReleaseServicePointers();
>> +}
>> +
>> +[
>> +    object,
>> +    uuid(a38d9567-5a9c-4f3c-b293-8eb415b279ba),
>> +    local
>> +]
>> +interface IMFVideoDeviceID : IUnknown
>> +{
>> +    HRESULT GetDeviceID(
>> +        [out] IID *device_id
>> +    );
>> +}
>> +
>> +cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);")
>>




More information about the wine-devel mailing list