Hello everyone.
I'm decoding an H264 elementary stream with VideoToolbox.
The VTDecompressionSession's output callback returns a CVImageBuffer successfully.
While attempting to convert this YUV image to RGB, I prepare a luma vImage_Buffer and chroma vImage_Buffer, but I get strange values from CVPixelBufferGetBytesPerRowOfPlane:
CVPixelBufferGetBaseAddressOfPlane(0) 0x10e98c000
CVPixelBufferGetHeightOfPlane(0) 1080
CVPixelBufferGetWidthOfPlane(0) 1440
CVPixelBufferGetBytesPerRowOfPlane(0) 46080
CVPixelBufferGetBaseAddressOfPlane(1) 0x10eb2b000
CVPixelBufferGetHeightOfPlane(1) 540
CVPixelBufferGetWidthOfPlane(1) 720
CVPixelBufferGetBytesPerRowOfPlane(1) 23040
If I use this value (46080) in initializing the vImage_Buffer's rowBytes field, vImageConvert_420Yp8_CbCr8ToARGB8888 crashes.
If I simply set rowBytes=width, the conversion is successful.
Has anyone seen this before?
Notice the value returned is 32 × width. Why?