[QUARTZ] Some fixes
Christian Costa
titan.costa at wanadoo.fr
Fri Dec 24 08:50:09 CST 2004
Hi,
With this patch, the indeo codec feels a little better.
Changelog:
Initialize the COM libraries for the newly created worker thread in the
AVI splitter.
Fixed some returned error codes.
Show refcount in the AddRef/Release traces in filter.
Added 24 bits source in the video renderer.
Christian Costa titan.costa at wanadoo.fr
-------------- next part --------------
Index: avidec.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/avidec.c,v
retrieving revision 1.11
diff -u -r1.11 avidec.c
--- avidec.c 20 Dec 2004 17:07:17 -0000 1.11
+++ avidec.c 24 Dec 2004 13:31:39 -0000
@@ -401,14 +401,18 @@
static ULONG WINAPI AVIDec_AddRef(IBaseFilter * iface)
{
AVIDecImpl *This = (AVIDecImpl *)iface;
- TRACE("(%p/%p)->()\n", This, iface);
+
+ TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, This->refCount);
+
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI AVIDec_Release(IBaseFilter * iface)
{
AVIDecImpl *This = (AVIDecImpl *)iface;
- TRACE("(%p/%p)->()\n", This, iface);
+
+ TRACE("(%p/%p)->() Release from %ld\n", This, iface, This->refCount);
+
if (!InterlockedDecrement(&This->refCount))
{
ULONG i;
Index: avisplit.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/avisplit.c,v
retrieving revision 1.9
diff -u -r1.9 avisplit.c
--- avisplit.c 20 Dec 2004 17:07:17 -0000 1.9
+++ avisplit.c 24 Dec 2004 13:31:41 -0000
@@ -211,14 +211,18 @@
static ULONG WINAPI AVISplitter_AddRef(IBaseFilter * iface)
{
AVISplitter *This = (AVISplitter *)iface;
- TRACE("()\n");
+
+ TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, This->refCount);
+
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI AVISplitter_Release(IBaseFilter * iface)
{
AVISplitter *This = (AVISplitter *)iface;
- TRACE("()\n");
+
+ TRACE("(%p/%p)->() Release from %ld\n", This, iface, This->refCount);
+
if (!InterlockedDecrement(&This->refCount))
{
ULONG i;
Index: dsoundrender.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/dsoundrender.c,v
retrieving revision 1.4
diff -u -r1.4 dsoundrender.c
--- dsoundrender.c 20 Dec 2004 17:07:17 -0000 1.4
+++ dsoundrender.c 24 Dec 2004 13:31:42 -0000
@@ -358,14 +358,18 @@
static ULONG WINAPI DSoundRender_AddRef(IBaseFilter * iface)
{
DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
- TRACE("(%p/%p)->()\n", This, iface);
+
+ TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, This->refCount);
+
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI DSoundRender_Release(IBaseFilter * iface)
{
DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
- TRACE("(%p/%p)->()\n", This, iface);
+
+ TRACE("(%p/%p)->() Release from %ld\n", This, iface, This->refCount);
+
if (!InterlockedDecrement(&This->refCount))
{
DeleteCriticalSection(&This->csFilter);
Index: filesource.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/filesource.c,v
retrieving revision 1.10
diff -u -r1.10 filesource.c
--- filesource.c 18 Oct 2004 21:21:19 -0000 1.10
+++ filesource.c 24 Dec 2004 13:31:44 -0000
@@ -283,7 +283,7 @@
if (SUCCEEDED(hr) && !bFound)
{
ERR("Media class not found\n");
- hr = S_FALSE;
+ hr = E_FAIL;
}
else if (bFound)
TRACE("Found file's class: major = %s, subtype = %s\n", qzdebugstr_guid(majorType), qzdebugstr_guid(minorType));
@@ -358,7 +358,7 @@
{
AsyncReader *This = (AsyncReader *)iface;
- TRACE("()\n");
+ TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, This->refCount);
return InterlockedIncrement(&This->refCount);
}
@@ -367,7 +367,7 @@
{
AsyncReader *This = (AsyncReader *)iface;
- TRACE("()\n");
+ TRACE("(%p/%p)->() Release from %ld\n", This, iface, This->refCount);
if (!InterlockedDecrement(&This->refCount))
{
Index: filtergraph.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/filtergraph.c,v
retrieving revision 1.21
diff -u -r1.21 filtergraph.c
--- filtergraph.c 20 Dec 2004 19:27:07 -0000 1.21
+++ filtergraph.c 24 Dec 2004 13:31:50 -0000
@@ -1030,7 +1030,7 @@
IGraphBuilder_RemoveFilter(iface, preader);
IBaseFilter_Release(preader);
- return S_OK;
+ return hr;
}
static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
Index: pin.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/pin.c,v
retrieving revision 1.9
diff -u -r1.9 pin.c
--- pin.c 16 Dec 2004 14:25:15 -0000 1.9
+++ pin.c 24 Dec 2004 13:31:52 -0000
@@ -1134,6 +1134,8 @@
REFERENCE_TIME rtCurrent;
ALLOCATOR_PROPERTIES allocProps;
+ CoInitialize(NULL);
+
SetEvent(This->hEventStateChanged);
hr = IMemAllocator_GetProperties(This->pAlloc, &allocProps);
@@ -1174,6 +1176,8 @@
if (pSample)
IMediaSample_Release(pSample);
}
+
+ CoUninitialize();
}
static void CALLBACK PullPin_Thread_Stop(ULONG_PTR iface)
Index: videorenderer.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/videorenderer.c,v
retrieving revision 1.4
diff -u -r1.4 videorenderer.c
--- videorenderer.c 20 Dec 2004 17:07:17 -0000 1.4
+++ videorenderer.c 24 Dec 2004 13:31:55 -0000
@@ -222,21 +222,22 @@
*(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF;
}
}
- else if (format->bmiHeader.biBitCount == 32)
+ else if ((format->bmiHeader.biBitCount == 24) || (format->bmiHeader.biBitCount == 32))
{
- int psz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32 ? 4 : 3;
+ int dpsz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32 ? 4 : 3;
+ int spsz = format->bmiHeader.biBitCount == 32 ? 4 : 3;
for (j = 0; j < height; j++)
for (i = 0; i < width; i++)
{
- *(ptr + i*psz + 0 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 0);
- *(ptr + i*psz + 1 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 1);
- *(ptr + i*psz + 2 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 2);
- if (psz == 4)
- *(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF;
+ *(ptr + i*dpsz + 0 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 0);
+ *(ptr + i*dpsz + 1 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 1);
+ *(ptr + i*dpsz + 2 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 2);
+ if (dpsz == 4)
+ *(ptr + i*dpsz + 3 + j * sdesc.u1.lPitch) = 0xFF;
}
}
else
- FIXME("Source size with a depths other than paletted 8 or 32 bits are not yet supported\n");
+ FIXME("Source size with a depths other than 8 (paletted), 24 or 32 bits are not yet supported\n");
}
else
FIXME("Destination depths with a depth other than 24 or 32 bits are not yet supported\n");
@@ -403,14 +404,18 @@
static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
{
VideoRendererImpl *This = (VideoRendererImpl *)iface;
+
TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, This->refCount);
+
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
{
VideoRendererImpl *This = (VideoRendererImpl *)iface;
+
TRACE("(%p/%p)->() Release from %ld\n", This, iface, This->refCount);
+
if (!InterlockedDecrement(&This->refCount))
{
DeleteCriticalSection(&This->csFilter);
More information about the wine-patches
mailing list