Commit d2a30424 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat/allocator: Add support for MF_SA_BUFFERS_PER_SAMPLE.

parent d100d92f
......@@ -1355,12 +1355,15 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
{
allocator->attributes = attributes;
IMFAttributes_AddRef(allocator->attributes);
IMFAttributes_GetUINT32(attributes, &MF_SA_BUFFERS_PER_SAMPLE, &allocator->frame_desc.buffer_count);
}
allocator->frame_desc.d3d9_format = subtype.Data1;
allocator->frame_desc.dxgi_format = MFMapDX9FormatToDXGIFormat(allocator->frame_desc.d3d9_format);
allocator->frame_desc.width = frame_size >> 32;
allocator->frame_desc.height = frame_size;
allocator->frame_desc.buffer_count = max(1, allocator->frame_desc.buffer_count);
if (FAILED(hr = sample_allocator_get_surface_service(allocator, &service)))
return hr;
......@@ -1673,7 +1676,6 @@ HRESULT WINAPI MFCreateVideoSampleAllocatorEx(REFIID riid, void **obj)
object->IMFVideoSampleAllocatorCallback_iface.lpVtbl = &sample_allocator_callback_vtbl;
object->tracking_callback.lpVtbl = &sample_allocator_tracking_callback_vtbl;
object->refcount = 1;
object->frame_desc.buffer_count = 1;
list_init(&object->used_samples);
list_init(&object->free_samples);
InitializeCriticalSection(&object->cs);
......
......@@ -6439,6 +6439,9 @@ todo_wine
hr = IMFAttributes_SetUINT32(attributes, &MF_SA_BUFFERS_PER_SAMPLE, 2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocatorEx_AllocateSample(allocatorex, &sample);
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
EXPECT_REF(attributes, 1);
hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(allocatorex, 0, 0, attributes, video_type);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
......@@ -6454,7 +6457,6 @@ todo_wine
hr = IMFSample_GetBufferCount(sample, &buffer_count);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
todo_wine
ok(buffer_count == 2, "Unexpected buffer count %u.\n", buffer_count);
hr = IMFVideoSampleAllocatorEx_AllocateSample(allocatorex, &sample2);
......
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