From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/ddrawstream.c | 6 ++++++ dlls/amstream/tests/amstream.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 3c28a0f32e5..927014efc04 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -557,6 +557,9 @@ static void set_mt_from_desc(AM_MEDIA_TYPE *mt, const DDSURFACEDESC *format) { VIDEOINFO *videoinfo = CoTaskMemAlloc(sizeof(VIDEOINFO));
+ memset(mt, 0, sizeof(*mt)); + mt->majortype = MEDIATYPE_Video; + mt->formattype = FORMAT_VideoInfo; mt->cbFormat = sizeof(VIDEOINFO); mt->pbFormat = (BYTE *)videoinfo;
@@ -570,6 +573,9 @@ static void set_mt_from_desc(AM_MEDIA_TYPE *mt, const DDSURFACEDESC *format) videoinfo->bmiHeader.biSizeImage = align(format->dwWidth * format->dwHeight * format->ddpfPixelFormat.dwRGBBitCount / 8, 4);
+ mt->lSampleSize = videoinfo->bmiHeader.biSizeImage; + mt->bFixedSizeSamples = TRUE; + if (format->ddpfPixelFormat.dwRGBBitCount == 16 && format->ddpfPixelFormat.dwRBitMask == 0x7c00) { mt->subtype = MEDIASUBTYPE_RGB555; diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 9bef6e3f0b4..e4a55475005 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -1204,11 +1204,10 @@ static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDI ok(IsEqualGUID(&mt->majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&mt->majortype)); ok(IsEqualGUID(&mt->subtype, &filter->query_accept_subtype), "Expected subtype %s, got %s.\n", debugstr_guid(&filter->query_accept_subtype), debugstr_guid(&mt->subtype)); - todo_wine ok(mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", mt->bFixedSizeSamples); + ok(mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", mt->bFixedSizeSamples); ok(!mt->bTemporalCompression, "Got temporal compression %d.\n", mt->bTemporalCompression); - todo_wine_if (expect_video_info.bmiHeader.biSizeImage) - ok(mt->lSampleSize == expect_video_info.bmiHeader.biSizeImage, - "Expected sample size %lu, got %lu.\n", expect_video_info.bmiHeader.biSizeImage, mt->lSampleSize); + ok(mt->lSampleSize == expect_video_info.bmiHeader.biSizeImage, + "Expected sample size %lu, got %lu.\n", expect_video_info.bmiHeader.biSizeImage, mt->lSampleSize); ok(IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo), "Got format type %s.\n", debugstr_guid(&mt->formattype)); ok(!mt->pUnk, "Got pUnk %p.\n", mt->pUnk); @@ -8856,7 +8855,7 @@ static void test_ddrawstream_mem_allocator(void) "Got major type %s.\n", debugstr_guid(&sample_mt->majortype)); ok(IsEqualGUID(&sample_mt->subtype, &MEDIASUBTYPE_RGB555), "Got subtype %s.\n", debugstr_guid(&sample_mt->subtype)); - todo_wine ok(sample_mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", sample_mt->bFixedSizeSamples); + ok(sample_mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", sample_mt->bFixedSizeSamples); ok(!sample_mt->bTemporalCompression, "Got temporal compression %d.\n", sample_mt->bTemporalCompression); todo_wine ok(sample_mt->lSampleSize == expect_pitch * 444, "Expected sample size %u, got %lu.\n", expect_pitch * 444, sample_mt->lSampleSize); @@ -9107,9 +9106,9 @@ static void test_ddrawstream_mem_allocator(void) "Got major type %s.\n", debugstr_guid(&sample_mt->majortype)); ok(IsEqualGUID(&sample_mt->subtype, &MEDIASUBTYPE_RGB32), "Got subtype %s.\n", debugstr_guid(&sample_mt->subtype)); - todo_wine ok(sample_mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", sample_mt->bFixedSizeSamples); + ok(sample_mt->bFixedSizeSamples == TRUE, "Got fixed size %d.\n", sample_mt->bFixedSizeSamples); ok(!sample_mt->bTemporalCompression, "Got temporal compression %d.\n", sample_mt->bTemporalCompression); - todo_wine ok(sample_mt->lSampleSize == 222 * 555 * 4, + ok(sample_mt->lSampleSize == 222 * 555 * 4, "Expected sample size %u, got %lu.\n", 222 * 555 * 4, sample_mt->lSampleSize); ok(IsEqualGUID(&sample_mt->formattype, &FORMAT_VideoInfo), "Got format type %s.\n", debugstr_guid(&sample_mt->formattype));