rawvideoparse: did not consider UV tile subsample case in gst_raw_video_parse_update_info()
Describe your issue
When parsing a NV12_16L32S raw video, gstrawvideoparse produces a wrong size video frame to the downstream element. for example, a 320x256 NV12_16L32S raw video, one frame size is 122880 (320x256x1.5), but in gst_raw_video_parse_update_info() it becomes 163840 (320x256x2).
suggestion:
- there is no per-plane w/h in GstVideoFormatInfo
- or it might be calculated by each video format.
Solutions you have tried
- in the calculation last_plane_size of gst_raw_video_parse_update_info() :
if (GST_VIDEO_FORMAT_INFO_IS_TILED (info->finfo)) {
gint stride = GST_VIDEO_INFO_PLANE_STRIDE (info, last_plane);
gint x_tiles = GST_VIDEO_TILE_X_TILES (stride);
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_FORMAT(info->finfo) == GST_VIDEO_FORMAT_NV12_16L32S) {
/* (UV tile_height) is subsampled */
if (last_plane == 1) {
tile_height = tile_height / 2;
}
}
last_plane_size = x_tiles * y_tiles * tile_width * tile_height;
} else {
....
}