From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/tests/amstream.c | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 1f0cf7f7017..6f628dea7b7 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -5653,20 +5653,24 @@ static void test_ddrawstream_set_format(void) .ddpfPixelFormat.u4.dwBBitMask = 0x03, };
+ IDirectDrawStreamSample *sample, *sample2; IDirectDrawMediaStream *ddraw_stream; VIDEOINFOHEADER *video_info_ptr; IAMMultiMediaStream *mmstream; DDSURFACEDESC current_format; DDSURFACEDESC desired_format; + IDirectDrawSurface *surface; struct testfilter source; IGraphBuilder *graph; DDSURFACEDESC format; IMediaStream *stream; VIDEOINFO video_info; + IDirectDraw *ddraw; AM_MEDIA_TYPE mt; HRESULT hr; ULONG ref; IPin *pin; + RECT rect;
mmstream = create_ammultimediastream();
@@ -5783,6 +5787,9 @@ static void test_ddrawstream_set_format(void)
source.preferred_mt = NULL;
+ /* amstream reconnects with a NULL media type. It doesn't enumerate the + * only format it'll accept, and we don't enumerate it either, so we fail + * to connect with that format here. */ hr = IDirectDrawMediaStream_SetFormat(ddraw_stream, &rgb555_format, NULL); ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr); ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB8), @@ -5801,6 +5808,8 @@ static void test_ddrawstream_set_format(void) ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB8), "Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype));
+ /* Now enumerate the corresponding target media type, and we can set + * that format. */ source.preferred_mt = &rgb555_mt;
hr = IDirectDrawMediaStream_SetFormat(ddraw_stream, &rgb8_format, NULL); @@ -5848,6 +5857,83 @@ static void test_ddrawstream_set_format(void) ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -555, "Got height %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight);
+ /* Test with CreateSample() instead of SetFormat(). */ + + hr = IDirectDrawMediaStream_GetDirectDraw(ddraw_stream, &ddraw); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + /* As above, this fails because amstream wants to reconnect with an RGB24 + * format, but doesn't enumerate that format, and we don't either. */ + format = rgb24_format; + format.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT; + format.dwWidth = 333; + format.dwHeight = 444; + hr = IDirectDraw_CreateSurface(ddraw, &format, &surface, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, NULL, 0, &sample); + todo_wine ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr); + + /* Offer RGB24, and now we can reconnect. */ + video_info = rgb24_video_info; + video_info.bmiHeader.biWidth = 333; + video_info.bmiHeader.biHeight = -444; + mt = rgb24_mt; + mt.pbFormat = (BYTE *)&video_info; + source.preferred_mt = &mt; + + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, NULL, 0, &sample); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + sample = NULL; + todo_wine ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), + "Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype)); + todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 333, + "Got width %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth); + todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -444, + "Got height %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight); + + hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, ¤t_format, NULL, &desired_format, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(current_format.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT), + "Got flags %#lx.\n", current_format.dwFlags); + todo_wine ok(current_format.dwWidth == 333, "Got width %ld.\n", current_format.dwWidth); + todo_wine ok(current_format.dwHeight == 444, "Got height %ld.\n", current_format.dwHeight); + todo_wine ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, + "Got rgb bit count %lu.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount); + ok(desired_format.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT), + "Got flags %#lx.\n", desired_format.dwFlags); + todo_wine ok(desired_format.dwWidth == 333, "Got width %ld.\n", desired_format.dwWidth); + todo_wine ok(desired_format.dwHeight == 444, "Got height %ld.\n", desired_format.dwHeight); + todo_wine ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, + "Got rgb bit count %lu.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount); + + SetRect(&rect, 100, 200, 300, 400); + + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample2); + ok(hr == MS_E_SAMPLEALLOC, "Got hr %#lx.\n", hr); + + if (sample) + IDirectDrawStreamSample_Release(sample); + + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample); + todo_wine ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr); + + video_info.bmiHeader.biWidth = 200; + video_info.bmiHeader.biHeight = -200; + + hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr == S_OK) + IDirectDrawStreamSample_Release(sample); + todo_wine ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), + "Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype)); + todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 200, + "Got width %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth); + todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -200, + "Got height %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight); + + IDirectDrawSurface_Release(surface); + hr = IGraphBuilder_Disconnect(graph, &source.source.pin.IPin_iface); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IGraphBuilder_Disconnect(graph, pin); @@ -5858,6 +5944,7 @@ static void test_ddrawstream_set_format(void) ref = IGraphBuilder_Release(graph); ok(!ref, "Got outstanding refcount %ld.\n", ref); IPin_Release(pin); + IDirectDraw_Release(ddraw); IDirectDrawMediaStream_Release(ddraw_stream); ref = IMediaStream_Release(stream); ok(!ref, "Got outstanding refcount %ld.\n", ref);
From: Elizabeth Figura zfigura@codeweavers.com
In that case we will always request a surface with the current width, height, and pixel format, and "rect" must be NULL and cannot affect it. --- dlls/amstream/ddrawstream.c | 50 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 26 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index f8ab333975a..bd0ae962e36 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -2356,6 +2356,30 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw { object->surface = surface; IDirectDrawSurface_AddRef(surface); + + desc.dwSize = sizeof(desc); + if (FAILED(hr = IDirectDrawSurface_GetSurfaceDesc(object->surface, &desc))) + { + IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); + return hr; + } + + if (rect) + { + object->rect = *rect; + desc.dwWidth = rect->right - rect->left; + desc.dwHeight = rect->bottom - rect->top; + } + else + { + SetRect(&object->rect, 0, 0, desc.dwWidth, desc.dwHeight); + } + + if (FAILED(hr = IDirectDrawMediaStream_SetFormat(&parent->IDirectDrawMediaStream_iface, &desc, NULL))) + { + IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); + return hr; + } } else { @@ -2399,32 +2423,6 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw } }
- desc.dwSize = sizeof(desc); - hr = IDirectDrawSurface_GetSurfaceDesc(object->surface, &desc); - if (FAILED(hr)) - { - IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); - return hr; - } - - if (rect) - { - object->rect = *rect; - desc.dwWidth = rect->right - rect->left; - desc.dwHeight = rect->bottom - rect->top; - } - else - { - SetRect(&object->rect, 0, 0, desc.dwWidth, desc.dwHeight); - } - - hr = IDirectDrawMediaStream_SetFormat(&parent->IDirectDrawMediaStream_iface, &desc, NULL); - if (FAILED(hr)) - { - IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); - return hr; - } - *ddraw_stream_sample = &object->IDirectDrawStreamSample_iface;
return S_OK;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/ddrawstream.c | 35 ++++++++++++++--------------- dlls/amstream/tests/amstream.c | 40 +++++++++++++++------------------- 2 files changed, 34 insertions(+), 41 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index bd0ae962e36..a8974a786e7 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -2338,6 +2338,22 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
TRACE("(%p)\n", ddraw_stream_sample);
+ if (surface) + { + desc.dwSize = sizeof(desc); + if (FAILED(hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc))) + return hr; + + if (rect) + { + desc.dwWidth = rect->right - rect->left; + desc.dwHeight = rect->bottom - rect->top; + } + + if (FAILED(hr = IDirectDrawMediaStream_SetFormat(&parent->IDirectDrawMediaStream_iface, &desc, NULL))) + return hr; + } + if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
@@ -2357,29 +2373,10 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw object->surface = surface; IDirectDrawSurface_AddRef(surface);
- desc.dwSize = sizeof(desc); - if (FAILED(hr = IDirectDrawSurface_GetSurfaceDesc(object->surface, &desc))) - { - IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); - return hr; - } - if (rect) - { object->rect = *rect; - desc.dwWidth = rect->right - rect->left; - desc.dwHeight = rect->bottom - rect->top; - } else - { SetRect(&object->rect, 0, 0, desc.dwWidth, desc.dwHeight); - } - - if (FAILED(hr = IDirectDrawMediaStream_SetFormat(&parent->IDirectDrawMediaStream_iface, &desc, NULL))) - { - IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface); - return hr; - } } else { diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 6f628dea7b7..edc48b9d2ec 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -5871,7 +5871,7 @@ static void test_ddrawstream_set_format(void) hr = IDirectDraw_CreateSurface(ddraw, &format, &surface, NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, NULL, 0, &sample); - todo_wine ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr);
/* Offer RGB24, and now we can reconnect. */ video_info = rgb24_video_info; @@ -5882,29 +5882,27 @@ static void test_ddrawstream_set_format(void) source.preferred_mt = &mt;
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, NULL, 0, &sample); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr != S_OK) - sample = NULL; - todo_wine ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), "Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype)); - todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 333, + ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 333, "Got width %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth); - todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -444, + ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -444, "Got height %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight);
hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, ¤t_format, NULL, &desired_format, NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(current_format.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT), "Got flags %#lx.\n", current_format.dwFlags); - todo_wine ok(current_format.dwWidth == 333, "Got width %ld.\n", current_format.dwWidth); - todo_wine ok(current_format.dwHeight == 444, "Got height %ld.\n", current_format.dwHeight); - todo_wine ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, + ok(current_format.dwWidth == 333, "Got width %ld.\n", current_format.dwWidth); + ok(current_format.dwHeight == 444, "Got height %ld.\n", current_format.dwHeight); + ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, "Got rgb bit count %lu.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount); ok(desired_format.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT), "Got flags %#lx.\n", desired_format.dwFlags); - todo_wine ok(desired_format.dwWidth == 333, "Got width %ld.\n", desired_format.dwWidth); - todo_wine ok(desired_format.dwHeight == 444, "Got height %ld.\n", desired_format.dwHeight); - todo_wine ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, + ok(desired_format.dwWidth == 333, "Got width %ld.\n", desired_format.dwWidth); + ok(desired_format.dwHeight == 444, "Got height %ld.\n", desired_format.dwHeight); + ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 24, "Got rgb bit count %lu.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount);
SetRect(&rect, 100, 200, 300, 400); @@ -5912,24 +5910,22 @@ static void test_ddrawstream_set_format(void) hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample2); ok(hr == MS_E_SAMPLEALLOC, "Got hr %#lx.\n", hr);
- if (sample) - IDirectDrawStreamSample_Release(sample); + IDirectDrawStreamSample_Release(sample);
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample); - todo_wine ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got hr %#lx.\n", hr);
video_info.bmiHeader.biWidth = 200; video_info.bmiHeader.biHeight = -200;
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, surface, &rect, 0, &sample); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - IDirectDrawStreamSample_Release(sample); - todo_wine ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirectDrawStreamSample_Release(sample); + ok(IsEqualGUID(&source.source.pin.mt.subtype, &MEDIASUBTYPE_RGB24), "Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype)); - todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 200, + ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth == 200, "Got width %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biWidth); - todo_wine ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -200, + ok(((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight == -200, "Got height %ld.\n", ((VIDEOINFO *)source.source.pin.mt.pbFormat)->bmiHeader.biHeight);
IDirectDrawSurface_Release(surface);
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/ddrawstream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index a8974a786e7..cbd88187e1b 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -1456,6 +1456,7 @@ static HRESULT WINAPI ddraw_mem_allocator_Decommit(IMemAllocator *iface)
EnterCriticalSection(&stream->cs); stream->committed = false; + WakeAllConditionVariable(&stream->allocator_cv); /* We have nothing to actually decommit; all of our samples are created by * CreateSample(). */ LeaveCriticalSection(&stream->cs); @@ -1487,15 +1488,15 @@ static HRESULT WINAPI ddraw_mem_allocator_GetBuffer(IMemAllocator *iface,
EnterCriticalSection(&stream->cs);
+ while (stream->committed && !(sample = get_pending_sample(stream))) + SleepConditionVariableCS(&stream->allocator_cv, &stream->cs, INFINITE); + if (!stream->committed) { LeaveCriticalSection(&stream->cs); return VFW_E_NOT_COMMITTED; }
- while (!(sample = get_pending_sample(stream))) - SleepConditionVariableCS(&stream->allocator_cv, &stream->cs, INFINITE); - sample->surface_desc.dwSize = sizeof(DDSURFACEDESC); if ((FAILED(hr = IDirectDrawSurface_Lock(sample->surface, &sample->rect, &sample->surface_desc, DDLOCK_WAIT, NULL))))
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/audiostream.c | 1 + dlls/amstream/ddrawstream.c | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
diff --git a/dlls/amstream/audiostream.c b/dlls/amstream/audiostream.c index d76156cb682..8e1c96b4b5e 100644 --- a/dlls/amstream/audiostream.c +++ b/dlls/amstream/audiostream.c @@ -960,6 +960,7 @@ static HRESULT WINAPI audio_sink_ReceiveConnection(IPin *iface, IPin *peer, cons PIN_DIRECTION dir;
TRACE("stream %p, peer %p, mt %p.\n", stream, peer, mt); + strmbase_dump_media_type(mt);
if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio) || !IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index cbd88187e1b..40e7fab1e79 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -637,49 +637,83 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr if (format->dwFlags & DDSD_PIXELFORMAT) { if (format->ddpfPixelFormat.dwSize != sizeof(DDPIXELFORMAT)) + { + WARN("Invalid size %#lx, returning DDERR_INVALIDSURFACETYPE.\n", format->ddpfPixelFormat.dwSize); return DDERR_INVALIDSURFACETYPE; + }
if (format->ddpfPixelFormat.dwFlags & DDPF_FOURCC) { if (!format->ddpfPixelFormat.dwRGBBitCount) + { + WARN("Invalid zero bit count, returning E_INVALIDARG.\n"); return E_INVALIDARG; + } } else { if (format->ddpfPixelFormat.dwFlags & (DDPF_YUV | DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2 | DDPF_PALETTEINDEXED4 | DDPF_PALETTEINDEXEDTO8)) + { + WARN("Rejecting flags %#lx.\n", format->ddpfPixelFormat.dwFlags); return DDERR_INVALIDSURFACETYPE; + }
if (!(format->ddpfPixelFormat.dwFlags & DDPF_RGB)) + { + WARN("Rejecting non-RGB flags %#lx.\n", format->ddpfPixelFormat.dwFlags); return DDERR_INVALIDSURFACETYPE; + }
switch (format->ddpfPixelFormat.dwRGBBitCount) { case 8: if (!(format->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8)) + { + WARN("Rejecting non-palettized 8-bit format.\n"); return DDERR_INVALIDSURFACETYPE; + } break; case 16: if (format->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) + { + WARN("Rejecting palettized 16-bit format.\n"); return DDERR_INVALIDSURFACETYPE; + } if ((format->ddpfPixelFormat.dwRBitMask != 0x7c00 || format->ddpfPixelFormat.dwGBitMask != 0x03e0 || format->ddpfPixelFormat.dwBBitMask != 0x001f) && (format->ddpfPixelFormat.dwRBitMask != 0xf800 || format->ddpfPixelFormat.dwGBitMask != 0x07e0 || format->ddpfPixelFormat.dwBBitMask != 0x001f)) + { + WARN("Rejecting bit masks %08lx, %08lx, %08lx.\n", + format->ddpfPixelFormat.dwRBitMask, + format->ddpfPixelFormat.dwGBitMask, + format->ddpfPixelFormat.dwBBitMask); return DDERR_INVALIDSURFACETYPE; + } break; case 24: case 32: if (format->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) + { + WARN("Rejecting palettized %lu-bit format.\n", format->ddpfPixelFormat.dwRGBBitCount); return DDERR_INVALIDSURFACETYPE; + } if (format->ddpfPixelFormat.dwRBitMask != 0xff0000 || format->ddpfPixelFormat.dwGBitMask != 0x00ff00 || format->ddpfPixelFormat.dwBBitMask != 0x0000ff) + { + WARN("Rejecting bit masks %08lx, %08lx, %08lx.\n", + format->ddpfPixelFormat.dwRBitMask, + format->ddpfPixelFormat.dwGBitMask, + format->ddpfPixelFormat.dwBBitMask); return DDERR_INVALIDSURFACETYPE; + } break; default: + WARN("Unknown bit count %lu.\n", format->ddpfPixelFormat.dwRGBBitCount); return DDERR_INVALIDSURFACETYPE; } } @@ -703,6 +737,7 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr
if (stream->sample_refs > 0) { + WARN("Outstanding sample references, returning MS_E_SAMPLEALLOC.\n"); stream->format = old_format; LeaveCriticalSection(&stream->cs); return MS_E_SAMPLEALLOC; @@ -1027,6 +1062,7 @@ static HRESULT WINAPI ddraw_sink_ReceiveConnection(IPin *iface, IPin *peer, cons DDPIXELFORMAT pf = {sizeof(DDPIXELFORMAT)};
TRACE("stream %p, peer %p, mt %p.\n", stream, peer, mt); + strmbase_dump_media_type(mt);
EnterCriticalSection(&stream->cs);
@@ -1394,6 +1430,9 @@ static HRESULT WINAPI ddraw_mem_allocator_SetProperties(IMemAllocator *iface,
TRACE("stream %p, req_props %p, ret_props %p.\n", stream, req_props, ret_props);
+ TRACE("Requested %ld buffers, size %ld, prefix %ld, alignment %ld.\n", + req_props->cBuffers, req_props->cbBuffer, req_props->cbPrefix, req_props->cbAlign); + if (!req_props->cbAlign) return VFW_E_BADALIGN;