Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/audiostream.c | 50 +++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/dlls/amstream/audiostream.c b/dlls/amstream/audiostream.c index 265c3bf9f2..a38cbc5f63 100644 --- a/dlls/amstream/audiostream.c +++ b/dlls/amstream/audiostream.c @@ -502,11 +502,24 @@ static HRESULT WINAPI audio_IAMMediaStream_SendEndOfStream(IAMMediaStream *iface static HRESULT WINAPI audio_IAMMediaStream_Initialize(IAMMediaStream *iface, IUnknown *source_object, DWORD flags, REFMSPID purpose_id, const STREAM_TYPE stream_type) { - struct audio_stream *This = impl_from_IAMMediaStream(iface); + struct audio_stream *stream = impl_from_IAMMediaStream(iface);
- FIXME("(%p/%p)->(%p,%x,%p,%u) stub!\n", This, iface, source_object, flags, purpose_id, stream_type); + TRACE("stream %p, source_object %p, flags %x, purpose_id %s, stream_type %u.\n", stream, source_object, flags, + debugstr_guid(purpose_id), stream_type);
- return S_FALSE; + if (!purpose_id) + return E_POINTER; + + if (source_object) + FIXME("Specifying a stream object is not yet supported.\n"); + + if (flags & AMMSF_CREATEPEER) + FIXME("AMMSF_CREATEPEER is not yet supported.\n"); + + stream->purpose_id = *purpose_id; + stream->stream_type = stream_type; + + return S_OK; }
static HRESULT WINAPI audio_IAMMediaStream_SetState(IAMMediaStream *iface, FILTER_STATE state) @@ -530,13 +543,15 @@ static HRESULT WINAPI audio_IAMMediaStream_SetState(IAMMediaStream *iface, FILTE }
static HRESULT WINAPI audio_IAMMediaStream_JoinAMMultiMediaStream(IAMMediaStream *iface, - IAMMultiMediaStream *am_multi_media_stream) + IAMMultiMediaStream *mmstream) { - struct audio_stream *This = impl_from_IAMMediaStream(iface); + struct audio_stream *stream = impl_from_IAMMediaStream(iface);
- FIXME("(%p/%p)->(%p) stub!\n", This, iface, am_multi_media_stream); + TRACE("stream %p, mmstream %p.\n", stream, mmstream);
- return S_FALSE; + stream->parent = (IMultiMediaStream *)mmstream; + + return S_OK; }
static HRESULT WINAPI audio_IAMMediaStream_JoinFilter(IAMMediaStream *iface, IMediaStreamFilter *filter) @@ -1262,12 +1277,10 @@ HRESULT audio_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) { struct audio_stream *object; + HRESULT hr;
TRACE("(%p,%s,%p,%p)\n", parent, debugstr_guid(purpose_id), stream_object, media_stream);
- if (stream_object) - FIXME("Specifying a stream object is not yet supported.\n"); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) return E_OUTOFMEMORY; @@ -1279,12 +1292,23 @@ HRESULT audio_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, object->ref = 1;
InitializeCriticalSection(&object->cs); - object->parent = parent; - object->purpose_id = *purpose_id; - object->stream_type = stream_type; list_init(&object->receive_queue); list_init(&object->update_queue);
+ hr = IAMMediaStream_Initialize(&object->IAMMediaStream_iface, stream_object, 0, purpose_id, stream_type); + if (FAILED(hr)) + { + IAMMediaStream_Release(&object->IAMMediaStream_iface); + return hr; + } + + hr = IAMMediaStream_JoinAMMultiMediaStream(&object->IAMMediaStream_iface, (IAMMultiMediaStream *)parent); + if (FAILED(hr)) + { + IAMMediaStream_Release(&object->IAMMediaStream_iface); + return hr; + } + *media_stream = &object->IAMMediaStream_iface;
return S_OK;
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/ddrawstream.c | 49 +++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index a4bfe948d2..8e99ea3bf5 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -198,11 +198,26 @@ static HRESULT WINAPI ddraw_IAMMediaStream_SendEndOfStream(IAMMediaStream *iface static HRESULT WINAPI ddraw_IAMMediaStream_Initialize(IAMMediaStream *iface, IUnknown *source_object, DWORD flags, REFMSPID purpose_id, const STREAM_TYPE stream_type) { - struct ddraw_stream *This = impl_from_IAMMediaStream(iface); + struct ddraw_stream *stream = impl_from_IAMMediaStream(iface); + HRESULT hr;
- FIXME("(%p/%p)->(%p,%x,%p,%u) stub!\n", This, iface, source_object, flags, purpose_id, stream_type); + TRACE("stream %p, source_object %p, flags %x, purpose_id %s, stream_type %u.\n", stream, source_object, flags, + debugstr_guid(purpose_id), stream_type);
- return S_FALSE; + if (!purpose_id) + return E_POINTER; + + if (flags & AMMSF_CREATEPEER) + FIXME("AMMSF_CREATEPEER is not yet supported.\n"); + + stream->purpose_id = *purpose_id; + stream->stream_type = stream_type; + + if (source_object + && FAILED(hr = IUnknown_QueryInterface(source_object, &IID_IDirectDraw7, (void **)&stream->ddraw))) + FIXME("Stream object doesn't implement IDirectDraw7 interface, hr %#x.\n", hr); + + return S_OK; }
static HRESULT WINAPI ddraw_IAMMediaStream_SetState(IAMMediaStream *iface, FILTER_STATE state) @@ -214,13 +229,15 @@ static HRESULT WINAPI ddraw_IAMMediaStream_SetState(IAMMediaStream *iface, FILTE return S_FALSE; }
-static HRESULT WINAPI ddraw_IAMMediaStream_JoinAMMultiMediaStream(IAMMediaStream *iface, IAMMultiMediaStream *am_multi_media_stream) +static HRESULT WINAPI ddraw_IAMMediaStream_JoinAMMultiMediaStream(IAMMediaStream *iface, IAMMultiMediaStream *mmstream) { - struct ddraw_stream *This = impl_from_IAMMediaStream(iface); + struct ddraw_stream *stream = impl_from_IAMMediaStream(iface); + + TRACE("stream %p, mmstream %p.\n", stream, mmstream);
- FIXME("(%p/%p)->(%p) stub!\n", This, iface, am_multi_media_stream); + stream->parent = (IMultiMediaStream *)mmstream;
- return S_FALSE; + return S_OK; }
static HRESULT WINAPI ddraw_IAMMediaStream_JoinFilter(IAMMediaStream *iface, IMediaStreamFilter *filter) @@ -929,13 +946,19 @@ HRESULT ddraw_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id,
InitializeCriticalSection(&object->cs);
- object->parent = parent; - object->purpose_id = *purpose_id; - object->stream_type = stream_type; + hr = IAMMediaStream_Initialize(&object->IAMMediaStream_iface, stream_object, 0, purpose_id, stream_type); + if (FAILED(hr)) + { + IAMMediaStream_Release(&object->IAMMediaStream_iface); + return hr; + }
- if (stream_object - && FAILED(hr = IUnknown_QueryInterface(stream_object, &IID_IDirectDraw7, (void **)&object->ddraw))) - FIXME("Stream object doesn't implement IDirectDraw7 interface, hr %#x.\n", hr); + hr = IAMMediaStream_JoinAMMultiMediaStream(&object->IAMMediaStream_iface, (IAMMultiMediaStream *)parent); + if (FAILED(hr)) + { + IAMMediaStream_Release(&object->IAMMediaStream_iface); + return hr; + }
*media_stream = &object->IAMMediaStream_iface;
Signed-off-by: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/amstream_private.h | 6 ++---- dlls/amstream/audiostream.c | 23 +++++------------------ dlls/amstream/ddrawstream.c | 23 +++++------------------ dlls/amstream/multimedia.c | 18 +++++++++++++----- dlls/amstream/tests/amstream.c | 2 +- 5 files changed, 26 insertions(+), 46 deletions(-)
diff --git a/dlls/amstream/amstream_private.h b/dlls/amstream/amstream_private.h index bec107f819..e71563cb11 100644 --- a/dlls/amstream/amstream_private.h +++ b/dlls/amstream/amstream_private.h @@ -37,9 +37,7 @@ HRESULT multimedia_stream_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT filter_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; -HRESULT ddraw_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - IUnknown *stream_object, STREAM_TYPE type, IAMMediaStream **stream) DECLSPEC_HIDDEN; -HRESULT audio_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) DECLSPEC_HIDDEN; +HRESULT ddraw_stream_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; +HRESULT audio_stream_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN;
#endif /* __AMSTREAM_PRIVATE_INCLUDED__ */ diff --git a/dlls/amstream/audiostream.c b/dlls/amstream/audiostream.c index a38cbc5f63..f9470fa5f9 100644 --- a/dlls/amstream/audiostream.c +++ b/dlls/amstream/audiostream.c @@ -1273,13 +1273,12 @@ static const IMemInputPinVtbl audio_meminput_vtbl = audio_meminput_ReceiveCanBlock, };
-HRESULT audio_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) +HRESULT audio_stream_create(IUnknown *outer, void **out) { struct audio_stream *object; - HRESULT hr;
- TRACE("(%p,%s,%p,%p)\n", parent, debugstr_guid(purpose_id), stream_object, media_stream); + if (outer) + return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) @@ -1295,21 +1294,9 @@ HRESULT audio_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, list_init(&object->receive_queue); list_init(&object->update_queue);
- hr = IAMMediaStream_Initialize(&object->IAMMediaStream_iface, stream_object, 0, purpose_id, stream_type); - if (FAILED(hr)) - { - IAMMediaStream_Release(&object->IAMMediaStream_iface); - return hr; - } - - hr = IAMMediaStream_JoinAMMultiMediaStream(&object->IAMMediaStream_iface, (IAMMultiMediaStream *)parent); - if (FAILED(hr)) - { - IAMMediaStream_Release(&object->IAMMediaStream_iface); - return hr; - } + TRACE("Created audio stream %p.\n", object);
- *media_stream = &object->IAMMediaStream_iface; + *out = &object->IAMMediaStream_iface;
return S_OK; } diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 8e99ea3bf5..1c924e40a2 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -926,13 +926,12 @@ static const IMemInputPinVtbl ddraw_meminput_vtbl = ddraw_meminput_ReceiveCanBlock, };
-HRESULT ddraw_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id, - IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) +HRESULT ddraw_stream_create(IUnknown *outer, void **out) { struct ddraw_stream *object; - HRESULT hr;
- TRACE("(%p,%s,%p,%p)\n", parent, debugstr_guid(purpose_id), stream_object, media_stream); + if (outer) + return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) @@ -946,21 +945,9 @@ HRESULT ddraw_stream_create(IMultiMediaStream *parent, const MSPID *purpose_id,
InitializeCriticalSection(&object->cs);
- hr = IAMMediaStream_Initialize(&object->IAMMediaStream_iface, stream_object, 0, purpose_id, stream_type); - if (FAILED(hr)) - { - IAMMediaStream_Release(&object->IAMMediaStream_iface); - return hr; - } - - hr = IAMMediaStream_JoinAMMultiMediaStream(&object->IAMMediaStream_iface, (IAMMultiMediaStream *)parent); - if (FAILED(hr)) - { - IAMMediaStream_Release(&object->IAMMediaStream_iface); - return hr; - } + TRACE("Created ddraw stream %p.\n", object);
- *media_stream = &object->IAMMediaStream_iface; + *out = &object->IAMMediaStream_iface;
return S_OK; } diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index be8fd4ecbf..e77392e483 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -301,6 +301,7 @@ static HRESULT WINAPI multimedia_stream_GetFilter(IAMMultiMediaStream *iface, static void add_stream(struct multimedia_stream *mmstream, IAMMediaStream *stream, IMediaStream **ret_stream) { IMediaStreamFilter_AddMediaStream(mmstream->filter, stream); + IAMMediaStream_JoinAMMultiMediaStream(stream, &mmstream->IAMMultiMediaStream_iface); if (ret_stream) { *ret_stream = (IMediaStream *)stream; @@ -377,19 +378,26 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac }
if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) - hr = ddraw_stream_create((IMultiMediaStream*)iface, PurposeId, stream_object, This->type, &pStream); + hr = ddraw_stream_create(NULL, (void **)&pStream); else if (IsEqualGUID(PurposeId, &MSPID_PrimaryAudio)) - hr = audio_stream_create((IMultiMediaStream*)iface, PurposeId, stream_object, This->type, &pStream); + hr = audio_stream_create(NULL, (void **)&pStream); else return MS_E_PURPOSEID;
- if (SUCCEEDED(hr)) + if (FAILED(hr)) + return hr; + + hr = IAMMediaStream_Initialize(pStream, stream_object, dwFlags, PurposeId, This->type); + if (FAILED(hr)) { - add_stream(This, pStream, ret_stream); IAMMediaStream_Release(pStream); + return hr; }
- return hr; + add_stream(This, pStream, ret_stream); + IAMMediaStream_Release(pStream); + + return S_OK; }
static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface, diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 073e372c94..13c00aac25 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -730,7 +730,7 @@ static void test_add_stream(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(stream == (IMediaStream *)&teststream, "Streams didn't match.\n"); if (hr == S_OK) IMediaStream_Release(stream); - todo_wine ok(teststream.mmstream == mmstream, "IAMMultiMediaStream objects didn't match.\n"); + ok(teststream.mmstream == mmstream, "IAMMultiMediaStream objects didn't match.\n"); ok(teststream.filter == stream_filter, "IMediaStreamFilter objects didn't match.\n"); todo_wine ok(!!teststream.graph, "Expected a non-NULL graph.\n");
Signed-off-by: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/amstream_classes.idl | 7 +++++++ dlls/amstream/main.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/amstream/amstream_classes.idl b/dlls/amstream/amstream_classes.idl index e6bda830b4..2251bf734e 100644 --- a/dlls/amstream/amstream_classes.idl +++ b/dlls/amstream/amstream_classes.idl @@ -34,6 +34,13 @@ coclass MediaStreamFilter { interface IMediaStreamFilter; } ] coclass AMDirectDrawStream { interface IAMMultiMediaStream; }
+[ + helpstring("AuStream Class"), + threading(both), + uuid(8496e040-af4c-11d0-8212-00c04fc32c45) +] +coclass AMAudioStream { interface IAMMediaStream; } + [ helpstring("MMStream Class"), threading(both), diff --git a/dlls/amstream/main.c b/dlls/amstream/main.c index c718f42448..c581e516bd 100644 --- a/dlls/amstream/main.c +++ b/dlls/amstream/main.c @@ -74,7 +74,8 @@ struct object_creation_info static const struct object_creation_info object_creation[] = { { &CLSID_AMMultiMediaStream, multimedia_stream_create }, - { &CLSID_AMDirectDrawStream, multimedia_stream_create }, + { &CLSID_AMDirectDrawStream, ddraw_stream_create }, + { &CLSID_AMAudioStream, audio_stream_create }, { &CLSID_AMAudioData, AMAudioData_create }, { &CLSID_MediaStreamFilter, filter_create } };
Signed-off-by: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/tests/amstream.c | 143 +++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 13c00aac25..d5b90d9257 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -3046,6 +3046,44 @@ static void test_audiostream_receive(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_audiostream_initialize(void) +{ + IAMMediaStream *stream; + STREAM_TYPE type; + MSPID mspid; + HRESULT hr; + ULONG ref; + + hr = CoCreateInstance(&CLSID_AMAudioStream, NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (void **)&stream); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + /* Crashes on native. */ + if (0) + { + hr = IAMMediaStream_Initialize(stream, NULL, 0, NULL, STREAMTYPE_WRITE); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + } + + hr = IAMMediaStream_Initialize(stream, NULL, 0, &test_mspid, STREAMTYPE_WRITE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_GetInformation(stream, &mspid, &type); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(IsEqualGUID(&mspid, &test_mspid), "Got mspid %s.\n", wine_dbgstr_guid(&mspid)); + ok(type == STREAMTYPE_WRITE, "Got type %u.\n", type); + + hr = IAMMediaStream_Initialize(stream, NULL, 0, &MSPID_PrimaryAudio, STREAMTYPE_READ); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_GetInformation(stream, &mspid, &type); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(IsEqualGUID(&mspid, &MSPID_PrimaryAudio), "Got mspid %s.\n", wine_dbgstr_guid(&mspid)); + ok(type == STREAMTYPE_READ, "Got type %u.\n", type); + + ref = IAMMediaStream_Release(stream); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + static void CALLBACK apc_func(ULONG_PTR param) { } @@ -3507,6 +3545,106 @@ void test_audiostreamsample_completion_status(void) CloseHandle(event); }
+static void test_ddrawstream_initialize(void) +{ + IDirectDrawMediaStream *ddraw_stream; + IAMMediaStream *stream; + IDirectDraw *ddraw2; + IDirectDraw *ddraw; + STREAM_TYPE type; + MSPID mspid; + HRESULT hr; + ULONG ref; + + hr = DirectDrawCreate(NULL, &ddraw, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = CoCreateInstance(&CLSID_AMDirectDrawStream, NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (void **)&stream); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_QueryInterface(stream, &IID_IDirectDrawMediaStream, (void **)&ddraw_stream); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + /* Crashes on native. */ + if (0) + { + hr = IAMMediaStream_Initialize(stream, NULL, 0, NULL, STREAMTYPE_WRITE); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + } + + hr = IAMMediaStream_Initialize(stream, NULL, 0, &test_mspid, STREAMTYPE_WRITE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_GetInformation(stream, &mspid, &type); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(IsEqualGUID(&mspid, &test_mspid), "Got mspid %s.\n", wine_dbgstr_guid(&mspid)); + ok(type == STREAMTYPE_WRITE, "Got type %u.\n", type); + + hr = IAMMediaStream_Initialize(stream, (IUnknown *)ddraw, 0, &MSPID_PrimaryAudio, STREAMTYPE_READ); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_GetInformation(stream, &mspid, &type); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(IsEqualGUID(&mspid, &MSPID_PrimaryAudio), "Got mspid %s.\n", wine_dbgstr_guid(&mspid)); + ok(type == STREAMTYPE_READ, "Got type %u.\n", type); + + hr = IDirectDrawMediaStream_GetDirectDraw(ddraw_stream, &ddraw2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(ddraw2 == ddraw, "Expected ddraw %p, got %p.\n", ddraw, ddraw2); + + IDirectDrawMediaStream_Release(ddraw_stream); + ref = IAMMediaStream_Release(stream); + ok(!ref, "Got outstanding refcount %d.\n", ref); + IDirectDraw_Release(ddraw2); + ref = IDirectDraw_Release(ddraw); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + +static void check_ammediastream_join_am_multi_media_stream(const CLSID *clsid) +{ + IAMMultiMediaStream *mmstream = create_ammultimediastream(); + IMultiMediaStream *mmstream2; + IAMMediaStream *stream; + HRESULT hr; + ULONG mmstream_ref; + ULONG ref; + + hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (void **)&stream); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + mmstream_ref = get_refcount(mmstream); + + hr = IAMMediaStream_JoinAMMultiMediaStream(stream, mmstream); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + ref = get_refcount(mmstream); + ok(ref == mmstream_ref, "Expected outstanding refcount %d, got %d.\n", mmstream_ref, ref); + + hr = IAMMediaStream_GetMultiMediaStream(stream, &mmstream2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(mmstream2 == (IMultiMediaStream *)mmstream, "Expected mmstream %p, got %p.\n", mmstream, mmstream2); + + IMultiMediaStream_Release(mmstream2); + + hr = IAMMediaStream_JoinAMMultiMediaStream(stream, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMediaStream_GetMultiMediaStream(stream, &mmstream2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(mmstream2 == NULL, "Got mmstream %p.\n", mmstream2); + + ref = IAMMediaStream_Release(stream); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IAMMultiMediaStream_Release(mmstream); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + +static void test_ammediastream_join_am_multi_media_stream(void) +{ + check_ammediastream_join_am_multi_media_stream(&CLSID_AMAudioStream); + check_ammediastream_join_am_multi_media_stream(&CLSID_AMDirectDrawStream); +} + void test_mediastreamfilter_get_state(void) { IAMMultiMediaStream *mmstream = create_ammultimediastream(); @@ -3681,10 +3819,15 @@ START_TEST(amstream) test_audiostream_set_state(); test_audiostream_end_of_stream(); test_audiostream_receive(); + test_audiostream_initialize();
test_audiostreamsample_update(); test_audiostreamsample_completion_status();
+ test_ddrawstream_initialize(); + + test_ammediastream_join_am_multi_media_stream(); + test_mediastreamfilter_get_state(); test_mediastreamfilter_stop_pause_run();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=72344
Your paranoid android.
=== debiant (32 bit report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
=== debiant (32 bit French report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
=== debiant (32 bit WoW report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
=== debiant (64 bit WoW report) ===
amstream: amstream.c:3058: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00413ffe).
Report validation errors: amstream:amstream crashed (c0000005)
Signed-off-by: Zebediah Figura z.figura12@gmail.com