Author: cwittich
Date: Sat May 29 11:07:32 2010
New Revision: 47401
URL:
http://svn.reactos.org/svn/reactos?rev=47401&view=rev
Log:
[QUARTZ]
sync to wine 1.2 RC2
Modified:
trunk/reactos/dll/directx/quartz/acmwrapper.c
trunk/reactos/dll/directx/quartz/avidec.c
trunk/reactos/dll/directx/quartz/avisplit.c
trunk/reactos/dll/directx/quartz/dsoundrender.c
trunk/reactos/dll/directx/quartz/enumfilters.c
trunk/reactos/dll/directx/quartz/filtergraph.c
trunk/reactos/dll/directx/quartz/filtermapper.c
trunk/reactos/dll/directx/quartz/memallocator.c
trunk/reactos/dll/directx/quartz/mpegsplit.c
trunk/reactos/dll/directx/quartz/pin.c
trunk/reactos/dll/directx/quartz/pin.h
trunk/reactos/dll/directx/quartz/videorenderer.c
Modified: trunk/reactos/dll/directx/quartz/acmwrapper.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/acmwrap…
==============================================================================
--- trunk/reactos/dll/directx/quartz/acmwrapper.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/acmwrapper.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -105,7 +105,7 @@
tMed = tStart;
- TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream,
(long)cbSrcStream);
+ TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
hr = IPin_ConnectionMediaType(This->tf.ppPins[0], &amt);
if (FAILED(hr))
Modified: trunk/reactos/dll/directx/quartz/avidec.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/avidec.…
==============================================================================
--- trunk/reactos/dll/directx/quartz/avidec.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/avidec.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -101,7 +101,7 @@
cbSrcStream = IMediaSample_GetActualDataLength(pSample);
- TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream,
(long)cbSrcStream);
+ TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
hr = IPin_ConnectionMediaType(This->tf.ppPins[0], &amt);
if (FAILED(hr)) {
Modified: trunk/reactos/dll/directx/quartz/avisplit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/avispli…
==============================================================================
--- trunk/reactos/dll/directx/quartz/avisplit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/avisplit.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -178,7 +178,6 @@
{
AVISTDINDEX *index = stream->stdindex[stream->index];
AVISTDINDEX_ENTRY *entry = &index->aIndex[stream->pos];
- BOOL keyframe;
/* End of file */
if (stream->index >= stream->entries)
@@ -189,7 +188,6 @@
}
rtSampleStart = index->qwBaseOffset;
- keyframe = !(entry->dwSize >> 31);
rtSampleStart += entry->dwOffset;
rtSampleStart = MEDIATIME_FROM_BYTES(rtSampleStart);
@@ -208,7 +206,6 @@
{
DWORD flags = This->oldindex->aIndex[stream->pos].dwFlags;
DWORD size = This->oldindex->aIndex[stream->pos].dwSize;
- BOOL keyframe;
/* End of file */
if (stream->index)
@@ -217,8 +214,6 @@
IMediaSample_Release(sample);
return S_FALSE;
}
-
- keyframe = !!(flags & AVIIF_KEYFRAME);
rtSampleStart = MEDIATIME_FROM_BYTES(This->offset);
rtSampleStart +=
MEDIATIME_FROM_BYTES(This->oldindex->aIndex[stream->pos].dwOffset);
@@ -775,7 +770,7 @@
{
const AVISUPERINDEX *pIndex = (const AVISUPERINDEX *)pChunk;
DWORD x;
- long rest = pIndex->cb - sizeof(AVISUPERINDEX) + sizeof(RIFFCHUNK) +
sizeof(pIndex->aIndex[0]) * ANYSIZE_ARRAY;
+ UINT rest = pIndex->cb - sizeof(AVISUPERINDEX) + sizeof(RIFFCHUNK) +
sizeof(pIndex->aIndex[0]) * ANYSIZE_ARRAY;
if (pIndex->cb < sizeof(AVISUPERINDEX) - sizeof(RIFFCHUNK))
{
Modified: trunk/reactos/dll/directx/quartz/dsoundrender.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/dsoundr…
==============================================================================
--- trunk/reactos/dll/directx/quartz/dsoundrender.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/dsoundrender.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -78,8 +78,8 @@
HANDLE state_change, blocked;
- long volume;
- long pan;
+ LONG volume;
+ LONG pan;
} DSoundRenderImpl;
/* Seeking is not needed for a renderer, rely on newsegment for the appropriate changes
*/
@@ -238,7 +238,7 @@
{
DSoundRenderImpl *This = iface;
LPBYTE pbSrcStream = NULL;
- long cbSrcStream = 0;
+ LONG cbSrcStream = 0;
REFERENCE_TIME tStart, tStop;
HRESULT hr;
AM_MEDIA_TYPE *amt;
@@ -344,7 +344,7 @@
}
cbSrcStream = IMediaSample_GetActualDataLength(pSample);
- TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream, cbSrcStream);
+ TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
#if 0 /* For debugging purpose */
{
@@ -677,7 +677,7 @@
}
LeaveCriticalSection(&This->csFilter);
- return S_OK;
+ return hr;
}
static HRESULT WINAPI DSoundRender_SetSyncSource(IBaseFilter * iface, IReferenceClock
*pClock)
@@ -877,11 +877,11 @@
{
hr = IDirectSoundBuffer_SetVolume(DSImpl->dsbuffer, DSImpl->volume);
if (FAILED(hr))
- ERR("Can't set volume to %ld (%x)\n", DSImpl->volume,
hr);
+ ERR("Can't set volume to %d (%x)\n", DSImpl->volume,
hr);
hr = IDirectSoundBuffer_SetPan(DSImpl->dsbuffer, DSImpl->pan);
if (FAILED(hr))
- ERR("Can't set pan to %ld (%x)\n", DSImpl->pan, hr);
+ ERR("Can't set pan to %d (%x)\n", DSImpl->pan, hr);
DSImpl->write_pos = 0;
hr = S_OK;
Modified: trunk/reactos/dll/directx/quartz/enumfilters.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/enumfil…
==============================================================================
--- trunk/reactos/dll/directx/quartz/enumfilters.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/enumfilters.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -126,6 +126,9 @@
TRACE("(%p)->(%u, %p, %p)\n", iface, cFilters, ppFilters, pcFetched);
+ if (!ppFilters)
+ return E_POINTER;
+
for (i = 0; i < cFetched; i++)
{
ppFilters[i] = This->ppFilters[This->uIndex + i];
Modified: trunk/reactos/dll/directx/quartz/filtergraph.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/filterg…
==============================================================================
--- trunk/reactos/dll/directx/quartz/filtergraph.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/filtergraph.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -45,14 +45,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct {
- HWND hWnd; /* Target window */
- long msg; /* User window message */
- long instance; /* User data */
- int disabled; /* Disabled messages posting */
+ HWND hWnd; /* Target window */
+ UINT msg; /* User window message */
+ LONG_PTR instance; /* User data */
+ int disabled; /* Disabled messages posting */
} WndNotify;
typedef struct {
- long lEventCode; /* Event code */
+ LONG lEventCode; /* Event code */
LONG_PTR lParam1; /* Param1 */
LONG_PTR lParam2; /* Param2 */
} Event;
@@ -120,7 +120,7 @@
return TRUE;
}
-static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, long msTimeOut)
+static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, LONG msTimeOut)
{
if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0)
return FALSE;
@@ -182,7 +182,7 @@
LPWSTR * pFilterNames;
int nFilters;
int filterCapacity;
- long nameIndex;
+ LONG nameIndex;
IReferenceClock *refClock;
EventsQueue evqueue;
HANDLE hEventCompletion;
@@ -4970,7 +4970,7 @@
This->notif.hWnd = (HWND)hwnd;
This->notif.msg = lMsg;
- This->notif.instance = (long) lInstanceData;
+ This->notif.instance = lInstanceData;
return S_OK;
}
@@ -5055,30 +5055,26 @@
static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
{
- FIXME("(): stub\n");
-
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface);
+ return MediaControl_Stop((IMediaControl*)&This->IMediaControl_vtbl);
}
static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
{
- FIXME("(): stub\n");
-
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface);
+ return MediaControl_Pause((IMediaControl*)&This->IMediaControl_vtbl);
}
static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
{
- FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart));
-
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface);
+ return MediaControl_Run((IMediaControl*)&This->IMediaControl_vtbl);
}
static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout,
FILTER_STATE * pState)
{
- FIXME("(%d, %p): stub\n", dwMsTimeout, pState);
-
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface);
+ return MediaControl_GetState((IMediaControl*)&This->IMediaControl_vtbl,
dwMsTimeout, (OAFilterState*)pState);
}
static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock
*pClock)
Modified: trunk/reactos/dll/directx/quartz/filtermapper.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/filterm…
==============================================================================
--- trunk/reactos/dll/directx/quartz/filtermapper.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/filtermapper.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -1778,7 +1778,7 @@
prf2 = CoTaskMemAlloc(sizeof(*prf2));
if (!prf2)
return E_OUTOFMEMORY;
- *ppRegFilter2 = (BYTE *)&prf2;
+ *ppRegFilter2 = (BYTE *)prf2;
hr = FM2_ReadFilterData(pData, prf2);
if (FAILED(hr))
Modified: trunk/reactos/dll/directx/quartz/memallocator.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/memallo…
==============================================================================
--- trunk/reactos/dll/directx/quartz/memallocator.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/memallocator.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -534,7 +534,7 @@
hr = S_OK;
}
- return S_OK;
+ return hr;
}
static HRESULT WINAPI StdMediaSample2_SetTime(IMediaSample2 * iface, REFERENCE_TIME *
pStart, REFERENCE_TIME * pEnd)
@@ -785,7 +785,7 @@
StdMemAllocator *This = (StdMemAllocator *)iface;
StdMediaSample2 * pSample = NULL;
SYSTEM_INFO si;
- long i;
+ LONG i;
assert(list_empty(&This->base.free_list));
Modified: trunk/reactos/dll/directx/quartz/mpegsplit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/mpegspl…
==============================================================================
--- trunk/reactos/dll/directx/quartz/mpegsplit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/mpegsplit.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -246,10 +246,7 @@
BYTE *pbSrcStream;
DWORD cbSrcStream = 0;
REFERENCE_TIME tStart, tStop, tAviStart = This->position;
- Parser_OutputPin * pOutputPin;
HRESULT hr;
-
- pOutputPin = (Parser_OutputPin*)This->Parser.ppPins[1];
hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
if (SUCCEEDED(hr))
Modified: trunk/reactos/dll/directx/quartz/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/pin.c?r…
==============================================================================
--- trunk/reactos/dll/directx/quartz/pin.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/pin.c [iso-8859-1] Sat May 29 11:07:32 2010
@@ -1834,7 +1834,7 @@
return E_FAIL;
}
-HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const
PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
+HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const
PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
{
OutputPin * pPinImpl;
Modified: trunk/reactos/dll/directx/quartz/pin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/pin.h?r…
==============================================================================
--- trunk/reactos/dll/directx/quartz/pin.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/pin.h [iso-8859-1] Sat May 29 11:07:32 2010
@@ -143,7 +143,7 @@
/*** Constructors ***/
HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo,
SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC
pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
-HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const
PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
+HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const
PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo,
SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC
pCleanUp, STOPPROCESSPROC, REQUESTPROC pCustomRequest, LPCRITICAL_SECTION pCritSec, IPin
** ppPin);
/**************************/
Modified: trunk/reactos/dll/directx/quartz/videorenderer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/quartz/videore…
==============================================================================
--- trunk/reactos/dll/directx/quartz/videorenderer.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/quartz/videorenderer.c [iso-8859-1] Sat May 29 11:07:32
2010
@@ -82,8 +82,8 @@
RECT SourceRect;
RECT DestRect;
RECT WindowPos;
- long VideoWidth;
- long VideoHeight;
+ LONG VideoWidth;
+ LONG VideoHeight;
IUnknown * pUnkOuter;
BOOL bUnkOuterValid;
BOOL bAggregatable;
@@ -287,7 +287,6 @@
return VFW_E_RUNTIME_ERROR;
}
-
TRACE("biSize = %d\n", bmiHeader->biSize);
TRACE("biWidth = %d\n", bmiHeader->biWidth);
TRACE("biHeight = %d\n", bmiHeader->biHeight);
@@ -344,7 +343,7 @@
{
VideoRendererImpl *This = iface;
LPBYTE pbSrcStream = NULL;
- long cbSrcStream = 0;
+ LONG cbSrcStream = 0;
REFERENCE_TIME tStart, tStop;
HRESULT hr;
@@ -396,7 +395,7 @@
cbSrcStream = IMediaSample_GetActualDataLength(pSample);
- TRACE("val %p %ld\n", pbSrcStream, cbSrcStream);
+ TRACE("val %p %d\n", pbSrcStream, cbSrcStream);
#if 0 /* For debugging purpose */
{
@@ -483,6 +482,7 @@
IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
{
VideoRendererImpl* This = iface;
+ LONG height;
if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
{
@@ -490,7 +490,11 @@
This->SourceRect.left = 0;
This->SourceRect.top = 0;
This->SourceRect.right = This->VideoWidth =
format->bmiHeader.biWidth;
- This->SourceRect.bottom = This->VideoHeight =
format->bmiHeader.biHeight;
+ height = format->bmiHeader.biHeight;
+ if (height < 0)
+ This->SourceRect.bottom = This->VideoHeight = -height;
+ else
+ This->SourceRect.bottom = This->VideoHeight = height;
}
else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
{
@@ -499,7 +503,11 @@
This->SourceRect.left = 0;
This->SourceRect.top = 0;
This->SourceRect.right = This->VideoWidth =
format2->bmiHeader.biWidth;
- This->SourceRect.bottom = This->VideoHeight =
format2->bmiHeader.biHeight;
+ height = format2->bmiHeader.biHeight;
+ if (height < 0)
+ This->SourceRect.bottom = This->VideoHeight = -height;
+ else
+ This->SourceRect.bottom = This->VideoHeight = height;
}
else
{
@@ -1176,10 +1184,25 @@
/*** IBasicVideo methods ***/
static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
REFTIME *pAvgTimePerFrame) {
- ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
-
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
-
+ AM_MEDIA_TYPE *pmt;
+ ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
+
+ if (!This->pInputPin->pin.pConnectedTo)
+ return VFW_E_NOT_CONNECTED;
+
+ TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
+
+ pmt = &This->pInputPin->pin.mtCurrent;
+ if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
+ VIDEOINFOHEADER *vih = (VIDEOINFOHEADER*)pmt->pbFormat;
+ *pAvgTimePerFrame = vih->AvgTimePerFrame;
+ } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
+ VIDEOINFOHEADER2 *vih = (VIDEOINFOHEADER2*)pmt->pbFormat;
+ *pAvgTimePerFrame = vih->AvgTimePerFrame;
+ } else {
+ ERR("Unknown format type %s\n",
qzdebugstr_guid(&pmt->formattype));
+ *pAvgTimePerFrame = 0;
+ }
return S_OK;
}
@@ -1779,9 +1802,6 @@
TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyleEx);
- if (WindowStyleEx &
(WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
- return E_INVALIDARG;
-
if (!SetWindowLongA(This->hWnd, GWL_EXSTYLE, WindowStyleEx))
return E_FAIL;
@@ -1805,7 +1825,7 @@
TRACE("(%p/%p)->(%d)\n", This, iface, AutoShow);
- This->AutoShow = 1; /* FIXME: Should be AutoShow */;
+ This->AutoShow = AutoShow;
return S_OK;
}
@@ -1825,16 +1845,20 @@
LONG WindowState) {
ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
- FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, WindowState);
-
+ TRACE("(%p/%p)->(%d)\n", This, iface, WindowState);
+ ShowWindow(This->hWnd, WindowState);
return S_OK;
}
static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
LONG *WindowState) {
- ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
-
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
+ WINDOWPLACEMENT place;
+ ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
+
+ place.length = sizeof(place);
+ GetWindowPlacement(This->hWnd, &place);
+ TRACE("(%p/%p)->(%p)\n", This, iface, WindowState);
+ *WindowState = place.showCmd;
return S_OK;
}