Commit 4c23814c authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Support negative heights in video renderer.

parent a489489e
...@@ -82,8 +82,8 @@ typedef struct VideoRendererImpl ...@@ -82,8 +82,8 @@ typedef struct VideoRendererImpl
RECT SourceRect; RECT SourceRect;
RECT DestRect; RECT DestRect;
RECT WindowPos; RECT WindowPos;
long VideoWidth; LONG VideoWidth;
long VideoHeight; LONG VideoHeight;
IUnknown * pUnkOuter; IUnknown * pUnkOuter;
BOOL bUnkOuterValid; BOOL bUnkOuterValid;
BOOL bAggregatable; BOOL bAggregatable;
...@@ -287,7 +287,6 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, ...@@ -287,7 +287,6 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data,
return VFW_E_RUNTIME_ERROR; return VFW_E_RUNTIME_ERROR;
} }
TRACE("biSize = %d\n", bmiHeader->biSize); TRACE("biSize = %d\n", bmiHeader->biSize);
TRACE("biWidth = %d\n", bmiHeader->biWidth); TRACE("biWidth = %d\n", bmiHeader->biWidth);
TRACE("biHeight = %d\n", bmiHeader->biHeight); TRACE("biHeight = %d\n", bmiHeader->biHeight);
...@@ -483,6 +482,7 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt ...@@ -483,6 +482,7 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt
IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8)) IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
{ {
VideoRendererImpl* This = iface; VideoRendererImpl* This = iface;
LONG height;
if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
{ {
...@@ -490,7 +490,11 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt ...@@ -490,7 +490,11 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt
This->SourceRect.left = 0; This->SourceRect.left = 0;
This->SourceRect.top = 0; This->SourceRect.top = 0;
This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth; 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)) else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
{ {
...@@ -499,7 +503,11 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt ...@@ -499,7 +503,11 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt
This->SourceRect.left = 0; This->SourceRect.left = 0;
This->SourceRect.top = 0; This->SourceRect.top = 0;
This->SourceRect.right = This->VideoWidth = format2->bmiHeader.biWidth; 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 else
{ {
......
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