195{
202
204 return;
206 {
207 IAMMultiMediaStream_Release(pams);
208 return;
209 }
210
212 ok(
hr ==
S_OK,
"IAMMultiMediaStream_Initialize returned: %x\n",
hr);
213
214
215 hr = IAMMultiMediaStream_GetFilter(pams,
NULL);
216 ok(
hr ==
E_POINTER,
"IAMMultiMediaStream_GetFilter returned: %x\n",
hr);
217 hr = IAMMultiMediaStream_GetFilter(pams, &media_stream_filter);
218 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetFilter returned: %x\n",
hr);
219
220
221 hr = IAMMultiMediaStream_GetMediaStream(pams, &
IID_IUnknown, &dummy_stream);
222 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
224 ok(
hr == MS_E_PURPOSEID,
"IAMMultiMediaStream_AddMediaStream returned: %x\n",
hr);
225
226
227 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
228 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
229
230
232 ok(
hr == MS_E_PURPOSEID,
"IAMMultiMediaStream_AddMediaStream returned: %x\n",
hr);
233 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
234 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
236 ok(
hr == MS_E_PURPOSEID,
"IAMMultiMediaStream_AddMediaStream returned: %x\n",
hr);
237 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
238 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
239
240
241 hr = IAMMultiMediaStream_AddMediaStream(pams,
NULL, &MSPID_PrimaryVideo, 0,
NULL);
242 ok(
hr ==
S_OK,
"IAMMultiMediaStream_AddMediaStream returned: %x\n",
hr);
243 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
244 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
245
246
247 if (media_stream_filter)
248 {
249 hr = IMediaStreamFilter_GetMediaStream(media_stream_filter, &MSPID_PrimaryVideo, &dummy_stream);
250 ok(
hr ==
S_OK,
"IMediaStreamFilter_GetMediaStream returned: %x\n",
hr);
251 ok(dummy_stream == video_stream,
"Got wrong returned pointer %p, expected %p\n", dummy_stream, video_stream);
253 IMediaStream_Release(dummy_stream);
254 }
255
256
257 if (video_stream)
258 {
265
266 hr = IMediaStream_QueryInterface(video_stream, &IID_IAMMediaStream, (
LPVOID*)&am_media_stream);
267 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
268 ok((
void*)am_media_stream == (
void*)video_stream,
"Not same interface, got %p expected %p\n", am_media_stream, video_stream);
269
270 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream,
NULL);
272
273 multi_media_stream = (void *)0xdeadbeef;
274 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
275 ok(
hr ==
S_OK,
"IAMMediaStream_GetMultiMediaStream returned: %x\n",
hr);
276 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
277 IMultiMediaStream_Release(multi_media_stream);
278
279 IAMMediaStream_Release(am_media_stream);
280
281 hr = IMediaStream_QueryInterface(video_stream, &
IID_IPin, (
void **)&
pin);
282 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
283
285
286 hr = IMediaStream_QueryInterface(video_stream, &IID_IAudioMediaStream, (
LPVOID*)&audio_media_stream);
288
289 hr = IMediaStream_QueryInterface(video_stream, &IID_IDirectDrawMediaStream, (
LPVOID*)&ddraw_stream);
290 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
291
293 {
297
298 hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, ¤t_format, &
palette, &desired_format, &
flags);
299 ok(
hr == MS_E_NOSTREAM,
"IDirectDrawoMediaStream_GetFormat returned: %x\n",
hr);
300
301 hr = IDirectDrawMediaStream_CreateSample(ddraw_stream,
NULL,
NULL, 0, &ddraw_sample);
302 ok(
hr ==
S_OK,
"IDirectDrawMediaStream_CreateSample returned: %x\n",
hr);
303
304 hr = IDirectDrawMediaStream_GetMultiMediaStream(ddraw_stream,
NULL);
306
307 multi_media_stream = (void *)0xdeadbeef;
308 hr = IDirectDrawMediaStream_GetMultiMediaStream(ddraw_stream, &multi_media_stream);
309 ok(
hr ==
S_OK,
"IDirectDrawMediaStream_GetMultiMediaStream returned: %x\n",
hr);
310 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
311 IMultiMediaStream_Release(multi_media_stream);
312 }
313
314 if (ddraw_sample)
315 IDirectDrawStreamSample_Release(ddraw_sample);
316 if (ddraw_stream)
317 IDirectDrawMediaStream_Release(ddraw_stream);
318 }
319
320
321 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream);
322 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
323
324
328 {
331 const WCHAR name[] = {
'0',
'0',
'0',
'1',0};
333
334 hr = IAMMultiMediaStream_GetFilterGraph(pams, &filtergraph);
335 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetFilterGraph returned: %x\n",
hr);
337 {
338 hr = IGraphBuilder_FindFilterByName(filtergraph,
name, &
filter);
339 ok(
hr ==
S_OK,
"IGraphBuilder_FindFilterByName returned: %x\n",
hr);
340 }
342 {
344 ok(
hr ==
S_OK,
"IGraphBuilder_FindFilterByName returned: %x\n",
hr);
345 }
349 IBaseFilter_Release(
filter);
350 if (filtergraph)
351 IGraphBuilder_Release(filtergraph);
352 }
353 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream);
354 ok(
hr == MS_E_NOSTREAM,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
355
356
357 hr = IAMMultiMediaStream_AddMediaStream(pams,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
358 ok(
hr ==
S_OK,
"IAMMultiMediaStream_AddMediaStream returned: %x\n",
hr);
359 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &audio_stream);
360 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
361
362
363 if (media_stream_filter)
364 {
365 hr = IMediaStreamFilter_GetMediaStream(media_stream_filter, &MSPID_PrimaryAudio, &dummy_stream);
366 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetMediaStream returned: %x\n",
hr);
367 ok(dummy_stream == audio_stream,
"Got wrong returned pointer %p, expected %p\n", dummy_stream, audio_stream);
369 IMediaStream_Release(dummy_stream);
370 }
371
372
373 if (audio_stream)
374 {
381
382 hr = IMediaStream_QueryInterface(audio_stream, &IID_IAMMediaStream, (
LPVOID*)&am_media_stream);
383 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
384 ok((
void*)am_media_stream == (
void*)audio_stream,
"Not same interface, got %p expected %p\n", am_media_stream, audio_stream);
385
386 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream,
NULL);
388
389 multi_media_stream = (void *)0xdeadbeef;
390 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
391 ok(
hr ==
S_OK,
"IAMMediaStream_GetMultiMediaStream returned: %x\n",
hr);
392 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
393 IMultiMediaStream_Release(multi_media_stream);
394
395 IAMMediaStream_Release(am_media_stream);
396
397 hr = IMediaStream_QueryInterface(audio_stream, &
IID_IPin, (
void **)&
pin);
398 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
399
401
402 hr = IMediaStream_QueryInterface(audio_stream, &IID_IDirectDrawMediaStream, (
LPVOID*)&ddraw_stream);
404
405 hr = IMediaStream_QueryInterface(audio_stream, &IID_IAudioMediaStream, (
LPVOID*)&audio_media_stream);
406 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
407
409 {
412
413 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
414 ok(
hr ==
S_OK,
"CoCreateInstance returned: %x\n",
hr);
415
416 hr = IAudioMediaStream_GetFormat(audio_media_stream,
NULL);
418 hr = IAudioMediaStream_GetFormat(audio_media_stream, &
format);
419 ok(
hr == MS_E_NOSTREAM,
"IAudioMediaStream_GetFormat returned: %x\n",
hr);
420
421 hr = IAudioMediaStream_CreateSample(audio_media_stream,
NULL, 0, &audio_sample);
422 ok(
hr ==
E_POINTER,
"IAudioMediaStream_CreateSample returned: %x\n",
hr);
423 hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &audio_sample);
424 ok(
hr ==
S_OK,
"IAudioMediaStream_CreateSample returned: %x\n",
hr);
425
426 hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream,
NULL);
428
429 multi_media_stream = (void *)0xdeadbeef;
430 hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream, &multi_media_stream);
431 ok(
hr ==
S_OK,
"IAudioMediaStream_GetMultiMediaStream returned: %x\n",
hr);
432 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
433 IMultiMediaStream_Release(multi_media_stream);
434
435 if (audio_data)
436 IAudioData_Release(audio_data);
437 if (audio_sample)
438 IAudioStreamSample_Release(audio_sample);
439 if (audio_media_stream)
440 IAudioMediaStream_Release(audio_media_stream);
441 }
442 }
443
444 if (media_stream_filter)
445 {
447
448 hr = IMediaStreamFilter_EnumPins(media_stream_filter, &enum_pins);
449 ok(
hr ==
S_OK,
"IBaseFilter_EnumPins returned: %x\n",
hr);
451 {
454 ULONG expected_nb_pins = audio_stream ? 2 : 1;
456
457 hr = IEnumPins_Next(enum_pins, 3, pins, &nb_pins);
459 ok(nb_pins == expected_nb_pins,
"Number of pins is %u instead of %u\n", nb_pins, expected_nb_pins);
460 for (
i = 0;
i <
min(nb_pins, expected_nb_pins);
i++)
461 {
464 ULONG nb_media_types;
468
469
470 id[0] = 'I';
472
473 hr = IPin_ConnectedTo(pins[
i], &
pin);
475 hr = IPin_QueryPinInfo(pins[
i], &
info);
476 ok(
hr ==
S_OK,
"IPin_QueryPinInfo returned: %x\n",
hr);
477 IBaseFilter_Release(
info.pFilter);
480 hr = IPin_EnumMediaTypes(pins[
i], &enum_media_types);
481 ok(
hr ==
S_OK,
"IPin_EnumMediaTypes returned: %x\n",
hr);
482 hr = IEnumMediaTypes_Next(enum_media_types,
sizeof(media_types) /
sizeof(media_types[0]), media_types, &nb_media_types);
484 ok(nb_media_types > 0,
"nb_media_types should be >0\n");
485 IEnumMediaTypes_Release(enum_media_types);
486 hr = IMediaStream_QueryInterface(
i ? audio_stream : video_stream, &
IID_IPin, (
void **)&
pin);
487 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %x\n",
hr);
488 ok(
pin == pins[
i],
"Pin is %p instead of %p\n", pins[
i],
pin);
490 IPin_Release(pins[
i]);
491 }
492 IEnumPins_Release(enum_pins);
493 }
494 }
495
496
497 hr = IAMMultiMediaStream_OpenFile(pams,
NULL, 0);
499
500 if (video_stream)
501 IMediaStream_Release(video_stream);
502 if (audio_stream)
503 IMediaStream_Release(audio_stream);
504 if (media_stream_filter)
505 IMediaStreamFilter_Release(media_stream_filter);
506
508 IAMMultiMediaStream_Release(pams);
509}
@ AMMSF_ADDDEFAULTRENDERER
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
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 IsEqualGUID(rguid1, rguid2)
#define VFW_E_NO_AUDIO_HARDWARE
#define VFW_E_NOT_CONNECTED