d3dvideosink: Fix calculating buffer size of packed format

The Pitch (i.e., stride) of D3DLOCKED_RECT structure is already
respecting required stride value.
This commit is contained in:
Seungha Yang 2018-11-06 20:14:32 +09:00 committed by Sebastian Dröge
parent 6c6d351665
commit f4dc780168

View file

@ -529,29 +529,17 @@ d3d_calculate_buffer_size (GstVideoInfo * info, D3DLOCKED_RECT * lr,
{
switch (GST_VIDEO_INFO_FORMAT (info)) {
case GST_VIDEO_FORMAT_BGR:
offset[0] = 0;
stride[0] = lr->Pitch;
*size = lr->Pitch * GST_VIDEO_INFO_HEIGHT (info) * 3;
break;
case GST_VIDEO_FORMAT_BGRx:
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_RGBA:
offset[0] = 0;
stride[0] = lr->Pitch;
*size = lr->Pitch * GST_VIDEO_INFO_HEIGHT (info) * 4;
break;
case GST_VIDEO_FORMAT_RGB16:
case GST_VIDEO_FORMAT_RGB15:
offset[0] = 0;
stride[0] = lr->Pitch;
*size = lr->Pitch * GST_VIDEO_INFO_HEIGHT (info) * 2;
break;
case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_UYVY:
offset[0] = 0;
stride[0] = lr->Pitch;
*size = lr->Pitch * GST_VIDEO_INFO_HEIGHT (info) * 2;
*size = lr->Pitch * GST_VIDEO_INFO_HEIGHT (info);
break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12: