I am using the Accelerate Framework to convert YUV Data to ARGB Data for a Video Call App. The framework works great, However when I hold calls I use a place holder image sent from the server. That image causes issues sometimes because of its size. Accelerate is telling me that it's range of interest is larger than the input buffer(roiLargerThanInputBuffer). I am not sure exactly how to address this issue. Any thoughts or suggestions would be greatly appreciated.
The problem was that my video buffer stream's pixel buffer width and height changed from the server side. That being said all that needed to be done is to check for when it changes and then remove the current vImage_buffer from memory and reinitialize a new one with the correct size.
Is it proper to tell the accelerate framework to change the vImage_buffer width and height this way. It seems to work well.
if myBuffer.height != destinationBuffer.height {
free(destinationBuffer.data)
error = vImageBuffer_Init(&destinationBuffer,
vImagePixelCount(myBuffer.height),
vImagePixelCount(myBuffer.height),
cgImageFormat.bitsPerPixel,
vImage_Flags(kvImageNoFlags))
guard error == kvImageNoError else {
return nil
}
}
Thanks