49 return IUnknown_QueryInterface(
This->inner_unk,
riid,
ppv);
80 static const WCHAR prefix[] = {
'D',
'E',
'S',0};
81 static const WCHAR avi[] = {
'a',
'v',
'i',0};
148 ok(
hr ==
S_OK,
"CoCreateInstance failed: %08x\n",
hr);
150 hr = IUnknown_QueryInterface(unk_obj.
inner_unk, &IID_IMediaDet, (
void**)&pM);
151 ok(
hr ==
S_OK,
"QueryInterface for IID_IMediaDet failed: %08x\n",
hr);
152 refcount = IMediaDet_AddRef(pM);
153 ok(refcount == unk_obj.
ref,
"MediaDet just pretends to support COM aggregation\n");
154 refcount = IMediaDet_Release(pM);
155 ok(refcount == unk_obj.
ref,
"MediaDet just pretends to support COM aggregation\n");
156 refcount = IMediaDet_Release(pM);
157 ok(refcount == 19,
"Refcount should be back at 19 but is %u\n", refcount);
163 &IID_IMediaDet, (
LPVOID*)&pM);
164 ok(
hr ==
S_OK,
"CoCreateInstance failed with %x\n",
hr);
165 ok(pM !=
NULL,
"pM is NULL\n");
170 ok(
hr ==
S_OK,
"IMediaDet_get_Filename failed: %08x\n",
hr);
176 ok(
hr ==
S_OK,
"IMediaDet_get_Filename failed: %08x\n",
hr);
180 hr = IMediaDet_get_OutputStreams(pM, &nstrms);
182 ok(nstrms == -1,
"IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
186 hr = IMediaDet_get_CurrentStream(pM, &strm);
187 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
188 ok(strm == 0,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
190 hr = IMediaDet_get_CurrentStream(pM,
NULL);
194 hr = IMediaDet_put_CurrentStream(pM, 0);
197 hr = IMediaDet_put_CurrentStream(pM, -1);
200 hr = IMediaDet_get_StreamMediaType(pM, &mt);
203 hr = IMediaDet_get_StreamMediaType(pM,
NULL);
204 ok(
hr ==
E_POINTER,
"IMediaDet_get_StreamMediaType failed: %08x\n",
hr);
208 ok(
hr ==
S_OK,
"IMediaDet_put_Filename failed: %08x\n",
hr);
213 hr = IMediaDet_get_CurrentStream(pM, &strm);
214 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
215 ok(strm == 0,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
218 hr = IMediaDet_get_StreamMediaType(pM, &mt);
219 ok(
hr ==
S_OK,
"IMediaDet_get_StreamMediaType failed: %08x\n",
hr);
223 hr = IMediaDet_put_CurrentStream(pM, 1);
226 hr = IMediaDet_get_OutputStreams(pM, &nstrms);
227 ok(
hr ==
S_OK,
"IMediaDet_get_OutputStreams failed: %08x\n",
hr);
228 ok(nstrms == 1,
"IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
232 ok(
hr ==
S_OK,
"IMediaDet_get_Filename failed: %08x\n",
hr);
234 "IMediaDet_get_Filename\n");
237 hr = IMediaDet_get_Filename(pM,
NULL);
241 hr = IMediaDet_get_CurrentStream(pM, &strm);
242 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
243 ok(strm == 0,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
245 hr = IMediaDet_get_CurrentStream(pM,
NULL);
248 hr = IMediaDet_put_CurrentStream(pM, -1);
251 hr = IMediaDet_put_CurrentStream(pM, 1);
256 hr = IMediaDet_get_CurrentStream(pM, &strm);
257 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
258 ok(strm == 0,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
260 hr = IMediaDet_put_CurrentStream(pM, 0);
261 ok(
hr ==
S_OK,
"IMediaDet_put_CurrentStream failed: %08x\n",
hr);
264 hr = IMediaDet_get_CurrentStream(pM, &strm);
265 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
266 ok(strm == 0,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
269 hr = IMediaDet_get_StreamMediaType(pM, &mt);
270 ok(
hr ==
S_OK,
"IMediaDet_get_StreamMediaType failed: %08x\n",
hr);
272 "IMediaDet_get_StreamMediaType\n");
275 hr = IMediaDet_get_FrameRate(pM,
NULL);
278 hr = IMediaDet_get_FrameRate(pM, &fps);
279 ok(
hr ==
S_OK,
"IMediaDet_get_FrameRate failed: %08x\n",
hr);
280 ok(fps == 10.0,
"IMediaDet_get_FrameRate: fps is %f\n", fps);
282 hr = IMediaDet_Release(pM);
283 ok(
hr == 0,
"IMediaDet_Release returned: %x\n",
hr);
289 &IID_IMediaDet, (
LPVOID*)&pM);
290 ok(
hr ==
S_OK,
"CoCreateInstance failed with %x\n",
hr);
291 ok(pM !=
NULL,
"pM is NULL\n");
295 ok(
hr ==
S_OK,
"IMediaDet_put_Filename failed: %08x\n",
hr);
298 hr = IMediaDet_get_OutputStreams(pM, &nstrms);
299 ok(
hr ==
S_OK,
"IMediaDet_get_OutputStreams failed: %08x\n",
hr);
300 ok(nstrms == 2,
"IMediaDet_get_OutputStreams: nstrms is %i\n", nstrms);
304 ok(
hr ==
S_OK,
"IMediaDet_get_Filename failed: %08x\n",
hr);
306 "IMediaDet_get_Filename\n");
313 for (
i = 0;
i < 2; ++
i)
315 hr = IMediaDet_put_CurrentStream(pM,
i);
316 ok(
hr ==
S_OK,
"IMediaDet_put_CurrentStream failed: %08x\n",
hr);
319 hr = IMediaDet_get_CurrentStream(pM, &strm);
320 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
321 ok(strm ==
i,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
324 hr = IMediaDet_get_StreamMediaType(pM, &mt);
325 ok(
hr ==
S_OK,
"IMediaDet_get_StreamMediaType failed: %08x\n",
hr);
334 hr = IMediaDet_get_FrameRate(pM, &fps);
340 ok(
flags == 3,
"IMediaDet_get_StreamMediaType: flags are %i\n",
flags);
342 hr = IMediaDet_put_CurrentStream(pM, 2);
346 hr = IMediaDet_get_CurrentStream(pM, &strm);
347 ok(
hr ==
S_OK,
"IMediaDet_get_CurrentStream failed: %08x\n",
hr);
348 ok(strm == 1,
"IMediaDet_get_CurrentStream: strm is %i\n", strm);
350 hr = IMediaDet_Release(pM);
351 ok(
hr == 0,
"IMediaDet_Release returned: %x\n",
hr);
510 ok(0,
"BufferCB should not have been called\n");
542 ok(
hr ==
S_OK,
"CoCreateInstance failed: %08x\n",
hr);
544 hr = IUnknown_QueryInterface(unk_obj.
inner_unk, &IID_ISampleGrabber, (
void**)&sg);
545 ok(
hr ==
S_OK,
"QueryInterface for IID_ISampleGrabber failed: %08x\n",
hr);
546 refcount = ISampleGrabber_AddRef(sg);
547 ok(refcount == unk_obj.
ref,
"SampleGrabber just pretends to support COM aggregation\n");
548 refcount = ISampleGrabber_Release(sg);
549 ok(refcount == unk_obj.
ref,
"SampleGrabber just pretends to support COM aggregation\n");
550 refcount = ISampleGrabber_Release(sg);
551 ok(refcount == 19,
"Refcount should be back at 19 but is %u\n", refcount);
557 ok(
hr ==
E_NOINTERFACE,
"SampleGrabber create failed: %08x, expected E_NOINTERFACE\n",
hr);
562 ok(
hr ==
S_OK,
"SampleGrabber create failed: %08x, expected S_OK\n",
hr);
563 refcount = ISampleGrabber_AddRef(sg);
564 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
567 ok(
hr ==
S_OK,
"QueryInterface for IID_IBaseFilter failed: %08x\n",
hr);
568 refcount = IBaseFilter_AddRef(bf);
569 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
570 refcount = IBaseFilter_Release(bf);
572 hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaFilter, (
void**)&mf);
573 ok(
hr ==
S_OK,
"QueryInterface for IID_IMediaFilter failed: %08x\n",
hr);
574 refcount = IMediaFilter_AddRef(mf);
575 ok(refcount == 5,
"refcount == %u, expected 5\n", refcount);
576 refcount = IMediaFilter_Release(mf);
578 hr = ISampleGrabber_QueryInterface(sg, &
IID_IPersist, (
void**)&persist);
579 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersist failed: %08x\n",
hr);
580 refcount = IPersist_AddRef(persist);
581 ok(refcount == 6,
"refcount == %u, expected 6\n", refcount);
582 refcount = IPersist_Release(persist);
584 hr = ISampleGrabber_QueryInterface(sg, &
IID_IUnknown, (
void**)&unk);
585 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
586 refcount = IUnknown_AddRef(unk);
587 ok(refcount == 7,
"refcount == %u, expected 7\n", refcount);
588 refcount = IUnknown_Release(unk);
590 hr = ISampleGrabber_SetCallback(sg, &
my_sg_cb, 0);
591 ok(
hr ==
S_OK,
"SetCallback failed: %08x\n",
hr);
593 hr = IBaseFilter_GetState(bf, 100, &
fstate);
594 ok(
hr ==
S_OK,
"Failed to get filter state: %08x\n",
hr);
595 ok(
fstate == State_Stopped,
"Got wrong filter state: %u\n",
fstate);
597 hr = IBaseFilter_EnumPins(bf, &pins);
598 ok(
hr ==
S_OK,
"EnumPins create failed: %08x, expected S_OK\n",
hr);
600 hr = IEnumPins_Next(pins, 1, &
pin,
NULL);
603 IEnumPins_Release(pins);
605 hr = IPin_QueryInterface(
pin, &IID_IMemInputPin, (
void**)&inpin);
606 ok(
hr ==
S_OK,
"QueryInterface(IMemInputPin) failed: %08x\n",
hr);
612 IMemInputPin_Release(inpin);
616 hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaPosition, (
void**)&unk);
618 hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaSeeking, (
void**)&unk);
620 hr = ISampleGrabber_QueryInterface(sg, &IID_IMemInputPin, (
void**)&unk);
622 hr = ISampleGrabber_QueryInterface(sg, &IID_IQualityControl, (
void**)&unk);
624 hr = ISampleGrabber_QueryInterface(sg, &IID_ISeekingPassThru, (
void**)&unk);
627 while (ISampleGrabber_Release(sg));
640 ok(
hr ==
S_OK,
"SampleGrabber create failed: %08x, expected S_OK\n",
hr);
641 hr = IBaseFilter_EnumPins(bf, &pins);
642 ok(
hr ==
S_OK,
"EnumPins create failed: %08x, expected S_OK\n",
hr);
645 refcount = IEnumPins_AddRef(pins);
646 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
647 hr = IEnumPins_QueryInterface(pins, &IID_IEnumPins, (
void**)&pins2);
648 ok(
hr ==
S_OK,
"QueryInterface for IID_IEnumPins failed: %08x\n",
hr);
649 ok(pins == pins2,
"QueryInterface for self failed (%p != %p)\n", pins, pins2);
650 IEnumPins_Release(pins2);
653 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
654 refcount = IUnknown_AddRef(unk);
655 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
656 refcount = IUnknown_Release(unk);
658 while (IEnumPins_Release(pins));
659 IBaseFilter_Release(bf);
666 skip(
"Couldn't initialize tests!\n");
#define InterlockedIncrement
#define InterlockedDecrement
const GUID IID_IClassFactory
const GUID IID_IBaseFilter
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define IsEqualGUID(rguid1, rguid2)
#define TEST_SOUND_AVI_RES
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_INVALIDMEDIATYPE
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define MAKEINTRESOURCEW(i)