windowscodecs: Implement DdsEncoder_CreateNewFrame on top of DdsEncoder_Dds_CreateNewFrame.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com> Signed-off-by: Esme Povirk <esme@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bd609f5ed4
commit
8a54803c4a
|
@ -2043,39 +2043,10 @@ static HRESULT WINAPI DdsEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
|
|||
IWICBitmapFrameEncode **frameEncode, IPropertyBag2 **encoderOptions)
|
||||
{
|
||||
DdsEncoder *This = impl_from_IWICBitmapEncoder(iface);
|
||||
DdsFrameEncode *result;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%p,%p)\n", iface, frameEncode, encoderOptions);
|
||||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if (!This->stream)
|
||||
{
|
||||
hr = WINCODEC_ERR_WRONGSTATE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
result = HeapAlloc(GetProcessHeap(), 0, sizeof(*result));
|
||||
if (!result)
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto end;
|
||||
}
|
||||
|
||||
result->IWICBitmapFrameEncode_iface.lpVtbl = &DdsFrameEncode_Vtbl;
|
||||
result->ref = 1;
|
||||
result->parent = This;
|
||||
result->initialized = FALSE;
|
||||
result->frame_created = FALSE;
|
||||
IWICBitmapEncoder_AddRef(iface);
|
||||
|
||||
*frameEncode = &result->IWICBitmapFrameEncode_iface;
|
||||
hr = S_OK;
|
||||
|
||||
end:
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return hr;
|
||||
return IWICDdsEncoder_CreateNewFrame(&This->IWICDdsEncoder_iface, frameEncode, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DdsEncoder_Commit(IWICBitmapEncoder *iface)
|
||||
|
|
|
@ -1431,15 +1431,11 @@ static void test_dds_encoder_create_frame(void)
|
|||
hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame0, NULL);
|
||||
ok(hr == S_OK, "CreateNewFrame failed, hr %#x\n", hr);
|
||||
hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
|
||||
todo_wine
|
||||
ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#x\n", hr);
|
||||
if (hr == S_OK) IWICBitmapFrameEncode_Release(frame1);
|
||||
|
||||
IWICBitmapFrameEncode_Release(frame0);
|
||||
hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
|
||||
todo_wine
|
||||
ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#x\n", hr);
|
||||
if (hr == S_OK) IWICBitmapFrameEncode_Release(frame1);
|
||||
|
||||
release_encoder(encoder, dds_encoder, stream);
|
||||
|
||||
|
|
Loading…
Reference in New Issue