Commit 26d5d384 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr: Implement sample allocator.

parent 77d1701b
......@@ -1338,13 +1338,14 @@ static void test_MFCreateVideoSampleAllocator(void)
ok(!count, "Unexpected count %d.\n", count);
hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
todo_wine
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
......@@ -1356,42 +1357,34 @@ todo_wine
video_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type);
todo_wine
ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
/* Frame size is required. */
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
todo_wine
ok(count == 1, "Unexpected count %d.\n", count);
sample = NULL;
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr))
ok(get_refcount(sample) == 3, "Unexpected refcount %u.\n", get_refcount(sample));
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2);
todo_wine
ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr);
/* Reinitialize with active sample. */
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (sample)
todo_wine
ok(get_refcount(sample) == 3, "Unexpected refcount %u.\n", get_refcount(sample));
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
todo_wine
ok(count == 4, "Unexpected count %d.\n", count);
if (sample)
......@@ -1418,6 +1411,10 @@ todo_wine
IMFGetService_Release(gs);
}
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
IMFMediaBuffer_Release(buffer);
IMFSample_Release(sample);
......
......@@ -3381,7 +3381,6 @@ static void test_evr(void)
ok(!sample_count, "Unexpected sample count %d.\n", sample_count);
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
todo_wine
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
IMFVideoSampleAllocatorCallback_Release(allocator_callback);
......
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