Commit 6d1fc909 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

mfplat/buffer: Use the appropriate image copy function for NV11.

parent 399cec1b
......@@ -1336,13 +1336,23 @@ static HRESULT create_1d_buffer(DWORD max_length, DWORD alignment, IMFMediaBuffe
static p_copy_image_func get_2d_buffer_copy_func(DWORD fourcc)
{
if (fourcc == MAKEFOURCC('N','V','1','2'))
return copy_image_nv12;
if (fourcc == MAKEFOURCC('I','M','C','1') || fourcc == MAKEFOURCC('I','M','C','3'))
return copy_image_imc1;
if (fourcc == MAKEFOURCC('I','M','C','2') || fourcc == MAKEFOURCC('I','M','C','4'))
return copy_image_imc2;
return NULL;
switch (fourcc)
{
case MAKEFOURCC('I','M','C','1'):
case MAKEFOURCC('I','M','C','3'):
return copy_image_imc1;
case MAKEFOURCC('I','M','C','2'):
case MAKEFOURCC('I','M','C','4'):
case MAKEFOURCC('N','V','1','1'):
return copy_image_imc2;
case MAKEFOURCC('N','V','1','2'):
return copy_image_nv12;
default:
return NULL;
}
}
static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bottom_up, IMFMediaBuffer **buffer)
......
......@@ -6171,6 +6171,7 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','2'):
case MAKEFOURCC('I','M','C','4'):
case MAKEFOURCC('N','V','1','1'):
ok(stride * 3 / 2 * ptr->height <= length2, "Insufficient buffer space: expected at least %lu bytes, got only %lu\n",
stride * 3 / 2 * ptr->height, length2);
for (j = 0; j < ptr->height; j++)
......@@ -6221,6 +6222,7 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','2'):
case MAKEFOURCC('I','M','C','4'):
case MAKEFOURCC('N','V','1','1'):
for (j = 0; j < ptr->height; j++)
for (k = 0; k < stride / 2; k++)
ok(data[j * (pitch / 2) + k] == (((j + ptr->height) % 16) << 4) + (k % 16),
......
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