From 4ed3c46de7ad67c020c3cc1e6a7ee579a2391fc9 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 27 Apr 2023 23:49:47 +0900 Subject: [PATCH] cudamemory: Fix for semi planar YUV memory size decision UV plan of the semi planar format requires only half of Y plane size Part-of: --- .../gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp index 26c36eee92..183f0af1a9 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp @@ -915,11 +915,13 @@ gst_cuda_allocator_alloc (GstCudaAllocator * allocator, case GST_VIDEO_FORMAT_I420: case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_I420_10LE: + alloc_height *= 2; + break; case GST_VIDEO_FORMAT_NV12: case GST_VIDEO_FORMAT_NV21: case GST_VIDEO_FORMAT_P010_10LE: case GST_VIDEO_FORMAT_P016_LE: - alloc_height *= 2; + alloc_height += alloc_height / 2; break; case GST_VIDEO_FORMAT_Y42B: case GST_VIDEO_FORMAT_I422_10LE: