49 ok(
hr == 0,
"IUnknown_Release failed with %d\n", (
INT)
hr);
62#define TEST_INTERFACE(riid,expected) do { \
63 hr = IUnknown_QueryInterface(pAviSplitter, &riid, (void**)&iface); \
64 ok( hr == expected, #riid" should %s got %08X\n", expected==S_OK ? "exist" : "not be present", GetLastError() ); \
66 ref = IUnknown_Release(iface); \
67 ok(ref == 1, "Reference is %u, expected 1\n", ref); \
85 IPin_QueryInterface(
pin, &IID_IMemInputPin, (
void **)&mpin);
87 ok(mpin ==
NULL,
"IMemInputPin found!\n");
89 IMemInputPin_Release(mpin);
105 skip(
"No IBaseFilter\n");
112 hr= IBaseFilter_EnumPins(
base, &pin_enum);
113 ok(
hr ==
S_OK,
"hr = %08x and not S_OK\n",
hr);
118 hr = IEnumPins_Next(pin_enum, 2, pins,
NULL);
121 pins[0] = (
void *)0xdead;
122 pins[1] = (
void *)0xdeed;
124 hr = IEnumPins_Next(pin_enum, 2, pins, &
ref);
126 ok(pins[0] != (
void *)0xdead && pins[0] !=
NULL,
127 "pins[0] = %p\n", pins[0]);
128 if (pins[0] != (
void *)0xdead && pins[0] !=
NULL)
131 IPin_Release(pins[0]);
134 ok(pins[1] == (
void *)0xdeed,
"pins[1] = %p\n", pins[1]);
136 ref = IEnumPins_Release(pin_enum);
137 ok(
ref == 0,
"ref is %u and not 0!\n",
ref);
139 IBaseFilter_Release(
base);
144 static const WCHAR prefix[] = {
'w',
'i',
'n',0};
156 "\x52\x49\x46\x46xxxx\x41\x56\x49\x20",
162 "\x00\x00\x01\xBA\x21\x00\x01\x00\x01\x80\x00\x01\x00\x00\x01\xBB",
164 &MEDIASUBTYPE_MPEG1System,
170 &MEDIASUBTYPE_MPEG1Video,
176 &MEDIASUBTYPE_MPEG1Audio,
180 "\x00\x00\x01\xBA\x40",
182 &MEDIASUBTYPE_MPEG2_PROGRAM,
186 "\x52\x49\x46\x46xxxx\x57\x41\x56\x45",
222 ok(written ==
tests[
i].
size,
"could not write test data\n");
227 ok(
hr ==
S_OK,
"CoCreateInstance failed with %08x\n",
hr);
228 hr = IBaseFilter_QueryInterface(
base, &IID_IFileSourceFilter, (
void **)&filesource);
229 ok(
hr ==
S_OK,
"IBaseFilter_QueryInterface failed with %08x\n",
hr);
231 olepath = (
void *)0xdeadbeef;
232 hr = IFileSourceFilter_GetCurFile(filesource, &olepath,
NULL);
233 ok(
hr ==
S_OK,
"expected S_OK, got %08x\n",
hr);
234 ok(olepath ==
NULL,
"expected NULL, got %p\n", olepath);
236 hr = IFileSourceFilter_Load(filesource,
NULL,
NULL);
239 hr = IFileSourceFilter_Load(filesource,
path,
NULL);
240 ok(
hr ==
S_OK,
"IFileSourceFilter_Load failed with %08x\n",
hr);
242 hr = IFileSourceFilter_GetCurFile(filesource,
NULL, &mt);
246 hr = IFileSourceFilter_GetCurFile(filesource, &olepath,
NULL);
247 ok(
hr ==
S_OK,
"expected S_OK, got %08x\n",
hr);
251 memset(&mt, 0x11,
sizeof(mt));
252 hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &mt);
253 ok(
hr ==
S_OK,
"expected S_OK, got %08x\n",
hr);
265 IFileSourceFilter_Release(filesource);
266 IBaseFilter_Release(
base);
291 ok(
res != 0,
"couldn't find resource\n" );
330 skip(
"%s is not an avi riff file, not doing the avi splitter test\n",
336 hr = IUnknown_QueryInterface(
pAviSplitter, &IID_IFileSourceFilter,
339 "Avi splitter returns unexpected error: %08x\n",
hr);
341 IFileSourceFilter_Release(pfile);
346 ok(
hr ==
S_OK,
"Could not create asynchronous reader: %08x\n",
hr);
350 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter,
352 ok(
hr ==
S_OK,
"Could not get IFileSourceFilter: %08x\n",
hr);
358 ok(
hr ==
S_OK,
"Could not get base filter: %08x\n",
hr);
365 trace(
"Could not load file: %08x\n",
hr);
369 hr = IBaseFilter_EnumPins(preader, &enumpins);
374 hr = IEnumPins_Next(enumpins, 1, &filepin,
NULL);
379 IEnumPins_Release(enumpins);
382 hr = IBaseFilter_EnumPins(pavi, &enumpins);
387 hr = IEnumPins_Next(enumpins, 1, &avipin,
NULL);
392 hr = IPin_Connect(filepin, avipin,
NULL);
393 ok(
hr ==
S_OK,
"Could not connect: %08x\n",
hr);
397 IPin_Release(avipin);
400 IEnumPins_Reset(enumpins);
406 while (IEnumPins_Next(enumpins, 1, &avipin,
NULL) ==
S_OK)
408 IPin_QueryDirection(avipin, &
dir);
420 win_skip(
"Null renderer not registered, skipping\n");
423 ok(
hr ==
S_OK,
"Could not create null renderer: %08x\n",
hr);
425 hr = IBaseFilter_EnumPins(pnull, &nullenum);
426 ok(
hr ==
S_OK,
"Failed to enum pins, hr %#x.\n",
hr);
427 hr = IEnumPins_Next(nullenum, 1, &nullpin,
NULL);
428 ok(
hr ==
S_OK,
"Failed to get next pin, hr %#x.\n",
hr);
429 IEnumPins_Release(nullenum);
430 IPin_QueryDirection(nullpin, &
dir);
432 hr = IPin_Connect(avipin, nullpin,
NULL);
433 ok(
hr ==
S_OK,
"Failed to connect output pin: %08x\n",
hr);
434 IPin_Release(nullpin);
437 IBaseFilter_Release(pnull);
440 IBaseFilter_Run(pnull, 0);
443 IPin_Release(avipin);
448 IPin_Release(avipin);
468 IBaseFilter_Run(preader, 0);
469 IBaseFilter_Run(pavi, 0);
472 IBaseFilter_Pause(pavi);
473 IBaseFilter_Pause(preader);
474 IBaseFilter_Stop(pavi);
475 IBaseFilter_Stop(preader);
480 IEnumPins_Reset(enumpins);
481 while (IEnumPins_Next(enumpins, 1, &avipin,
NULL) ==
S_OK)
485 IPin_QueryDirection(avipin, &
dir);
486 IPin_ConnectedTo(avipin, &to);
495 hr = IPin_QueryPinInfo(to, &
info);
496 ok(
hr ==
S_OK,
"Failed to query pin info, hr %#x.\n",
hr);
501 IBaseFilter_Stop(
info.pFilter);
503 IPin_Disconnect(avipin);
504 IBaseFilter_Release(
info.pFilter);
505 IBaseFilter_Release(
info.pFilter);
510 IPin_Disconnect(avipin);
513 IPin_Release(avipin);
519 skip(
"Prerequisites not matched, skipping remainder of test\n");
521 IEnumPins_Release(enumpins);
524 IPin_Release(avipin);
529 IPin_ConnectedTo(filepin, &to);
532 IPin_Disconnect(filepin);
535 IPin_Release(filepin);
539 IBaseFilter_Release(preader);
541 IBaseFilter_Release(pavi);
543 IFileSourceFilter_Release(pfile);
554 skip(
"Could not create avisplitter\n");
int strcmp(const char *String1, const char *String2)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define TEST_INTERFACE(riid, expected)
static WCHAR * load_resource(const WCHAR *name)
static const WCHAR avifile[]
static void test_pin(IPin *pin)
static IUnknown * pAviSplitter
static void test_query_interface(void)
static void test_filter_graph(void)
static void release_avisplitter(void)
static BOOL create_avisplitter(void)
static void test_basefilter(void)
static void test_filesourcefilter(void)
enum _PinDirection PIN_DIRECTION
const GUID IID_IKsPropertySet
const GUID IID_IBaseFilter
#define ReadFile(a, b, c, d, e)
#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)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
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
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)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
static struct test_info tests[]
static const WCHAR label[]
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
#define REGDB_E_CLASSNOTREG