Author: akhaldi
Date: Thu Aug 18 09:14:24 2016
New Revision: 72249
URL:
http://svn.reactos.org/svn/reactos?rev=72249&view=rev
Log:
[AMSTREAM] Sync with Wine Staging 1.9.16. CORE-11866
Modified:
trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt
trunk/reactos/dll/directx/wine/amstream/audiodata.c
trunk/reactos/dll/directx/wine/amstream/main.c
trunk/reactos/dll/directx/wine/amstream/mediastream.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
==============================================================================
--- trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/amstream/CMakeLists.txt [iso-8859-1] Thu Aug 18
09:14:24 2016
@@ -21,6 +21,6 @@
set_module_type(amstream win32dll)
target_link_libraries(amstream strmbase strmiids uuid wine)
-add_importlibs(amstream ole32 ddraw msvcrt kernel32 ntdll)
+add_importlibs(amstream ole32 ddraw user32 msvcrt kernel32 ntdll)
add_pch(amstream amstream_private.h SOURCE)
add_cd_file(TARGET amstream DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/directx/wine/amstream/audiodata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
==============================================================================
--- trunk/reactos/dll/directx/wine/amstream/audiodata.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/amstream/audiodata.c [iso-8859-1] Thu Aug 18 09:14:24
2016
@@ -23,6 +23,11 @@
typedef struct {
IAudioData IAudioData_iface;
LONG ref;
+ DWORD size;
+ BYTE *data;
+ BOOL data_owned;
+ DWORD actual_data;
+ WAVEFORMATEX wave_format;
} AMAudioDataImpl;
static inline AMAudioDataImpl *impl_from_IAudioData(IAudioData *iface)
@@ -36,7 +41,6 @@
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
- IsEqualGUID(riid, &IID_IMemoryData) ||
IsEqualGUID(riid, &IID_IAudioData))
{
IAudioData_AddRef(iface);
@@ -66,7 +70,14 @@
TRACE("(%p)->(): new ref = %u\n", iface, This->ref);
if (!ref)
+ {
+ if (This->data_owned)
+ {
+ CoTaskMemFree(This->data);
+ }
+
HeapFree(GetProcessHeap(), 0, This);
+ }
return ref;
}
@@ -74,38 +85,116 @@
/*** IMemoryData methods ***/
static HRESULT WINAPI IAudioDataImpl_SetBuffer(IAudioData* iface, DWORD size, BYTE *data,
DWORD flags)
{
- FIXME("(%p)->(%u,%p,%x): stub\n", iface, size, data, flags);
-
- return E_NOTIMPL;
+ AMAudioDataImpl *This = impl_from_IAudioData(iface);
+
+ TRACE("(%p)->(%u,%p,%x)\n", iface, size, data, flags);
+
+ if (!size)
+ {
+ return E_INVALIDARG;
+ }
+
+ if (This->data_owned)
+ {
+ CoTaskMemFree(This->data);
+ This->data_owned = FALSE;
+ }
+
+ This->size = size;
+ This->data = data;
+
+ if (!This->data)
+ {
+ This->data = CoTaskMemAlloc(This->size);
+ This->data_owned = TRUE;
+ if (!This->data)
+ {
+ return E_OUTOFMEMORY;
+ }
+ }
+
+ return S_OK;
}
static HRESULT WINAPI IAudioDataImpl_GetInfo(IAudioData* iface, DWORD *length, BYTE
**data, DWORD *actual_data)
{
- FIXME("(%p)->(%p,%p,%p): stub\n", iface, length, data, actual_data);
-
- return E_NOTIMPL;
+ AMAudioDataImpl *This = impl_from_IAudioData(iface);
+
+ TRACE("(%p)->(%p,%p,%p)\n", iface, length, data, actual_data);
+
+ if (!This->data)
+ {
+ return MS_E_NOTINIT;
+ }
+
+ if (length)
+ {
+ *length = This->size;
+ }
+ if (data)
+ {
+ *data = This->data;
+ }
+ if (actual_data)
+ {
+ *actual_data = This->actual_data;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI IAudioDataImpl_SetActual(IAudioData* iface, DWORD data_valid)
{
- FIXME("(%p)->(%u): stub\n", iface, data_valid);
-
- return E_NOTIMPL;
+ AMAudioDataImpl *This = impl_from_IAudioData(iface);
+
+ TRACE("(%p)->(%u)\n", iface, data_valid);
+
+ if (data_valid > This->size)
+ {
+ return E_INVALIDARG;
+ }
+
+ This->actual_data = data_valid;
+
+ return S_OK;
}
/*** IAudioData methods ***/
static HRESULT WINAPI IAudioDataImpl_GetFormat(IAudioData* iface, WAVEFORMATEX
*wave_format_current)
{
- FIXME("(%p)->(%p): stub\n", iface, wave_format_current);
-
- return E_NOTIMPL;
+ AMAudioDataImpl *This = impl_from_IAudioData(iface);
+
+ TRACE("(%p)->(%p)\n", iface, wave_format_current);
+
+ if (!wave_format_current)
+ {
+ return E_POINTER;
+ }
+
+ *wave_format_current = This->wave_format;
+
+ return S_OK;
}
static HRESULT WINAPI IAudioDataImpl_SetFormat(IAudioData* iface, const WAVEFORMATEX
*wave_format)
{
- FIXME("(%p)->(%p): stub\n", iface, wave_format);
-
- return E_NOTIMPL;
+ AMAudioDataImpl *This = impl_from_IAudioData(iface);
+
+ TRACE("(%p)->(%p)\n", iface, wave_format);
+
+ if (!wave_format)
+ {
+ return E_POINTER;
+ }
+
+ if (WAVE_FORMAT_PCM != wave_format->wFormatTag)
+ {
+ return E_INVALIDARG;
+ }
+
+ This->wave_format = *wave_format;
+
+ return S_OK;
}
static const struct IAudioDataVtbl AudioData_Vtbl =
@@ -139,6 +228,13 @@
object->IAudioData_iface.lpVtbl = &AudioData_Vtbl;
object->ref = 1;
+ object->wave_format.wFormatTag = WAVE_FORMAT_PCM;
+ object->wave_format.nChannels = 1;
+ object->wave_format.nSamplesPerSec = 11025;
+ object->wave_format.wBitsPerSample = 16;
+ object->wave_format.nBlockAlign = object->wave_format.wBitsPerSample *
object->wave_format.nChannels / 8;
+ object->wave_format.nAvgBytesPerSec = object->wave_format.nBlockAlign *
object->wave_format.nSamplesPerSec;
+
*ppObj = &object->IAudioData_iface;
return S_OK;
Modified: trunk/reactos/dll/directx/wine/amstream/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
==============================================================================
--- trunk/reactos/dll/directx/wine/amstream/main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/amstream/main.c [iso-8859-1] Thu Aug 18 09:14:24 2016
@@ -102,8 +102,8 @@
{
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
HRESULT hres;
- LPUNKNOWN punk;
-
+ IUnknown *punk;
+
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
*ppobj = NULL;
Modified: trunk/reactos/dll/directx/wine/amstream/mediastream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/amstream/…
==============================================================================
--- trunk/reactos/dll/directx/wine/amstream/mediastream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/amstream/mediastream.c [iso-8859-1] Thu Aug 18 09:14:24
2016
@@ -1038,11 +1038,7 @@
DDSURFACEDESC desc = { sizeof(desc) };
hr = IDirectDrawSurface_GetSurfaceDesc(object->surface, &desc);
if (hr == S_OK)
- {
- object->rect.left = object->rect.top = 0;
- object->rect.right = desc.dwWidth;
- object->rect.bottom = desc.dwHeight;
- }
+ SetRect(&object->rect, 0, 0, desc.dwWidth, desc.dwHeight);
}
*ddraw_stream_sample = &object->IDirectDrawStreamSample_iface;
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Aug 18 09:14:24 2016
@@ -21,7 +21,7 @@
The following libraries are shared with Wine.
-reactos/dll/directx/wine/amstream # Synced to WineStaging-1.9.11
+reactos/dll/directx/wine/amstream # Synced to WineStaging-1.9.16
reactos/dll/directx/wine/d3d8 # Synced to WineStaging-1.9.4
reactos/dll/directx/wine/d3d9 # Synced to WineStaging-1.9.4
reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.9.4