Make window uses black brush for background.

Check format type of video stream.
This commit is contained in:
Christian Costa 2005-10-10 10:44:54 +00:00 committed by Alexandre Julliard
parent dd3d1e389a
commit b82d94e4f1

View File

@ -148,7 +148,7 @@ static BOOL CreateRenderingWindow(VideoRendererImpl* This)
winclass.hInstance = NULL; winclass.hInstance = NULL;
winclass.hIcon = NULL; winclass.hIcon = NULL;
winclass.hCursor = NULL; winclass.hCursor = NULL;
winclass.hbrBackground = NULL; winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL; winclass.lpszMenuName = NULL;
winclass.lpszClassName = "Wine ActiveMovie Class"; winclass.lpszClassName = "Wine ActiveMovie Class";
@ -391,13 +391,22 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt) static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
{ {
if ((IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32)) || if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
(IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24)) || return S_FALSE;
(IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565)) ||
(IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))) if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
{ {
VideoRendererImpl* This = (VideoRendererImpl*) iface; VideoRendererImpl* This = (VideoRendererImpl*) iface;
VIDEOINFOHEADER* format = (VIDEOINFOHEADER*)pmt->pbFormat; VIDEOINFOHEADER* format = (VIDEOINFOHEADER*)pmt->pbFormat;
if (!IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
{
WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
return S_FALSE;
}
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;