Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/amstream_classes.idl | 7 +++++++ dlls/amstream/amstream_private.h | 2 ++ dlls/amstream/audiostream.c | 24 ++++++++++++++++++++++++ dlls/amstream/ddrawstream.c | 22 ++++++++++++++++++++++ dlls/amstream/main.c | 3 ++- 5 files changed, 57 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/amstream_private.h b/dlls/amstream/amstream_private.h index 96b933f5bc..d567fe3f68 100644 --- a/dlls/amstream/amstream_private.h +++ b/dlls/amstream/amstream_private.h @@ -37,6 +37,8 @@ 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(IUnknown *outer, void **out) DECLSPEC_HIDDEN; +HRESULT audio_stream_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; HRESULT ddraw_stream_create_and_initialize(IMultiMediaStream *parent, const MSPID *purpose_id, IUnknown *stream_object, STREAM_TYPE type, IAMMediaStream **stream) DECLSPEC_HIDDEN; HRESULT audio_stream_create_and_initialize(IMultiMediaStream *parent, const MSPID *purpose_id, diff --git a/dlls/amstream/audiostream.c b/dlls/amstream/audiostream.c index 349e657405..2379a59350 100644 --- a/dlls/amstream/audiostream.c +++ b/dlls/amstream/audiostream.c @@ -1292,6 +1292,30 @@ static const IMemInputPinVtbl audio_meminput_vtbl = audio_meminput_ReceiveCanBlock, };
+HRESULT audio_stream_create(IUnknown *outer, void **out) +{ + struct audio_stream *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IAMMediaStream_iface.lpVtbl = &audio_IAMMediaStream_vtbl; + object->IAudioMediaStream_iface.lpVtbl = &audio_IAudioMediaStream_vtbl; + object->IMemInputPin_iface.lpVtbl = &audio_meminput_vtbl; + object->IPin_iface.lpVtbl = &audio_sink_vtbl; + object->ref = 1; + + InitializeCriticalSection(&object->cs); + list_init(&object->receive_queue); + list_init(&object->update_queue); + + TRACE("Created audio stream %p.\n", object); + *out = &object->IAMMediaStream_iface; + + return S_OK; +} + HRESULT audio_stream_create_and_initialize(IMultiMediaStream *parent, const MSPID *purpose_id, IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) { diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index d21bf207ef..2b0c871d58 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -940,6 +940,28 @@ static const IMemInputPinVtbl ddraw_meminput_vtbl = ddraw_meminput_ReceiveCanBlock, };
+HRESULT ddraw_stream_create(IUnknown *outer, void **out) +{ + struct ddraw_stream *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IAMMediaStream_iface.lpVtbl = &ddraw_IAMMediaStream_vtbl; + object->IDirectDrawMediaStream_iface.lpVtbl = &ddraw_IDirectDrawMediaStream_Vtbl; + object->IMemInputPin_iface.lpVtbl = &ddraw_meminput_vtbl; + object->IPin_iface.lpVtbl = &ddraw_sink_vtbl; + object->ref = 1; + + InitializeCriticalSection(&object->cs); + + TRACE("Created ddraw stream %p.\n", object); + *out = &object->IAMMediaStream_iface; + + return S_OK; +} + HRESULT ddraw_stream_create_and_initialize(IMultiMediaStream *parent, const MSPID *purpose_id, IUnknown *stream_object, STREAM_TYPE stream_type, IAMMediaStream **media_stream) { 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 } };