[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH 2/7] evr/allocator: Use different buffer implementation for surface buffers.
From: Nikolay Sivov <nsivov () codeweavers ! com>
Date: 2020-10-30 13:50:42
Message-ID: 20201030135047.2929225-2-nsivov () codeweavers ! com
[Download RAW message or body]
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
---
dlls/evr/sample.c | 31 ++++++++++++++++---------------
dlls/evr/tests/evr.c | 6 +-----
2 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/dlls/evr/sample.c b/dlls/evr/sample.c
index b65cc45a662..39520cb6020 100644
--- a/dlls/evr/sample.c
+++ b/dlls/evr/sample.c
@@ -306,27 +306,28 @@ static HRESULT sample_allocator_create_samples(struct \
sample_allocator *allocato for (i = 0; i < sample_count; ++i)
{
struct queued_sample *queued_sample = heap_alloc(sizeof(*queued_sample));
+ IMFMediaBuffer *buffer;
- if (service)
+ if (SUCCEEDED(hr = MFCreateVideoSampleFromSurface(NULL, &sample)))
{
- if (SUCCEEDED(hr = IDirectXVideoProcessorService_CreateSurface(service, \
width, height, 0, format,
- D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, &surface, \
NULL))) + if (service)
{
- hr = MFCreateVideoSampleFromSurface((IUnknown *)surface, &sample);
- IDirect3DSurface9_Release(surface);
+ if (SUCCEEDED(hr = \
IDirectXVideoProcessorService_CreateSurface(service, width, height, + \
0, format, D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, &surface, NULL))) + \
{ + hr = MFCreateDXSurfaceBuffer(&IID_IDirect3DSurface9, (IUnknown \
*)surface, FALSE, &buffer); + IDirect3DSurface9_Release(surface);
+ }
+ }
+ else
+ {
+ hr = MFCreate2DMediaBuffer(width, height, format, FALSE, &buffer);
}
- }
- else
- {
- IMFMediaBuffer *buffer;
- if (SUCCEEDED(hr = MFCreateVideoSampleFromSurface(NULL, &sample)))
+ if (SUCCEEDED(hr))
{
- if (SUCCEEDED(hr = MFCreate2DMediaBuffer(width, height, format, \
FALSE, &buffer)))
- {
- hr = IMFSample_AddBuffer(sample, buffer);
- IMFMediaBuffer_Release(buffer);
- }
+ hr = IMFSample_AddBuffer(sample, buffer);
+ IMFMediaBuffer_Release(buffer);
}
}
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index e4f45396ae8..a711be7ad21 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -1468,17 +1468,13 @@ todo_wine
IDirect3DSurface9_Release(surface);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
- IUnknown_Release(unk);
+ IUnknown_Release(unk);
hr = IMFMediaBuffer_Lock(buffer, &data, NULL, NULL);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFMediaBuffer_Unlock(buffer);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IMFSample_Release(sample);
--
2.28.0
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic