mfplat: Add MFGetPlaneSize().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
50af05674c
commit
673d984934
@ -1737,10 +1737,7 @@ static int __cdecl uncompressed_video_format_compare(const void *a, const void *
|
|||||||
return memcmp(guid, format->subtype, sizeof(*guid));
|
return memcmp(guid, format->subtype, sizeof(*guid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
static HRESULT mf_get_image_size(REFGUID subtype, unsigned int width, unsigned int height, unsigned int *size)
|
||||||
* MFCalculateImageSize (mfplat.@)
|
|
||||||
*/
|
|
||||||
HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height, UINT32 *size)
|
|
||||||
{
|
{
|
||||||
static const struct uncompressed_video_format video_formats[] =
|
static const struct uncompressed_video_format video_formats[] =
|
||||||
{
|
{
|
||||||
@ -1755,8 +1752,6 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height
|
|||||||
};
|
};
|
||||||
struct uncompressed_video_format *format;
|
struct uncompressed_video_format *format;
|
||||||
|
|
||||||
TRACE("%s, %u, %u, %p.\n", debugstr_mf_guid(subtype), width, height, size);
|
|
||||||
|
|
||||||
format = bsearch(subtype, video_formats, ARRAY_SIZE(video_formats), sizeof(*video_formats),
|
format = bsearch(subtype, video_formats, ARRAY_SIZE(video_formats), sizeof(*video_formats),
|
||||||
uncompressed_video_format_compare);
|
uncompressed_video_format_compare);
|
||||||
if (format)
|
if (format)
|
||||||
@ -1771,6 +1766,31 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height
|
|||||||
return format ? S_OK : E_INVALIDARG;
|
return format ? S_OK : E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MFCalculateImageSize (mfplat.@)
|
||||||
|
*/
|
||||||
|
HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height, UINT32 *size)
|
||||||
|
{
|
||||||
|
TRACE("%s, %u, %u, %p.\n", debugstr_mf_guid(subtype), width, height, size);
|
||||||
|
|
||||||
|
return mf_get_image_size(subtype, width, height, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MFGetPlaneSize (mfplat.@)
|
||||||
|
*/
|
||||||
|
HRESULT WINAPI MFGetPlaneSize(DWORD format, DWORD width, DWORD height, DWORD *size)
|
||||||
|
{
|
||||||
|
GUID subtype;
|
||||||
|
|
||||||
|
TRACE("%#x, %u, %u, %p.\n", format, width, height, size);
|
||||||
|
|
||||||
|
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype));
|
||||||
|
subtype.Data1 = format;
|
||||||
|
|
||||||
|
return mf_get_image_size(&subtype, width, height, size);
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* MFCompareFullToPartialMediaType (mfplat.@)
|
* MFCompareFullToPartialMediaType (mfplat.@)
|
||||||
*/
|
*/
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
@ stub MFGetConfigurationString
|
@ stub MFGetConfigurationString
|
||||||
@ stub MFGetMFTMerit
|
@ stub MFGetMFTMerit
|
||||||
@ stub MFGetNumericNameFromSockaddr
|
@ stub MFGetNumericNameFromSockaddr
|
||||||
@ stub MFGetPlaneSize
|
@ stdcall MFGetPlaneSize(long long long ptr)
|
||||||
@ stub MFGetPlatform
|
@ stub MFGetPlatform
|
||||||
@ stdcall MFGetPluginControl(ptr)
|
@ stdcall MFGetPluginControl(ptr)
|
||||||
@ stub MFGetPrivateWorkqueues
|
@ stub MFGetPrivateWorkqueues
|
||||||
|
@ -91,6 +91,7 @@ static HRESULT (WINAPI *pMFTUnregisterLocalByCLSID)(CLSID clsid);
|
|||||||
static HRESULT (WINAPI *pMFAllocateWorkQueueEx)(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue);
|
static HRESULT (WINAPI *pMFAllocateWorkQueueEx)(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue);
|
||||||
static HRESULT (WINAPI *pMFTEnumEx)(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type,
|
static HRESULT (WINAPI *pMFTEnumEx)(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type,
|
||||||
const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate, UINT32 *count);
|
const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate, UINT32 *count);
|
||||||
|
static HRESULT (WINAPI *pMFGetPlaneSize)(DWORD format, DWORD width, DWORD height, DWORD *size);
|
||||||
|
|
||||||
static const WCHAR fileschemeW[] = L"file://";
|
static const WCHAR fileschemeW[] = L"file://";
|
||||||
|
|
||||||
@ -662,6 +663,7 @@ static void init_functions(void)
|
|||||||
X(MFCreateSourceResolver);
|
X(MFCreateSourceResolver);
|
||||||
X(MFCreateMFByteStreamOnStream);
|
X(MFCreateMFByteStreamOnStream);
|
||||||
X(MFCreateTransformActivate);
|
X(MFCreateTransformActivate);
|
||||||
|
X(MFGetPlaneSize);
|
||||||
X(MFHeapAlloc);
|
X(MFHeapAlloc);
|
||||||
X(MFHeapFree);
|
X(MFHeapFree);
|
||||||
X(MFPutWaitingWorkItem);
|
X(MFPutWaitingWorkItem);
|
||||||
@ -3184,6 +3186,9 @@ static void test_MFCalculateImageSize(void)
|
|||||||
UINT32 size;
|
UINT32 size;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!pMFGetPlaneSize)
|
||||||
|
win_skip("MFGetPlaneSize() is not available.\n");
|
||||||
|
|
||||||
size = 1;
|
size = 1;
|
||||||
hr = MFCalculateImageSize(&IID_IUnknown, 1, 1, &size);
|
hr = MFCalculateImageSize(&IID_IUnknown, 1, 1, &size);
|
||||||
ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#x.\n", hr);
|
ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#x.\n", hr);
|
||||||
@ -3200,6 +3205,15 @@ static void test_MFCalculateImageSize(void)
|
|||||||
ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#x.\n", i, hr);
|
ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#x.\n", i, hr);
|
||||||
ok(size == image_size_tests[i].size, "%u: unexpected image size %u, expected %u.\n", i, size,
|
ok(size == image_size_tests[i].size, "%u: unexpected image size %u, expected %u.\n", i, size,
|
||||||
image_size_tests[i].size);
|
image_size_tests[i].size);
|
||||||
|
|
||||||
|
if (pMFGetPlaneSize)
|
||||||
|
{
|
||||||
|
hr = pMFGetPlaneSize(image_size_tests[i].subtype->Data1, image_size_tests[i].width, image_size_tests[i].height,
|
||||||
|
&size);
|
||||||
|
ok(hr == S_OK, "%u: failed to get plane size, hr %#x.\n", i, hr);
|
||||||
|
ok(size == image_size_tests[i].size, "%u: unexpected plane size %u, expected %u.\n", i, size,
|
||||||
|
image_size_tests[i].size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,6 +421,7 @@ void * WINAPI MFHeapAlloc(SIZE_T size, ULONG flags, char *file, int line, EAllo
|
|||||||
void WINAPI MFHeapFree(void *ptr);
|
void WINAPI MFHeapFree(void *ptr);
|
||||||
HRESULT WINAPI MFGetAttributesAsBlob(IMFAttributes *attributes, UINT8 *buffer, UINT size);
|
HRESULT WINAPI MFGetAttributesAsBlob(IMFAttributes *attributes, UINT8 *buffer, UINT size);
|
||||||
HRESULT WINAPI MFGetAttributesAsBlobSize(IMFAttributes *attributes, UINT32 *size);
|
HRESULT WINAPI MFGetAttributesAsBlobSize(IMFAttributes *attributes, UINT32 *size);
|
||||||
|
HRESULT WINAPI MFGetPlaneSize(DWORD format, DWORD width, DWORD height, DWORD *size);
|
||||||
HRESULT WINAPI MFGetTimerPeriodicity(DWORD *periodicity);
|
HRESULT WINAPI MFGetTimerPeriodicity(DWORD *periodicity);
|
||||||
HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
|
HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
|
||||||
MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes,
|
MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user