v4l2codecs: Port to the new tile size helper
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 12 Apr 2022 16:17:09 +0000 (12:17 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 2 May 2022 19:10:43 +0000 (19:10 +0000)
This will complete the scaling of width/height shift scaling
as only a partial implementation was made.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>

subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c

index 39b64a9..0f5fa30 100644 (file)
@@ -79,14 +79,9 @@ set_stride (GstVideoInfo * info, gint plane, gint stride)
   const GstVideoFormatInfo *finfo = info->finfo;
 
   if (GST_VIDEO_FORMAT_INFO_IS_TILED (finfo)) {
-    gint x_tiles, y_tiles, ws, hs, padded_height;
+    guint x_tiles, y_tiles, ws, hs, padded_height;
 
-    ws = GST_VIDEO_FORMAT_INFO_TILE_WS (finfo);
-    hs = GST_VIDEO_FORMAT_INFO_TILE_HS (finfo);
-
-    /* this only works for what we support, NV12 subsampled tiles */
-    if (GST_VIDEO_FORMAT_INFO_HAS_SUBTILES (finfo) && plane == 1)
-      hs -= 1;
+    gst_video_format_info_get_tile_sizes (finfo, plane, &ws, &hs);
 
     padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane,
         info->height);