Commit 5182f707 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Fixed MediaSample passing. This is the upstream filter that releases

it. Set ppMediaType to NULL when returning S_FALSE in IMediaSample_GetMediaType (required by native Quartz dll). Added support for 32-bit depth source in video renderer.
parent 405abd5b
......@@ -124,10 +124,7 @@ static DWORD AVIDec_SendSampleData(AVIDecImpl* This, LPBYTE data, DWORD size)
goto error;
}
return S_OK;
error:
/* If we have a sample that has not been delivered, release it */
if (pSample)
IMediaSample_Release(pSample);
......@@ -174,9 +171,6 @@ static HRESULT AVIDec_Sample(LPVOID iface, IMediaSample * pSample)
AVIDec_SendSampleData(This, pbSrcStream, cbSrcStream);
/* We have finished with the incoming sample, we must release it now */
IMediaSample_Release(pSample);
return S_OK;
}
......
......@@ -680,8 +680,7 @@ static HRESULT AVISplitter_Sample(LPVOID iface, IMediaSample * pSample)
ERR("Error sending sample (%lx)\n", hr);
}
/* If we have a sample that has not been delivered, release it */
if (FAILED(hr) && This->pCurrentSample)
if (This->pCurrentSample)
IMediaSample_Release(This->pCurrentSample);
This->pCurrentSample = NULL;
......
......@@ -184,7 +184,7 @@ static DWORD DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data, DW
ERR("Unable to lock sound buffer !\n");
break;
}
TRACE("write_pos=%ld, size=%ld, sz1=%ld, sz2=%ld\n", This->write_pos, size2, dwsize1, dwsize2);
/* TRACE("write_pos=%ld, size=%ld, sz1=%ld, sz2=%ld\n", This->write_pos, size2, dwsize1, dwsize2); */
memcpy(lpbuf1, data, dwsize1);
if (dwsize2) {
......@@ -261,9 +261,6 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample)
}
DSoundRender_SendSampleData(This, pbSrcStream, cbSrcStream);
/* We have finished with the incoming sample, we must release it now */
IMediaSample_Release(pSample);
return S_OK;
}
......
......@@ -140,7 +140,7 @@ static ULONG WINAPI BaseMemAllocator_AddRef(IMemAllocator * iface)
{
BaseMemAllocator *This = (BaseMemAllocator *)iface;
TRACE("()\n");
TRACE("(%p)->() AddRef from %ld\n", iface, This->ref);
return InterlockedIncrement(&This->ref);
}
......@@ -149,7 +149,7 @@ static ULONG WINAPI BaseMemAllocator_Release(IMemAllocator * iface)
{
BaseMemAllocator *This = (BaseMemAllocator *)iface;
TRACE("()\n");
TRACE("(%p)->() Release from %ld\n", iface, This->ref);
if (!InterlockedDecrement(&This->ref))
{
......@@ -634,8 +634,12 @@ static HRESULT WINAPI StdMediaSample2_GetMediaType(IMediaSample2 * iface, AM_MED
TRACE("(%p)\n", ppMediaType);
if (!This->props.pMediaType)
if (!This->props.pMediaType) {
/* Make sure we return a NULL pointer (required by native Quartz dll) */
if (ppMediaType)
*ppMediaType = NULL;
return S_FALSE;
}
if (!(*ppMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
return E_OUTOFMEMORY;
......
......@@ -222,8 +222,21 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data,
*(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF;
}
}
else if (format->bmiHeader.biBitCount == 32)
{
int psz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 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;
}
}
else
FIXME("Source size with a depths other than paletted 8 bits are not yet supported\n");
FIXME("Source size with a depths other than paletted 8 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");
......@@ -293,9 +306,6 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
/* We have finished with the incoming sample, we must release it now */
IMediaSample_Release(pSample);
return S_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment