d3d11converter: Simplify private struct ctor

Initialize transform matrix using memcpy

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5580>
This commit is contained in:
Seungha Yang 2023-11-01 01:32:27 +09:00 committed by GStreamer Marge Bot
parent e134cd8e09
commit 0e9fdabb1b

View file

@ -264,16 +264,8 @@ struct _GstD3D11ConverterPrivate
{ {
_GstD3D11ConverterPrivate () _GstD3D11ConverterPrivate ()
{ {
for (guint i = 0; i < 4; i++) G_STATIC_ASSERT (sizeof (custom_transform) == sizeof (g_matrix_identity));
{ memcpy (custom_transform, g_matrix_identity, sizeof (g_matrix_identity));
for (guint j = 0; j < 4; j++)
{
if (i == j)
custom_transform[i * 4 + j] = 1.0;
else
custom_transform[i * 4 + j] = 0.0;
}
}
} }
~_GstD3D11ConverterPrivate () ~_GstD3D11ConverterPrivate ()