rawvideoparse: Fix support for sub-sampled tile
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 10 Nov 2022 14:49:41 +0000 (09:49 -0500)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 11 Nov 2022 11:02:15 +0000 (11:02 +0000)
This element was missed as it does not use the new helpers to calculate the
plane size. The code is relatively simple though, so adding support for
subsample tiles was easy enough.

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

subprojects/gst-plugins-base/gst/rawparse/gstrawvideoparse.c

index ab0fa65..043af01 100644 (file)
@@ -1163,6 +1163,10 @@ gst_raw_video_parse_update_info (GstRawVideoParseConfig * config)
     gint y_tiles = GST_VIDEO_TILE_Y_TILES (stride);
     gint tile_width = 1 << GST_VIDEO_FORMAT_INFO_TILE_WS (info->finfo);
     gint tile_height = 1 << GST_VIDEO_FORMAT_INFO_TILE_HS (info->finfo);
+
+    if (GST_VIDEO_FORMAT_INFO_HAS_SUBTILES (info->finfo))
+      tile_height /= 2;
+
     last_plane_size = x_tiles * y_tiles * tile_width * tile_height;
   } else {
     gint comp[GST_VIDEO_MAX_COMPONENTS];