qedit/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
05d3b1d8f3
commit
0fb1d1f2ae
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = qedit.dll
|
||||
IMPORTS = strmbase strmiids uuid oleaut32 ole32
|
||||
|
||||
|
|
|
@ -82,53 +82,53 @@ static void test_aggregation(void)
|
|||
detector = (IMediaDet *)0xdeadbeef;
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMediaDet, (void **)&detector);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!detector, "Got interface %p.\n", detector);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IUnknown, (void **)&unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
|
||||
ref = get_refcount(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
ref = IUnknown_AddRef(unk);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
|
||||
IUnknown_Release(unk2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IMediaDet, (void **)&detector);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_QueryInterface(detector, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IMediaDet_QueryInterface(detector, &IID_IMediaDet, (void **)&detector2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(detector2 == (IMediaDet *)0xdeadbeef, "Got unexpected IMediaDet %p.\n", detector2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IMediaDet_QueryInterface(detector, &test_iid, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
IMediaDet_Release(detector);
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(!ref, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(!ref, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
}
|
||||
|
||||
struct testfilter
|
||||
|
@ -448,15 +448,14 @@ static void test_mediadet(void)
|
|||
HRESULT hr;
|
||||
FILTER_INFO filter_info;
|
||||
AM_MEDIA_TYPE mt, *pmt;
|
||||
LONG index, ref, count;
|
||||
IEnumMediaTypes *type;
|
||||
IMediaDet *pM = NULL;
|
||||
BSTR filename = NULL;
|
||||
IBaseFilter *filter;
|
||||
IEnumPins *enumpins;
|
||||
LONG nstrms = 0;
|
||||
IUnknown *unk;
|
||||
IPin *pin;
|
||||
LONG strm;
|
||||
GUID guid;
|
||||
BSTR bstr;
|
||||
double fps;
|
||||
|
@ -466,185 +465,185 @@ static void test_mediadet(void)
|
|||
/* test.avi has one video stream. */
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMediaDet, (LPVOID*)&pM);
|
||||
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(pM != NULL, "pM is NULL\n");
|
||||
|
||||
filename = NULL;
|
||||
hr = IMediaDet_get_Filename(pM, &filename);
|
||||
/* Despite what MSDN claims, this returns S_OK. */
|
||||
ok(hr == S_OK, "IMediaDet_get_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(filename == NULL, "IMediaDet_get_Filename\n");
|
||||
|
||||
filename = (BSTR) -1;
|
||||
hr = IMediaDet_get_Filename(pM, &filename);
|
||||
/* Despite what MSDN claims, this returns S_OK. */
|
||||
ok(hr == S_OK, "IMediaDet_get_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(filename == NULL, "IMediaDet_get_Filename\n");
|
||||
|
||||
nstrms = -1;
|
||||
hr = IMediaDet_get_OutputStreams(pM, &nstrms);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_get_OutputStreams failed: %08x\n", hr);
|
||||
ok(nstrms == -1, "IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
|
||||
count = -1;
|
||||
hr = IMediaDet_get_OutputStreams(pM, &count);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
ok(count == -1, "Got %ld streams.\n", count);
|
||||
|
||||
strm = -1;
|
||||
index = -1;
|
||||
/* The stream defaults to 0, even without a file! */
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 0, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream index %ld.\n", index);
|
||||
|
||||
hr = IMediaDet_get_CurrentStream(pM, NULL);
|
||||
ok(hr == E_POINTER, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* But put_CurrentStream doesn't. */
|
||||
hr = IMediaDet_put_CurrentStream(pM, 0);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_put_CurrentStream(pM, -1);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamMediaType(pM, &mt);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamMediaType(pM, NULL);
|
||||
ok(hr == E_POINTER, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamType(pM, &guid);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamType(pM, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamTypeB(pM, &bstr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamTypeB(pM, NULL);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_Filter(pM, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
unk = (IUnknown*)0xdeadbeef;
|
||||
hr = IMediaDet_get_Filter(pM, &unk);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(!unk, "Got filter %p.\n", unk);
|
||||
|
||||
filename = SysAllocString(test_avi_filename);
|
||||
hr = IMediaDet_put_Filename(pM, filename);
|
||||
ok(hr == S_OK, "IMediaDet_put_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
SysFreeString(filename);
|
||||
|
||||
strm = -1;
|
||||
index = -1;
|
||||
/* The stream defaults to 0. */
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 0, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream index %ld.\n", index);
|
||||
|
||||
ZeroMemory(&mt, sizeof mt);
|
||||
hr = IMediaDet_get_StreamMediaType(pM, &mt);
|
||||
ok(hr == S_OK, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
CoTaskMemFree(mt.pbFormat);
|
||||
|
||||
hr = IMediaDet_get_StreamType(pM, &guid);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
|
||||
|
||||
hr = IMediaDet_get_StreamTypeB(pM, &bstr);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(bstr, L"{73646976-0000-0010-8000-00AA00389B71}"),
|
||||
"Got major type %s.\n", debugstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
/* Even before get_OutputStreams. */
|
||||
hr = IMediaDet_put_CurrentStream(pM, 1);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_OutputStreams(pM, &nstrms);
|
||||
ok(hr == S_OK, "IMediaDet_get_OutputStreams failed: %08x\n", hr);
|
||||
ok(nstrms == 1, "IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
|
||||
hr = IMediaDet_get_OutputStreams(pM, &count);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(count == 1, "Got %ld streams.\n", count);
|
||||
|
||||
filename = NULL;
|
||||
hr = IMediaDet_get_Filename(pM, &filename);
|
||||
ok(hr == S_OK, "IMediaDet_get_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(filename, test_avi_filename), "Expected filename %s, got %s.\n",
|
||||
debugstr_w(test_avi_filename), debugstr_w(filename));
|
||||
SysFreeString(filename);
|
||||
|
||||
hr = IMediaDet_get_Filename(pM, NULL);
|
||||
ok(hr == E_POINTER, "IMediaDet_get_Filename failed: %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
strm = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 0, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
index = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream index %ld.\n", index);
|
||||
|
||||
hr = IMediaDet_get_CurrentStream(pM, NULL);
|
||||
ok(hr == E_POINTER, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_put_CurrentStream(pM, -1);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_put_CurrentStream(pM, 1);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* Try again. */
|
||||
strm = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 0, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
index = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream index %ld.\n", index);
|
||||
|
||||
hr = IMediaDet_put_CurrentStream(pM, 0);
|
||||
ok(hr == S_OK, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
strm = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 0, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
index = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream index %ld.\n", index);
|
||||
|
||||
ZeroMemory(&mt, sizeof mt);
|
||||
hr = IMediaDet_get_StreamMediaType(pM, &mt);
|
||||
ok(hr == S_OK, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Video),
|
||||
"IMediaDet_get_StreamMediaType\n");
|
||||
CoTaskMemFree(mt.pbFormat);
|
||||
|
||||
hr = IMediaDet_get_StreamType(pM, &guid);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
|
||||
|
||||
hr = IMediaDet_get_StreamTypeB(pM, &bstr);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(bstr, L"{73646976-0000-0010-8000-00AA00389B71}"),
|
||||
"Got major type %s.\n", debugstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
hr = IMediaDet_get_FrameRate(pM, NULL);
|
||||
ok(hr == E_POINTER, "IMediaDet_get_FrameRate failed: %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_FrameRate(pM, &fps);
|
||||
ok(hr == S_OK, "IMediaDet_get_FrameRate failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(fps == 10.0, "IMediaDet_get_FrameRate: fps is %f\n", fps);
|
||||
|
||||
hr = IMediaDet_Release(pM);
|
||||
ok(hr == 0, "IMediaDet_Release returned: %x\n", hr);
|
||||
ref = IMediaDet_Release(pM);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
|
||||
/* test_sound.avi has one video stream and one audio stream. */
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMediaDet, (LPVOID*)&pM);
|
||||
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(pM != NULL, "pM is NULL\n");
|
||||
|
||||
filename = SysAllocString(test_sound_avi_filename);
|
||||
hr = IMediaDet_put_Filename(pM, filename);
|
||||
ok(hr == S_OK, "IMediaDet_put_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
SysFreeString(filename);
|
||||
|
||||
hr = IMediaDet_get_OutputStreams(pM, &nstrms);
|
||||
ok(hr == S_OK, "IMediaDet_get_OutputStreams failed: %08x\n", hr);
|
||||
ok(nstrms == 2, "IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
|
||||
hr = IMediaDet_get_OutputStreams(pM, &count);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(count == 2, "Got %ld streams.\n", count);
|
||||
|
||||
filename = NULL;
|
||||
hr = IMediaDet_get_Filename(pM, &filename);
|
||||
ok(hr == S_OK, "IMediaDet_get_Filename failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(filename, test_sound_avi_filename), "Expected filename %s, got %s.\n",
|
||||
debugstr_w(test_sound_avi_filename), debugstr_w(filename));
|
||||
SysFreeString(filename);
|
||||
|
@ -656,16 +655,16 @@ static void test_mediadet(void)
|
|||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
hr = IMediaDet_put_CurrentStream(pM, i);
|
||||
ok(hr == S_OK, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
strm = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == i, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
index = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == i, "Got stream index %ld.\n", index);
|
||||
|
||||
ZeroMemory(&mt, sizeof mt);
|
||||
hr = IMediaDet_get_StreamMediaType(pM, &mt);
|
||||
ok(hr == S_OK, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
flags += (IsEqualGUID(&mt.majortype, &MEDIATYPE_Video)
|
||||
? 1
|
||||
: (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio)
|
||||
|
@ -675,17 +674,17 @@ static void test_mediadet(void)
|
|||
if (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio))
|
||||
{
|
||||
hr = IMediaDet_get_StreamType(pM, &guid);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(IsEqualGUID(&guid, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&guid));
|
||||
|
||||
hr = IMediaDet_get_StreamTypeB(pM, &bstr);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(bstr, L"{73647561-0000-0010-8000-00AA00389B71}"),
|
||||
"Got major type %s.\n", debugstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
hr = IMediaDet_get_FrameRate(pM, &fps);
|
||||
ok(hr == VFW_E_INVALIDMEDIATYPE, "IMediaDet_get_FrameRate failed: %08x\n", hr);
|
||||
ok(hr == VFW_E_INVALIDMEDIATYPE, "Got hr %#lx.\n", hr);
|
||||
}
|
||||
|
||||
CoTaskMemFree(mt.pbFormat);
|
||||
|
@ -693,29 +692,29 @@ static void test_mediadet(void)
|
|||
ok(flags == 3, "IMediaDet_get_StreamMediaType: flags are %i\n", flags);
|
||||
|
||||
hr = IMediaDet_put_CurrentStream(pM, 2);
|
||||
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
strm = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &strm);
|
||||
ok(hr == S_OK, "IMediaDet_get_CurrentStream failed: %08x\n", hr);
|
||||
ok(strm == 1, "IMediaDet_get_CurrentStream: strm is %i\n", strm);
|
||||
index = -1;
|
||||
hr = IMediaDet_get_CurrentStream(pM, &index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 1, "Got stream index %ld.\n", index);
|
||||
|
||||
unk = NULL;
|
||||
hr = IMediaDet_get_Filter(pM, &unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!!unk, "Expected a non-NULL filter.\n");
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void**)&filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
hr = IBaseFilter_EnumPins(filter, &enumpins);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IPin_EnumMediaTypes(pin, &type);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IEnumMediaTypes_Next(type, 1, &pmt, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(IsEqualGUID(&pmt->majortype, &MEDIATYPE_Stream), "Got major type %s.\n",
|
||||
debugstr_guid(&pmt->majortype));
|
||||
IEnumMediaTypes_Release(type);
|
||||
|
@ -724,17 +723,17 @@ static void test_mediadet(void)
|
|||
IPin_Release(pin);
|
||||
|
||||
hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
IEnumPins_Release(enumpins);
|
||||
|
||||
hr = IBaseFilter_QueryFilterInfo(filter, &filter_info);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(filter_info.achName, L"Source"), "Got name %s.\n", debugstr_w(filter_info.achName));
|
||||
IFilterGraph_Release(filter_info.pGraph);
|
||||
IBaseFilter_Release(filter);
|
||||
|
||||
hr = IMediaDet_Release(pM);
|
||||
ok(hr == 0, "IMediaDet_Release returned: %x\n", hr);
|
||||
ref = IMediaDet_Release(pM);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_put_filter(void)
|
||||
|
@ -753,29 +752,29 @@ static void test_put_filter(void)
|
|||
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMediaDet, (void **)&detector);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_put_Filter(detector, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_Filter(detector, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamLength(detector, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_StreamLength(detector, &duration);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
testfilter_init(&testfilter);
|
||||
hr = IMediaDet_put_Filter(detector, &testfilter.filter.IUnknown_inner);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_Filter(detector, &unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!!unk, "Expected a non-NULL interface.\n");
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(filter == &testfilter.filter.IBaseFilter_iface, "Expected the same filter.\n");
|
||||
IBaseFilter_Release(filter);
|
||||
IUnknown_Release(unk);
|
||||
|
@ -787,13 +786,13 @@ static void test_put_filter(void)
|
|||
|
||||
testfilter_init(&testfilter2);
|
||||
hr = IMediaDet_put_Filter(detector, &testfilter2.filter.IUnknown_inner);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaDet_get_Filter(detector, &unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!!unk, "Expected a non-NULL interface.\n");
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(filter == &testfilter2.filter.IBaseFilter_iface, "Expected the same filter.\n");
|
||||
IBaseFilter_Release(filter);
|
||||
IUnknown_Release(unk);
|
||||
|
@ -801,70 +800,70 @@ static void test_put_filter(void)
|
|||
ok(testfilter2.filter.graph != graph, "Expected a different graph.\n");
|
||||
|
||||
ref = IFilterGraph_Release(graph);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
ref = IBaseFilter_Release(&testfilter.filter.IBaseFilter_iface);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
hr = IMediaDet_get_OutputStreams(detector, &count);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(count == 1, "Got %d streams.\n", count);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(count == 1, "Got %ld streams.\n", count);
|
||||
|
||||
index = 0xdeadbeef;
|
||||
hr = IMediaDet_get_CurrentStream(detector, &index);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(index == 0, "Got stream %d.\n", index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream %ld.\n", index);
|
||||
|
||||
filename = (BSTR)0xdeadbeef;
|
||||
hr = IMediaDet_get_Filename(detector, &filename);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!filename, "Got filename %s.\n", debugstr_w(filename));
|
||||
|
||||
hr = IMediaDet_get_StreamLength(detector, &duration);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(duration == 4.2, "Got duration %.16e.\n", duration);
|
||||
|
||||
ref = IMediaDet_Release(detector);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
ref = IBaseFilter_Release(&testfilter2.filter.IBaseFilter_iface);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMediaDet, (void **)&detector);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
filename = SysAllocString(test_sound_avi_filename);
|
||||
hr = IMediaDet_put_Filename(detector, filename);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
SysFreeString(filename);
|
||||
|
||||
hr = IMediaDet_get_StreamMediaType(detector, &mt);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
FreeMediaType(&mt);
|
||||
|
||||
hr = IMediaDet_get_Filter(detector, &unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IMediaDet_put_Filter(detector, unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
filename = (BSTR)0xdeadbeef;
|
||||
hr = IMediaDet_get_Filename(detector, &filename);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!filename, "Got filename %s.\n", debugstr_w(filename));
|
||||
|
||||
count = 0xdeadbeef;
|
||||
hr = IMediaDet_get_OutputStreams(detector, &count);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(count == 2, "Got %d streams.\n", count);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(count == 2, "Got %ld streams.\n", count);
|
||||
|
||||
index = 0xdeadbeef;
|
||||
hr = IMediaDet_get_CurrentStream(detector, &index);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(index == 0, "Got stream %d.\n", index);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(index == 0, "Got stream %ld.\n", index);
|
||||
|
||||
ref = IMediaDet_Release(detector);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ms_QueryInterface(IMediaSample *iface, REFIID riid,
|
||||
|
@ -1048,35 +1047,35 @@ static void test_samplegrabber(void)
|
|||
/* Invalid RIID */
|
||||
hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_IClassFactory,
|
||||
(void**)&sg);
|
||||
ok(hr == E_NOINTERFACE, "SampleGrabber create failed: %08x, expected E_NOINTERFACE\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_ISampleGrabber,
|
||||
(void**)&sg);
|
||||
ok(hr == S_OK, "SampleGrabber create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = ISampleGrabber_QueryInterface(sg, &IID_IBaseFilter, (void**)&bf);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IBaseFilter failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = ISampleGrabber_SetCallback(sg, &my_sg_cb, 0);
|
||||
ok(hr == S_OK, "SetCallback failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IBaseFilter_GetState(bf, 100, &fstate);
|
||||
ok(hr == S_OK, "Failed to get filter state: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(fstate == State_Stopped, "Got wrong filter state: %u\n", fstate);
|
||||
|
||||
hr = IBaseFilter_EnumPins(bf, &pins);
|
||||
ok(hr == S_OK, "EnumPins create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(pins, 1, &pin, NULL);
|
||||
ok(hr == S_OK, "Next failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
IEnumPins_Release(pins);
|
||||
|
||||
hr = IPin_QueryInterface(pin, &IID_IMemInputPin, (void**)&inpin);
|
||||
ok(hr == S_OK, "QueryInterface(IMemInputPin) failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMemInputPin_Receive(inpin, &my_sample);
|
||||
ok(hr == S_OK, "Receive failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(samplecb_called == TRUE, "SampleCB should have been called\n");
|
||||
|
||||
IMemInputPin_Release(inpin);
|
||||
|
@ -1095,22 +1094,22 @@ static void test_COM_sg_enumpins(void)
|
|||
|
||||
hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter,
|
||||
(void**)&bf);
|
||||
ok(hr == S_OK, "SampleGrabber create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IBaseFilter_EnumPins(bf, &pins);
|
||||
ok(hr == S_OK, "EnumPins create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* Same refcount for all EnumPins interfaces */
|
||||
refcount = IEnumPins_AddRef(pins);
|
||||
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
|
||||
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
||||
hr = IEnumPins_QueryInterface(pins, &IID_IEnumPins, (void**)&pins2);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IEnumPins failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(pins == pins2, "QueryInterface for self failed (%p != %p)\n", pins, pins2);
|
||||
IEnumPins_Release(pins2);
|
||||
|
||||
hr = IEnumPins_QueryInterface(pins, &IID_IUnknown, (void**)&unk);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
refcount = IUnknown_AddRef(unk);
|
||||
ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
|
||||
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
||||
refcount = IUnknown_Release(unk);
|
||||
|
||||
while (IEnumPins_Release(pins));
|
||||
|
@ -1135,7 +1134,7 @@ START_TEST(mediadet)
|
|||
&IID_IMediaDet, (void **)&detector)))
|
||||
{
|
||||
/* qedit.dll does not exist on 2003. */
|
||||
win_skip("Failed to create media detector object, hr %#x.\n", hr);
|
||||
win_skip("Failed to create media detector object, hr %#lx.\n", hr);
|
||||
return;
|
||||
}
|
||||
IMediaDet_Release(detector);
|
||||
|
@ -1147,9 +1146,9 @@ START_TEST(mediadet)
|
|||
test_COM_sg_enumpins();
|
||||
|
||||
ret = DeleteFileW(test_avi_filename);
|
||||
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
|
||||
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
|
||||
ret = DeleteFileW(test_sound_avi_filename);
|
||||
ok(ret, "Failed to delete file, error %u.\n", GetLastError());
|
||||
ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ static IBaseFilter *create_null_renderer(void)
|
|||
IBaseFilter *filter = NULL;
|
||||
HRESULT hr = CoCreateInstance(&CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IBaseFilter, (void **)&filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
return filter;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ static IFilterGraph2 *create_graph(void)
|
|||
IFilterGraph2 *ret;
|
||||
HRESULT hr;
|
||||
hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&ret);
|
||||
ok(hr == S_OK, "Failed to create FilterGraph: %#x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
|
|||
expected_hr = supported ? S_OK : E_NOINTERFACE;
|
||||
|
||||
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
|
||||
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
|
||||
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IUnknown_Release(unk);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ static void test_interfaces(void)
|
|||
|
||||
IPin_Release(pin);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got unexpected refcount %d.\n", ref);
|
||||
ok(!ref, "Got unexpected refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_enum_pins(void)
|
||||
|
@ -112,85 +112,85 @@ static void test_enum_pins(void)
|
|||
HRESULT hr;
|
||||
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
hr = IBaseFilter_EnumPins(filter, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IBaseFilter_EnumPins(filter, &enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
ref = get_refcount(enum1);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, NULL, NULL);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, pins, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
|
||||
ref = get_refcount(pins[0]);
|
||||
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
|
||||
ref = get_refcount(enum1);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
IPin_Release(pins[0]);
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, pins, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Reset(enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, pins, &count);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(count == 1, "Got count %u.\n", count);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(count == 1, "Got count %lu.\n", count);
|
||||
IPin_Release(pins[0]);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, pins, &count);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(!count, "Got count %u.\n", count);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(!count, "Got count %lu.\n", count);
|
||||
|
||||
hr = IEnumPins_Reset(enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 2, pins, NULL);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 2, pins, &count);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(count == 1, "Got count %u.\n", count);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(count == 1, "Got count %lu.\n", count);
|
||||
IPin_Release(pins[0]);
|
||||
|
||||
hr = IEnumPins_Reset(enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Clone(enum1, &enum2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Skip(enum1, 2);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Skip(enum1, 1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Skip(enum1, 1);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum1, 1, pins, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumPins_Next(enum2, 1, pins, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
IPin_Release(pins[0]);
|
||||
|
||||
IEnumPins_Release(enum2);
|
||||
IEnumPins_Release(enum1);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_find_pin(void)
|
||||
|
@ -202,22 +202,22 @@ static void test_find_pin(void)
|
|||
ULONG ref;
|
||||
|
||||
hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
|
||||
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IBaseFilter_EnumPins(filter, &enum_pins);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IBaseFilter_FindPin(filter, L"In", &pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2);
|
||||
IPin_Release(pin2);
|
||||
IPin_Release(pin);
|
||||
|
||||
IEnumPins_Release(enum_pins);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_pin_info(void)
|
||||
|
@ -231,38 +231,38 @@ static void test_pin_info(void)
|
|||
IPin *pin;
|
||||
|
||||
hr = IBaseFilter_FindPin(filter, L"In", &pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
ref = get_refcount(pin);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
hr = IPin_QueryPinInfo(pin, &info);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
|
||||
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
|
||||
ok(!wcscmp(info.achName, L"In"), "Got name %s.\n", wine_dbgstr_w(info.achName));
|
||||
ref = get_refcount(filter);
|
||||
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
|
||||
ref = get_refcount(pin);
|
||||
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
|
||||
IBaseFilter_Release(info.pFilter);
|
||||
|
||||
hr = IPin_QueryDirection(pin, &dir);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
|
||||
|
||||
hr = IPin_QueryId(pin, &id);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!wcscmp(id, L"In"), "Got id %s.\n", wine_dbgstr_w(id));
|
||||
CoTaskMemFree(id);
|
||||
|
||||
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
|
||||
ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
|
||||
|
||||
IPin_Release(pin);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static const GUID test_iid = {0x33333333};
|
||||
|
@ -310,53 +310,53 @@ static void test_aggregation(void)
|
|||
filter = (IBaseFilter *)0xdeadbeef;
|
||||
hr = CoCreateInstance(&CLSID_NullRenderer, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IBaseFilter, (void **)&filter);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!filter, "Got interface %p.\n", filter);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_NullRenderer, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IUnknown, (void **)&unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
|
||||
ref = get_refcount(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
ref = IUnknown_AddRef(unk);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
|
||||
IUnknown_Release(unk2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
IBaseFilter_Release(filter);
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(!ref, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(!ref, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
}
|
||||
|
||||
static void test_media_types(void)
|
||||
|
@ -371,19 +371,19 @@ static void test_media_types(void)
|
|||
IBaseFilter_FindPin(filter, L"In", &pin);
|
||||
|
||||
hr = IPin_EnumMediaTypes(pin, &enummt);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
IEnumMediaTypes_Release(enummt);
|
||||
|
||||
hr = IPin_QueryAccept(pin, &mt);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
IPin_Release(pin);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_enum_media_types(void)
|
||||
|
@ -398,36 +398,36 @@ static void test_enum_media_types(void)
|
|||
IBaseFilter_FindPin(filter, L"In", &pin);
|
||||
|
||||
hr = IPin_EnumMediaTypes(pin, &enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(!count, "Got count %u.\n", count);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(!count, "Got count %lu.\n", count);
|
||||
|
||||
hr = IEnumMediaTypes_Reset(enum1);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Clone(enum1, &enum2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Skip(enum1, 1);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
IEnumMediaTypes_Release(enum1);
|
||||
IEnumMediaTypes_Release(enum2);
|
||||
IPin_Release(pin);
|
||||
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
struct testfilter
|
||||
|
@ -488,36 +488,36 @@ static void test_allocator(IMemInputPin *input)
|
|||
HRESULT hr;
|
||||
|
||||
hr = IMemInputPin_GetAllocatorRequirements(input, &props);
|
||||
ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMemInputPin_GetAllocator(input, &ret_allocator);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
if (hr == S_OK)
|
||||
{
|
||||
hr = IMemAllocator_GetProperties(ret_allocator, &props);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(!props.cBuffers, "Got %d buffers.\n", props.cBuffers);
|
||||
ok(!props.cbBuffer, "Got size %d.\n", props.cbBuffer);
|
||||
ok(!props.cbAlign, "Got alignment %d.\n", props.cbAlign);
|
||||
ok(!props.cbPrefix, "Got prefix %d.\n", props.cbPrefix);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!props.cBuffers, "Got %ld buffers.\n", props.cBuffers);
|
||||
ok(!props.cbBuffer, "Got size %ld.\n", props.cbBuffer);
|
||||
ok(!props.cbAlign, "Got alignment %ld.\n", props.cbAlign);
|
||||
ok(!props.cbPrefix, "Got prefix %ld.\n", props.cbPrefix);
|
||||
|
||||
hr = IMemInputPin_NotifyAllocator(input, ret_allocator, TRUE);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
IMemAllocator_Release(ret_allocator);
|
||||
}
|
||||
|
||||
hr = IMemInputPin_NotifyAllocator(input, NULL, TRUE);
|
||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IMemAllocator, (void **)&req_allocator);
|
||||
|
||||
hr = IMemInputPin_NotifyAllocator(input, req_allocator, TRUE);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMemInputPin_GetAllocator(input, &ret_allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(ret_allocator == req_allocator, "Allocators didn't match.\n");
|
||||
|
||||
IMemAllocator_Release(req_allocator);
|
||||
|
@ -535,9 +535,9 @@ static DWORD WINAPI frame_thread(void *arg)
|
|||
struct frame_thread_params *params = arg;
|
||||
HRESULT hr;
|
||||
|
||||
if (winetest_debug > 1) trace("%04x: Sending frame.\n", GetCurrentThreadId());
|
||||
if (winetest_debug > 1) trace("%04lx: Sending frame.\n", GetCurrentThreadId());
|
||||
hr = IMemInputPin_Receive(params->sink, params->sample);
|
||||
if (winetest_debug > 1) trace("%04x: Returned %#x.\n", GetCurrentThreadId(), hr);
|
||||
if (winetest_debug > 1) trace("%04lx: Returned %#lx.\n", GetCurrentThreadId(), hr);
|
||||
IMediaSample_Release(params->sample);
|
||||
free(params);
|
||||
return hr;
|
||||
|
@ -554,22 +554,22 @@ static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, uns
|
|||
BYTE *data;
|
||||
|
||||
hr = IMemInputPin_GetAllocator(sink, &allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaSample_GetPointer(sample, &data);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
memset(data, color, 32 * 16 * 2);
|
||||
|
||||
hr = IMediaSample_SetActualDataLength(sample, 32 * 16 * 2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
start_time *= 10000000;
|
||||
end_time = start_time + 10000000;
|
||||
hr = IMediaSample_SetTime(sample, &start_time, &end_time);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
params->sink = sink;
|
||||
params->sample = sample;
|
||||
|
@ -607,132 +607,132 @@ static void test_filter_state(IMemInputPin *input, IFilterGraph2 *graph)
|
|||
|
||||
thread = send_frame(input);
|
||||
hr = join_thread(thread);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* The renderer is not fully paused until it receives a sample. The thread
|
||||
* sending the sample blocks in IMemInputPin_Receive() until the filter is
|
||||
* stopped or run. */
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
|
||||
hr = IMediaControl_GetState(control, 1000, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
|
||||
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* The sink will decommit our allocator for us when stopping, and recommit
|
||||
* it when pausing. */
|
||||
hr = IMemInputPin_GetAllocator(input, &allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
|
||||
todo_wine ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#lx.\n", hr);
|
||||
if (hr == S_OK) IMediaSample_Release(sample);
|
||||
|
||||
hr = IMemAllocator_Commit(allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
thread = send_frame(input);
|
||||
hr = join_thread(thread);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
|
||||
hr = IMediaControl_GetState(control, 1000, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
|
||||
hr = IMediaControl_GetState(control, 1000, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
ok(state == State_Paused, "Got state %u.\n", state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
ok(state == State_Paused, "Got state %lu.\n", state);
|
||||
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
ok(state == State_Paused, "Got state %u.\n", state);
|
||||
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
ok(state == State_Paused, "Got state %lu.\n", state);
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
ok(state == State_Running, "Got state %u.\n", state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
ok(state == State_Running, "Got state %lu.\n", state);
|
||||
|
||||
thread = send_frame(input);
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
IMemAllocator_Release(allocator);
|
||||
IMediaControl_Release(control);
|
||||
|
@ -748,54 +748,54 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
|
|||
IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_BeginFlush(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
hr = join_thread(thread);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_EndFlush(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* We dropped the sample we were holding, so now we need a new one... */
|
||||
|
||||
hr = IMediaControl_GetState(control, 0, &state);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
|
||||
|
||||
thread = send_frame(input);
|
||||
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = join_thread(thread);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_BeginFlush(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(send_frame(input));
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_EndFlush(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = join_thread(send_frame(input));
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
IMediaControl_Release(control);
|
||||
}
|
||||
|
@ -811,14 +811,14 @@ static unsigned int check_event_code(IMediaEvent *eventsrc, DWORD timeout, LONG
|
|||
{
|
||||
if (code == expected_code)
|
||||
{
|
||||
ok(param1 == expected1, "Got param1 %#lx.\n", param1);
|
||||
ok(param2 == expected2, "Got param2 %#lx.\n", param2);
|
||||
ok(param1 == expected1, "Got param1 %#Ix.\n", param1);
|
||||
ok(param2 == expected2, "Got param2 %#Ix.\n", param2);
|
||||
ret++;
|
||||
}
|
||||
IMediaEvent_FreeEventParams(eventsrc, code, param1, param2);
|
||||
timeout = 0;
|
||||
}
|
||||
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_ABORT, "Got hr %#lx.\n", hr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -860,81 +860,81 @@ static void test_connect_pin(void)
|
|||
|
||||
peer = (IPin *)0xdeadbeef;
|
||||
hr = IPin_ConnectedTo(pin, &peer);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
|
||||
ok(!peer, "Got peer %p.\n", peer);
|
||||
|
||||
hr = IPin_ConnectionMediaType(pin, &mt);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
|
||||
ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr);
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_ConnectedTo(pin, &peer);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(peer == &source.source.pin.IPin_iface, "Got peer %p.\n", peer);
|
||||
IPin_Release(peer);
|
||||
|
||||
hr = IPin_ConnectionMediaType(pin, &mt);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr);
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
|
||||
|
||||
test_allocator(input);
|
||||
|
||||
hr = IMemInputPin_GetAllocator(input, &allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(!memcmp(&ret_props, &req_props, sizeof(req_props)), "Properties did not match.\n");
|
||||
hr = IMemAllocator_Commit(allocator);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
IMemAllocator_Release(allocator);
|
||||
|
||||
hr = IMemInputPin_ReceiveCanBlock(input);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
test_filter_state(input, graph);
|
||||
test_flushing(pin, input, graph);
|
||||
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(source.source.pin.peer == pin, "Got peer %p.\n", peer);
|
||||
IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
|
||||
|
||||
peer = (IPin *)0xdeadbeef;
|
||||
hr = IPin_ConnectedTo(pin, &peer);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
|
||||
ok(!peer, "Got peer %p.\n", peer);
|
||||
|
||||
hr = IPin_ConnectionMediaType(pin, &mt);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
|
||||
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
|
||||
|
||||
IMemInputPin_Release(input);
|
||||
IPin_Release(pin);
|
||||
IMediaControl_Release(control);
|
||||
ref = IFilterGraph2_Release(graph);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
ref = IBaseFilter_Release(&source.filter.IBaseFilter_iface);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
static void test_unconnected_eos(void)
|
||||
|
@ -948,49 +948,49 @@ static void test_unconnected_eos(void)
|
|||
ULONG ref;
|
||||
|
||||
hr = IFilterGraph2_AddFilter(graph, filter, L"renderer");
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (void **)&eventsrc);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Pause(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Stop(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
||||
hr = IMediaControl_Run(control);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ret = check_ec_complete(eventsrc, 0);
|
||||
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
|
||||
|
@ -998,9 +998,9 @@ static void test_unconnected_eos(void)
|
|||
IMediaControl_Release(control);
|
||||
IMediaEvent_Release(eventsrc);
|
||||
ref = IFilterGraph2_Release(graph);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
ref = IBaseFilter_Release(filter);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
}
|
||||
|
||||
START_TEST(nullrenderer)
|
||||
|
@ -1014,7 +1014,7 @@ START_TEST(nullrenderer)
|
|||
&IID_IBaseFilter, (void **)&filter)))
|
||||
{
|
||||
/* qedit.dll does not exist on 2003. */
|
||||
win_skip("Failed to create null renderer filter, hr %#x.\n", hr);
|
||||
win_skip("Failed to create null renderer filter, hr %#lx.\n", hr);
|
||||
return;
|
||||
}
|
||||
IBaseFilter_Release(filter);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -74,53 +74,53 @@ static void test_aggregation(void)
|
|||
timeline = (IAMTimeline *)0xdeadbeef;
|
||||
hr = CoCreateInstance(&CLSID_AMTimeline, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IAMTimeline, (void **)&timeline);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!timeline, "Got interface %p.\n", timeline);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_AMTimeline, &test_outer, CLSCTX_INPROC_SERVER,
|
||||
&IID_IUnknown, (void **)&unk);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
|
||||
ref = get_refcount(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
|
||||
ref = IUnknown_AddRef(unk);
|
||||
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
|
||||
IUnknown_Release(unk2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IAMTimeline, (void **)&timeline);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimeline_QueryInterface(timeline, &IID_IUnknown, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IAMTimeline_QueryInterface(timeline, &IID_IAMTimeline, (void **)&timeline2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(timeline2 == (IAMTimeline *)0xdeadbeef, "Got unexpected IAMTimeline %p.\n", timeline2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
hr = IAMTimeline_QueryInterface(timeline, &test_iid, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
|
||||
|
||||
IAMTimeline_Release(timeline);
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(!ref, "Got unexpected refcount %d.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
ok(!ref, "Got unexpected refcount %ld.\n", ref);
|
||||
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
|
||||
}
|
||||
|
||||
static void test_timeline(void)
|
||||
|
@ -133,21 +133,21 @@ static void test_timeline(void)
|
|||
TIMELINE_MAJOR_TYPE type;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, &IID_IAMTimeline, (void **)&timeline);
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "CoCreateInstance failed: %08x\n", hr);
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Got hr %#lx.\n", hr);
|
||||
if (!timeline) return;
|
||||
|
||||
hr = IAMTimeline_QueryInterface(timeline, &IID_IAMTimelineObj, NULL);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimeline_QueryInterface(timeline, &IID_IAMTimelineObj, (void **)&obj);
|
||||
ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!obj, "Expected NULL got %p\n", obj);
|
||||
|
||||
hr = IAMTimeline_CreateEmptyNode(timeline, NULL, 0);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimeline_CreateEmptyNode(timeline, NULL, TIMELINE_MAJOR_TYPE_COMPOSITE);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
for (type = 0; type < 256; type++)
|
||||
{
|
||||
|
@ -161,49 +161,49 @@ static void test_timeline(void)
|
|||
case TIMELINE_MAJOR_TYPE_TRANSITION:
|
||||
case TIMELINE_MAJOR_TYPE_EFFECT:
|
||||
case TIMELINE_MAJOR_TYPE_GROUP:
|
||||
ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
if (obj != &obj_iface) IAMTimelineObj_Release(obj);
|
||||
break;
|
||||
default:
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
ok(obj == &obj_iface, "Expected %p got %p\n", &obj_iface, obj);
|
||||
}
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
hr = IAMTimeline_CreateEmptyNode(timeline, &obj, TIMELINE_MAJOR_TYPE_COMPOSITE);
|
||||
ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
if (!obj) return;
|
||||
|
||||
hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, NULL);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimeline, (void **)&timeline2);
|
||||
ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!timeline2, "Expected NULL got %p\n", timeline2);
|
||||
|
||||
hr = IAMTimelineObj_GetTimelineType(obj, NULL);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimelineObj_GetTimelineType(obj, &type);
|
||||
ok(hr == S_OK, "GetTimelineType failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(type == TIMELINE_MAJOR_TYPE_COMPOSITE, "Expected TIMELINE_MAJOR_TYPE_COMPOSITE got %d\n", type);
|
||||
|
||||
for (type = 0; type < 256; type++)
|
||||
{
|
||||
hr = IAMTimelineObj_SetTimelineType(obj, type);
|
||||
if (type == TIMELINE_MAJOR_TYPE_COMPOSITE)
|
||||
ok(hr == S_OK, "SetTimelineType failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
else
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||
}
|
||||
|
||||
hr = IAMTimelineObj_GetTimelineNoRef(obj, NULL);
|
||||
ok(hr == E_POINTER, "Expected E_POINTER got %08x\n", hr);
|
||||
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
|
||||
|
||||
timeline2 = (IAMTimeline *)0xdeadbeef;
|
||||
hr = IAMTimelineObj_GetTimelineNoRef(obj, &timeline2);
|
||||
ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE got %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
|
||||
ok(!timeline2, "Expected NULL got %p\n", timeline2);
|
||||
|
||||
IAMTimelineObj_Release(obj);
|
||||
|
@ -217,22 +217,22 @@ static void test_timelineobj_interfaces(void)
|
|||
IAMTimelineObj *obj;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, &IID_IAMTimeline, (void **)&timeline);
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "CoCreateInstance failed: %08x\n", hr);
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Got hr %#lx.\n", hr);
|
||||
if (!timeline)
|
||||
return;
|
||||
|
||||
hr = IAMTimeline_CreateEmptyNode(timeline, &obj, TIMELINE_MAJOR_TYPE_GROUP);
|
||||
ok(hr == S_OK, "CreateEmptyNode failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
if(hr == S_OK)
|
||||
{
|
||||
IAMTimelineGroup *group;
|
||||
IAMTimelineObj *obj2;
|
||||
|
||||
hr = IAMTimelineObj_QueryInterface(obj, &IID_IAMTimelineGroup, (void **)&group);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IAMTimelineGroup_QueryInterface(group, &IID_IAMTimelineObj, (void **)&obj2);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
ok(obj == obj2, "Different pointers\n");
|
||||
IAMTimelineObj_Release(obj2);
|
||||
|
||||
|
@ -255,7 +255,7 @@ START_TEST(timeline)
|
|||
&IID_IAMTimeline, (void **)&timeline)))
|
||||
{
|
||||
/* qedit.dll does not exist on 2003. */
|
||||
win_skip("Failed to create timeline object, hr %#x.\n", hr);
|
||||
win_skip("Failed to create timeline object, hr %#lx.\n", hr);
|
||||
return;
|
||||
}
|
||||
IAMTimeline_Release(timeline);
|
||||
|
|
Loading…
Reference in New Issue