Author: akhaldi Date: Tue Aug 23 19:35:53 2016 New Revision: 72447
URL: http://svn.reactos.org/svn/reactos?rev=72447&view=rev Log: [STRMBASE] Sync with Wine Staging 1.9.16. CORE-11866
Modified: trunk/reactos/media/doc/README.WINE trunk/reactos/sdk/lib/3rdparty/strmbase/mediatype.c trunk/reactos/sdk/lib/3rdparty/strmbase/qualitycontrol.c trunk/reactos/sdk/lib/3rdparty/strmbase/video.c
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=7... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Aug 23 19:35:53 2016 @@ -252,7 +252,7 @@ from Winehq CVS. If you are looking to update something in these files check Wine current sources first as it may already be fixed.
-reactos/sdk/lib/3rdparty/strmbase # Synced to WineStaging-1.9.11 +reactos/sdk/lib/3rdparty/strmbase # Synced to WineStaging-1.9.16
reactos/sdk/lib/rtl/actctx.c # Partly synced with WineStaging-1.7.55 reactos/sdk/lib/rtl/timerqueue.c # Partly synced with WineStaging-1.7.55
Modified: trunk/reactos/sdk/lib/3rdparty/strmbase/mediatype.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/3rdparty/strmbase/m... ============================================================================== --- trunk/reactos/sdk/lib/3rdparty/strmbase/mediatype.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/3rdparty/strmbase/mediatype.c [iso-8859-1] Tue Aug 23 19:35:53 2016 @@ -104,11 +104,11 @@ IEnumMediaTypesImpl * pEnumMediaTypes = CoTaskMemAlloc(sizeof(IEnumMediaTypesImpl)); AM_MEDIA_TYPE amt;
+ *ppEnum = NULL; + if (!pEnumMediaTypes) - { - *ppEnum = NULL; return E_OUTOFMEMORY; - } + pEnumMediaTypes->IEnumMediaTypes_iface.lpVtbl = &IEnumMediaTypesImpl_Vtbl; pEnumMediaTypes->refCount = 1; pEnumMediaTypes->uIndex = 0; @@ -122,14 +122,13 @@
pEnumMediaTypes->enumMediaDetails.cMediaTypes = i; pEnumMediaTypes->enumMediaDetails.pMediaTypes = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * i); + memset(pEnumMediaTypes->enumMediaDetails.pMediaTypes, 0, sizeof(AM_MEDIA_TYPE) * i); for (i = 0; i < pEnumMediaTypes->enumMediaDetails.cMediaTypes; i++) { enumFunc(basePin,i,&amt); if (FAILED(CopyMediaType(&pEnumMediaTypes->enumMediaDetails.pMediaTypes[i], &amt))) { - while (i--) - FreeMediaType(&pEnumMediaTypes->enumMediaDetails.pMediaTypes[i]); - CoTaskMemFree(pEnumMediaTypes->enumMediaDetails.pMediaTypes); + IEnumMediaTypes_Release(&pEnumMediaTypes->IEnumMediaTypes_iface); return E_OUTOFMEMORY; } }
Modified: trunk/reactos/sdk/lib/3rdparty/strmbase/qualitycontrol.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/3rdparty/strmbase/q... ============================================================================== --- trunk/reactos/sdk/lib/3rdparty/strmbase/qualitycontrol.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/3rdparty/strmbase/qualitycontrol.c [iso-8859-1] Tue Aug 23 19:35:53 2016 @@ -25,9 +25,14 @@
#include "strmbase_private.h"
-HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv) { +#define XTIME_FMT "%u.%03u" +#define XTIME(u) (int)(u/10000000), (int)((u / 10000)%1000) + +HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv) +{ QualityControlImpl *This; - *ppv = HeapAlloc(GetProcessHeap(),0,sizeof(QualityControlImpl)); + TRACE("%p, %p, %p\n", input, self, ppv); + *ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(QualityControlImpl)); if (!*ppv) return E_OUTOFMEMORY; This = *ppv; @@ -35,6 +40,8 @@ This->self = self; This->tonotify = NULL; This->clock = NULL; + This->current_rstart = This->current_rstop = -1; + TRACE("-> %p\n", This); return S_OK; }
@@ -43,26 +50,41 @@ HeapFree(GetProcessHeap(),0,This); }
-HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) { - QualityControlImpl *This = (QualityControlImpl*)iface; +static inline QualityControlImpl *impl_from_IQualityControl(IQualityControl *iface) +{ + return CONTAINING_RECORD(iface, QualityControlImpl, IQualityControl_iface); +} + +HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) +{ + QualityControlImpl *This = impl_from_IQualityControl(iface); return IBaseFilter_QueryInterface(This->self, riid, ppv); }
-ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface) { - QualityControlImpl *This = (QualityControlImpl*)iface; +ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface) +{ + QualityControlImpl *This = impl_from_IQualityControl(iface); return IBaseFilter_AddRef(This->self); }
-ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface) { - QualityControlImpl *This = (QualityControlImpl*)iface; +ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface) +{ + QualityControlImpl *This = impl_from_IQualityControl(iface); return IBaseFilter_Release(This->self); }
-HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) { +HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) +{ + QualityControlImpl *This = impl_from_IQualityControl(iface); HRESULT hr = S_FALSE; - QualityControlImpl *This = (QualityControlImpl*)iface; + + TRACE("%p %p { 0x%x %u " XTIME_FMT " " XTIME_FMT " }\n", + This, sender, qm.Type, qm.Proportion, + XTIME(qm.Late), XTIME(qm.TimeStamp)); + if (This->tonotify) return IQualityControl_Notify(This->tonotify, This->self, qm); + if (This->input) { IPin *to = NULL; IPin_ConnectedTo(This->input, &to); @@ -76,11 +98,14 @@ IPin_Release(to); } } + return hr; }
-HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify) { - QualityControlImpl *This = (QualityControlImpl*)iface; +HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify) +{ + QualityControlImpl *This = impl_from_IQualityControl(iface); + TRACE("%p %p\n", This, tonotify); This->tonotify = tonotify; return S_OK; } @@ -97,7 +122,9 @@ #define UPDATE_RUNNING_AVG_P(avg,val) DO_RUNNING_AVG(avg,val,16) #define UPDATE_RUNNING_AVG_N(avg,val) DO_RUNNING_AVG(avg,val,4)
-void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart) { +void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart) +{ + TRACE("%p " XTIME_FMT "\n", This, XTIME(tStart)); This->avg_render = This->last_in_time = This->last_left = This->avg_duration = This->avg_pt = -1; This->clockstart = tStart; This->avg_rate = -1.0; @@ -107,7 +134,9 @@ }
-void QualityControlRender_SetClock(QualityControlImpl *This, IReferenceClock *clock) { +void QualityControlRender_SetClock(QualityControlImpl *This, IReferenceClock *clock) +{ + TRACE("%p %p\n", This, clock); This->clock = clock; }
@@ -115,6 +144,9 @@ REFERENCE_TIME start, REFERENCE_TIME stop) { REFERENCE_TIME max_lateness = 200000; + + TRACE("%p " XTIME_FMT " " XTIME_FMT " " XTIME_FMT "\n", + This, XTIME(jitter), XTIME(start), XTIME(stop));
/* we can add a valid stop time */ if (stop >= start) @@ -137,8 +169,12 @@ return FALSE; }
-HRESULT QualityControlRender_WaitFor(QualityControlImpl *This, IMediaSample *sample, HANDLE ev) { +HRESULT QualityControlRender_WaitFor(QualityControlImpl *This, IMediaSample *sample, HANDLE ev) +{ REFERENCE_TIME start = -1, stop = -1, jitter = 0; + + TRACE("%p %p %p\n", This, sample, ev); + This->current_rstart = This->current_rstop = -1; This->current_jitter = 0; if (!This->clock || FAILED(IMediaSample_GetTime(sample, &start, &stop))) @@ -178,6 +214,8 @@ REFERENCE_TIME start, stop, jitter, pt, entered, left, duration; double rate;
+ TRACE("%p\n", priv); + if (!priv->clock || priv->current_rstart < 0) return;
@@ -217,14 +255,12 @@ pt = priv->avg_pt; }
-#define XTIME(u) (int)(u/10000000), (int)((u / 10000)%1000) - TRACE("start: %u.%03u, entered %u.%03u, left %u.%03u, pt: %u.%03u, " - "duration %u.%03u, jitter %u.%03u\n", XTIME(start), XTIME(entered), + TRACE("start: " XTIME_FMT ", entered " XTIME_FMT ", left " XTIME_FMT ", pt: " XTIME_FMT ", " + "duration " XTIME_FMT ", jitter " XTIME_FMT "\n", XTIME(start), XTIME(entered), XTIME(left), XTIME(pt), XTIME(duration), XTIME(jitter));
- TRACE("avg_duration: %u.%03u, avg_pt: %u.%03u, avg_rate: %g\n", + TRACE("avg_duration: " XTIME_FMT ", avg_pt: " XTIME_FMT ", avg_rate: %g\n", XTIME(priv->avg_duration), XTIME(priv->avg_pt), priv->avg_rate); -#undef XTIME
/* collect running averages. for first observations, we copy the * values */ @@ -277,7 +313,7 @@ q.Late = priv->current_jitter; q.TimeStamp = priv->current_rstart; TRACE("Late: %i from %i, rate: %g\n", (int)(q.Late/10000), (int)(q.TimeStamp/10000), 1./priv->avg_rate); - hr = IQualityControl_Notify((IQualityControl *)priv, priv->self, q); + hr = IQualityControl_Notify(&priv->IQualityControl_iface, priv->self, q); priv->qos_handled = hr == S_OK; }
@@ -286,15 +322,25 @@ }
-void QualityControlRender_BeginRender(QualityControlImpl *This) { +void QualityControlRender_BeginRender(QualityControlImpl *This) +{ + TRACE("%p\n", This); + This->start = -1; + if (!This->clock) return; + IReferenceClock_GetTime(This->clock, &This->start); -} - -void QualityControlRender_EndRender(QualityControlImpl *This) { + TRACE("at: " XTIME_FMT "\n", XTIME(This->start)); +} + +void QualityControlRender_EndRender(QualityControlImpl *This) +{ REFERENCE_TIME elapsed; + + TRACE("%p\n", This); + if (!This->clock || This->start < 0 || FAILED(IReferenceClock_GetTime(This->clock, &This->stop))) return;
Modified: trunk/reactos/sdk/lib/3rdparty/strmbase/video.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/3rdparty/strmbase/v... ============================================================================== --- trunk/reactos/sdk/lib/3rdparty/strmbase/video.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/3rdparty/strmbase/video.c [iso-8859-1] Tue Aug 23 19:35:53 2016 @@ -358,10 +358,8 @@ BaseControlVideo *This = impl_from_IBasicVideo(iface);
TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); - SourceRect.left = Left; - SourceRect.top = Top; - SourceRect.right = Left + Width; - SourceRect.bottom = Top + Height; + + SetRect(&SourceRect, Left, Top, Left + Width, Top + Height); This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
return S_OK; @@ -398,10 +396,7 @@
TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
- DestRect.left = Left; - DestRect.top = Top; - DestRect.right = Left + Width; - DestRect.bottom = Top + Height; + SetRect(&DestRect, Left, Top, Left + Width, Top + Height); This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
return S_OK;