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

mfplat: Add a helper to trace video format name.

parent af55f88d
......@@ -642,7 +642,7 @@ HRESULT WINAPI MFCreateAlignedMemoryBuffer(DWORD max_length, DWORD alignment, IM
HRESULT WINAPI MFCreate2DMediaBuffer(DWORD width, DWORD height, DWORD fourcc, BOOL bottom_up, IMFMediaBuffer **buffer)
{
TRACE("%u, %u, %#x, %d, %p.\n", width, height, fourcc, bottom_up, buffer);
TRACE("%u, %u, %s, %d, %p.\n", width, height, debugstr_fourcc(fourcc), bottom_up, buffer);
return create_2d_buffer(width, height, fourcc, bottom_up, buffer);
}
......
......@@ -1510,7 +1510,7 @@ HRESULT WINAPI MFShutdown(void)
*/
HRESULT WINAPI MFCopyImage(BYTE *dest, LONG deststride, const BYTE *src, LONG srcstride, DWORD width, DWORD lines)
{
TRACE("(%p, %d, %p, %d, %u, %u)\n", dest, deststride, src, srcstride, width, lines);
TRACE("%p, %d, %p, %d, %u, %u.\n", dest, deststride, src, srcstride, width, lines);
while (lines--)
{
......
......@@ -19,7 +19,6 @@
#define COBJMACROS
#include "mfplat_private.h"
#include "d3d9types.h"
#include "initguid.h"
#include "ks.h"
......@@ -1837,7 +1836,7 @@ HRESULT WINAPI MFGetStrideForBitmapInfoHeader(DWORD fourcc, DWORD width, LONG *s
struct uncompressed_video_format *format;
GUID subtype;
TRACE("%#x, %u, %p.\n", fourcc, width, stride);
TRACE("%s, %u, %p.\n", debugstr_fourcc(fourcc), width, stride);
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype));
subtype.Data1 = fourcc;
......@@ -1902,7 +1901,7 @@ HRESULT WINAPI MFGetPlaneSize(DWORD fourcc, DWORD width, DWORD height, DWORD *si
unsigned int stride;
GUID subtype;
TRACE("%#x, %u, %u, %p.\n", fourcc, width, height, size);
TRACE("%s, %u, %u, %p.\n", debugstr_fourcc(fourcc), width, height, size);
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype));
subtype.Data1 = fourcc;
......
......@@ -23,6 +23,7 @@
#include "mfapi.h"
#include "mfidl.h"
#include "mferror.h"
#include "d3d9types.h"
#include "wine/heap.h"
#include "wine/debug.h"
......@@ -145,3 +146,39 @@ static inline const char *debugstr_propvar(const PROPVARIANT *v)
return wine_dbg_sprintf("%p {vt %#x}", v, v->vt);
}
}
static inline const char *debugstr_fourcc(DWORD format)
{
static const struct format_name
{
unsigned int format;
const char *name;
} formats[] =
{
{ D3DFMT_R8G8B8, "R8G8B8" },
{ D3DFMT_A8R8G8B8, "A8R8G8B8" },
{ D3DFMT_X8R8G8B8, "X8R8G8B8" },
{ D3DFMT_R5G6B5, "R5G6B5" },
{ D3DFMT_X1R5G5B5, "X1R5G6B5" },
{ D3DFMT_A2B10G10R10, "A2B10G10R10" },
{ D3DFMT_P8, "P8" },
{ D3DFMT_L8, "L8" },
{ D3DFMT_D16, "D16" },
{ D3DFMT_L16, "L16" },
{ D3DFMT_A16B16G16R16F, "A16B16G16R16F" },
};
int i;
if ((format & 0xff) == format)
{
for (i = 0; i < ARRAY_SIZE(formats); ++i)
{
if (formats[i].format == format)
return wine_dbg_sprintf("%s", wine_dbgstr_an(formats[i].name, -1));
}
return wine_dbg_sprintf("%#x", format);
}
return wine_dbgstr_an((char *)&format, 4);
}
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