2 * Unit tests for MultiMedia Stream functions
4 * Copyright (C) 2009 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/test.h"
30 static const char fileA
[FILE_LEN
] = "test.avi";
32 IAMMultiMediaStream
* pams
;
34 static int create_ammultimediastream(void)
36 return S_OK
== CoCreateInstance(
37 &CLSID_AMMultiMediaStream
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IAMMultiMediaStream
, (LPVOID
*)&pams
);
40 static void release_ammultimediastream(void)
42 IAMMultiMediaStream_Release(pams
);
45 static void renderfile(const char * fileA
)
48 WCHAR fileW
[FILE_LEN
];
49 IGraphBuilder
* pgraph
;
51 MultiByteToWideChar(CP_ACP
, 0, fileA
, -1, fileW
, FILE_LEN
);
53 hr
= IAMMultiMediaStream_GetFilterGraph(pams
, &pgraph
);
54 ok(hr
==S_OK
, "GetFilterGraph returned: %x\n", hr
);
55 ok(pgraph
==NULL
, "Filtergraph should not be created yet\n");
58 IGraphBuilder_Release(pgraph
);
60 hr
= IAMMultiMediaStream_OpenFile(pams
, fileW
, 0);
61 ok(hr
==S_OK
, "OpenFile returned: %x\n", hr
);
63 hr
= IAMMultiMediaStream_GetFilterGraph(pams
, &pgraph
);
64 ok(hr
==S_OK
, "GetFilterGraph returned: %x\n", hr
);
65 ok(pgraph
!=NULL
, "Filtergraph should be created\n");
68 IGraphBuilder_Release(pgraph
);
71 static void test_render(void)
75 if (!create_ammultimediastream())
78 h
= CreateFileA(fileA
, 0, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
79 if (h
!= INVALID_HANDLE_VALUE
) {
84 release_ammultimediastream();
89 CoInitializeEx(NULL
, COINIT_MULTITHREADED
);