I am reading the buffer of a frame of a nvarguscamerasrc into an NvBufSurface in order to work with it, but I cannot explain some of the values that are set in the object attributes.
The are the attributes I read from the object
Batch Size: 1
Num Filled: 1
Is contiguous: 0
Mem type: 4
Buffer descriptor 1063
Width: 3264, Height: 2464
Data size: 12451840
Color format: 6 (NV12)
Number of planes: 2
Width plane 0: 3264, Height plane 0: 2464
Width plane 1: 1632, Height plane 1: 1232
Byte per pixel plane 0: 1, Byte per pixel plane 1: 2
pitch plane 0: 3328 bytes, pitch plane 1 : 3328 bytes
offset plane 0 (Y): 0 bytes, offset plane 1 (UV): 8257536 bytes
size plane 0 (Y): 8257536, size plane 1 (UV): 4194304
How is the size of the planes calculated?
For plane 0 (Y) with one byte per pixel I would have calculated it with:
size = Width * pitch + Height = 3264 * 3328 + 2464 = 10865056
Which is neither the size of plane 0 nor the total size.
Where does the pitch come into play?
How is total size and plane size calculated?