37 return IUnknown_Release(
unknown);
84 &IID_IMediaDet, (
void **)&detector);
86 ok(!detector,
"Got interface %p.\n", detector);
92 ok(unk != &
test_outer,
"Returned IUnknown should not be outer IUnknown.\n");
94 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
96 ref = IUnknown_AddRef(unk);
97 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
100 ref = IUnknown_Release(unk);
101 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
106 ok(unk2 == unk,
"Got unexpected IUnknown %p.\n", unk2);
107 IUnknown_Release(unk2);
109 hr = IUnknown_QueryInterface(unk, &IID_IMediaDet, (
void **)&detector);
112 hr = IMediaDet_QueryInterface(detector, &
IID_IUnknown, (
void **)&unk2);
114 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
116 hr = IMediaDet_QueryInterface(detector, &IID_IMediaDet, (
void **)&detector2);
118 ok(detector2 == (
IMediaDet *)0xdeadbeef,
"Got unexpected IMediaDet %p.\n", detector2);
120 hr = IUnknown_QueryInterface(unk, &
test_iid, (
void **)&unk2);
122 ok(!unk2,
"Got unexpected IUnknown %p.\n", unk2);
124 hr = IMediaDet_QueryInterface(detector, &
test_iid, (
void **)&unk2);
126 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
128 IMediaDet_Release(detector);
129 ref = IUnknown_Release(unk);
130 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
177 .bmiHeader.biWidth = 640,
178 .bmiHeader.biHeight = 480,
179 .bmiHeader.biPlanes = 1,
180 .bmiHeader.biBitCount = 24,
181 .bmiHeader.biCompression =
BI_RGB,
182 .bmiHeader.biSizeImage = 640 * 480 * 3
188 mt->majortype = MEDIATYPE_Video;
189 mt->subtype = MEDIASUBTYPE_RGB24;
190 mt->bFixedSizeSamples =
TRUE;
191 mt->bTemporalCompression =
FALSE;
193 mt->formattype = FORMAT_VideoInfo;
195 mt->cbFormat =
sizeof(source_format);
197 memcpy(
mt->pbFormat, &source_format,
mt->cbFormat);
236 return IPin_QueryInterface(&
filter->source.pin.IPin_iface, iid,
out);
242 return IPin_AddRef(&
filter->source.pin.IPin_iface);
248 return IPin_Release(&
filter->source.pin.IPin_iface);
253 ok(0,
"Unexpected call.\n");
259 ok(0,
"Unexpected call.\n");
265 ok(0,
"Unexpected call.\n");
271 ok(0,
"Unexpected call.\n");
277 ok(0,
"Unexpected call.\n");
283 ok(0,
"Unexpected call.\n");
289 ok(0,
"Unexpected call.\n");
297 *duration = 42000000;
303 ok(0,
"Unexpected call.\n");
309 ok(0,
"Unexpected call.\n");
316 ok(0,
"Unexpected call.\n");
323 ok(0,
"Unexpected call.\n");
329 ok(0,
"Unexpected call.\n");
335 ok(0,
"Unexpected call.\n");
341 ok(0,
"Unexpected call.\n");
347 ok(0,
"Unexpected call.\n");
353 ok(0,
"Unexpected call.\n");
449 FILTER_INFO filter_info;
467 &IID_IMediaDet, (
LPVOID*)&pM);
469 ok(pM !=
NULL,
"pM is NULL\n");
484 hr = IMediaDet_get_OutputStreams(pM, &
count);
490 hr = IMediaDet_get_CurrentStream(pM, &
index);
494 hr = IMediaDet_get_CurrentStream(pM,
NULL);
498 hr = IMediaDet_put_CurrentStream(pM, 0);
501 hr = IMediaDet_put_CurrentStream(pM, -1);
504 hr = IMediaDet_get_StreamMediaType(pM, &
mt);
507 hr = IMediaDet_get_StreamMediaType(pM,
NULL);
510 hr = IMediaDet_get_StreamType(pM, &
guid);
513 hr = IMediaDet_get_StreamType(pM,
NULL);
516 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
519 hr = IMediaDet_get_StreamTypeB(pM,
NULL);
522 hr = IMediaDet_get_Filter(pM,
NULL);
526 hr = IMediaDet_get_Filter(pM, &unk);
528 ok(!unk,
"Got filter %p.\n", unk);
537 skip(
"Failed to open file, hr %#lx.\n",
hr);
538 IMediaDet_Release(pM);
545 hr = IMediaDet_get_CurrentStream(pM, &
index);
550 hr = IMediaDet_get_StreamMediaType(pM, &
mt);
554 hr = IMediaDet_get_StreamType(pM, &
guid);
558 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
560 ok(!
wcscmp(bstr,
L"{73646976-0000-0010-8000-00AA00389B71}"),
565 hr = IMediaDet_put_CurrentStream(pM, 1);
568 hr = IMediaDet_get_OutputStreams(pM, &
count);
579 hr = IMediaDet_get_Filename(pM,
NULL);
583 hr = IMediaDet_get_CurrentStream(pM, &
index);
587 hr = IMediaDet_get_CurrentStream(pM,
NULL);
590 hr = IMediaDet_put_CurrentStream(pM, -1);
593 hr = IMediaDet_put_CurrentStream(pM, 1);
598 hr = IMediaDet_get_CurrentStream(pM, &
index);
602 hr = IMediaDet_put_CurrentStream(pM, 0);
606 hr = IMediaDet_get_CurrentStream(pM, &
index);
611 hr = IMediaDet_get_StreamMediaType(pM, &
mt);
614 "IMediaDet_get_StreamMediaType\n");
617 hr = IMediaDet_get_StreamType(pM, &
guid);
621 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
623 ok(!
wcscmp(bstr,
L"{73646976-0000-0010-8000-00AA00389B71}"),
627 hr = IMediaDet_get_FrameRate(pM,
NULL);
630 hr = IMediaDet_get_FrameRate(pM, &fps);
632 ok(fps == 10.0,
"IMediaDet_get_FrameRate: fps is %f\n", fps);
634 ref = IMediaDet_Release(pM);
635 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
639 &IID_IMediaDet, (
LPVOID*)&pM);
641 ok(pM !=
NULL,
"pM is NULL\n");
650 skip(
"Failed to open file, hr %#lx.\n",
hr);
651 IMediaDet_Release(pM);
656 hr = IMediaDet_get_OutputStreams(pM, &
count);
671 for (
i = 0;
i < 2; ++
i)
673 hr = IMediaDet_put_CurrentStream(pM,
i);
677 hr = IMediaDet_get_CurrentStream(pM, &
index);
682 hr = IMediaDet_get_StreamMediaType(pM, &
mt);
692 hr = IMediaDet_get_StreamType(pM, &
guid);
696 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
698 ok(!
wcscmp(bstr,
L"{73647561-0000-0010-8000-00AA00389B71}"),
702 hr = IMediaDet_get_FrameRate(pM, &fps);
708 ok(
flags == 3,
"IMediaDet_get_StreamMediaType: flags are %i\n",
flags);
710 hr = IMediaDet_put_CurrentStream(pM, 2);
714 hr = IMediaDet_get_CurrentStream(pM, &
index);
719 hr = IMediaDet_get_Filter(pM, &unk);
721 ok(!!unk,
"Expected a non-NULL filter.\n");
724 IUnknown_Release(unk);
726 hr = IBaseFilter_EnumPins(
filter, &enumpins);
728 hr = IEnumPins_Next(enumpins, 1, &pin,
NULL);
730 hr = IPin_EnumMediaTypes(pin, &
type);
732 hr = IEnumMediaTypes_Next(
type, 1, &pmt,
NULL);
734 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Stream),
"Got major type %s.\n",
736 IEnumMediaTypes_Release(
type);
741 hr = IEnumPins_Next(enumpins, 1, &pin,
NULL);
743 IEnumPins_Release(enumpins);
745 hr = IBaseFilter_QueryFilterInfo(
filter, &filter_info);
747 ok(!
wcscmp(filter_info.achName,
L"Source"),
"Got name %s.\n",
debugstr_w(filter_info.achName));
748 IFilterGraph_Release(filter_info.pGraph);
749 IBaseFilter_Release(
filter);
751 ref = IMediaDet_Release(pM);
752 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
770 &IID_IMediaDet, (
void **)&detector);
773 hr = IMediaDet_put_Filter(detector,
NULL);
776 hr = IMediaDet_get_Filter(detector,
NULL);
779 hr = IMediaDet_get_StreamLength(detector,
NULL);
782 hr = IMediaDet_get_StreamLength(detector, &duration);
789 hr = IMediaDet_get_Filter(detector, &unk);
791 ok(!!unk,
"Expected a non-NULL interface.\n");
795 IBaseFilter_Release(
filter);
796 IUnknown_Release(unk);
801 IFilterGraph_AddRef(
graph);
804 hr = IMediaDet_put_Filter(detector, &testfilter2.
filter.IUnknown_inner);
807 hr = IMediaDet_get_Filter(detector, &unk);
809 ok(!!unk,
"Expected a non-NULL interface.\n");
812 ok(
filter == &testfilter2.
filter.IBaseFilter_iface,
"Expected the same filter.\n");
813 IBaseFilter_Release(
filter);
814 IUnknown_Release(unk);
816 ok(testfilter2.
filter.graph !=
graph,
"Expected a different graph.\n");
819 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
821 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
824 hr = IMediaDet_get_OutputStreams(detector, &
count);
829 hr = IMediaDet_get_CurrentStream(detector, &
index);
834 hr = IMediaDet_get_Filename(detector, &
filename);
838 hr = IMediaDet_get_StreamLength(detector, &duration);
840 ok(duration == 4.2,
"Got duration %.16e.\n", duration);
842 ref = IMediaDet_Release(detector);
843 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
844 ref = IBaseFilter_Release(&testfilter2.
filter.IBaseFilter_iface);
845 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
848 &IID_IMediaDet, (
void **)&detector);
852 hr = IMediaDet_put_Filename(detector,
filename);
858 skip(
"Failed to open file, hr %#lx.\n",
hr);
859 IMediaDet_Release(detector);
864 hr = IMediaDet_get_StreamMediaType(detector, &
mt);
868 hr = IMediaDet_get_Filter(detector, &unk);
870 hr = IMediaDet_put_Filter(detector, unk);
872 IUnknown_Release(unk);
875 hr = IMediaDet_get_Filename(detector, &
filename);
880 hr = IMediaDet_get_OutputStreams(detector, &
count);
885 hr = IMediaDet_get_CurrentStream(detector, &
index);
889 ref = IMediaDet_Release(detector);
890 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1052 ok(pSample == &
my_sample.sample,
"Got wrong IMediaSample: %p, expected %p\n", pSample, &
my_sample);
1054 IMediaSample_AddRef(pSample);
1061 ok(0,
"BufferCB should not have been called\n");
1098 hr = ISampleGrabber_SetCallback(sg, &
my_sg_cb, 0);
1101 hr = IBaseFilter_GetState(bf, 100, &
fstate);
1103 ok(
fstate == State_Stopped,
"Got wrong filter state: %u\n",
fstate);
1105 hr = IBaseFilter_EnumPins(bf, &pins);
1108 hr = IEnumPins_Next(pins, 1, &pin,
NULL);
1111 IEnumPins_Release(pins);
1113 hr = IPin_QueryInterface(pin, &IID_IMemInputPin, (
void**)&inpin);
1116 hr = IMemInputPin_Receive(inpin, &
my_sample.sample);
1123 IMemInputPin_Release(inpin);
1126 while (ISampleGrabber_Release(sg));
1140 hr = IBaseFilter_EnumPins(bf, &pins);
1146 hr = IEnumPins_QueryInterface(pins, &IID_IEnumPins, (
void**)&pins2);
1148 ok(pins == pins2,
"QueryInterface for self failed (%p != %p)\n", pins, pins2);
1149 IEnumPins_Release(pins2);
1151 hr = IEnumPins_QueryInterface(pins, &
IID_IUnknown, (
void**)&unk);
1157 while (IEnumPins_Release(pins));
1158 IBaseFilter_Release(bf);
1169 skip(
"Couldn't initialize tests!\n");
1176 &IID_IMediaDet, (
void **)&detector)))
1179 win_skip(
"Failed to create media detector object, hr %#lx.\n",
hr);
1182 IMediaDet_Release(detector);
#define InterlockedIncrement
#define InterlockedDecrement
const GUID IID_IClassFactory
const GUID IID_IBaseFilter
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
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)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
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
#define memcpy(s1, s2, n)
struct task_struct * current
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define IsEqualGUID(rguid1, rguid2)
#define MAKEINTRESOURCEW(i)
#define TEST_SOUND_AVI_RES
static __inline const char * wine_dbgstr_guid(const GUID *id)
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_filter_cleanup(struct strmbase_filter *filter)
void strmbase_source_cleanup(struct strmbase_source *pin)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
IMediaSeeking IMediaSeeking_iface
IMediaSeeking IMediaSeeking_iface
struct strmbase_filter filter
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_INVALIDMEDIATYPE
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)