Removed support for CVPixelBuffer of type 32RGBA

This commit is contained in:
Prianka Liz Kariat 2023-10-19 19:56:44 +05:30
parent 0fe677b78f
commit 032d7a5d22

View File

@ -120,8 +120,7 @@ static void FreeDataProviderReleaseCallback(void *buffer, const void *data, size
default: { default: {
[MPPCommonUtils createCustomError:error [MPPCommonUtils createCustomError:error
withCode:MPPTasksErrorCodeInvalidArgumentError withCode:MPPTasksErrorCodeInvalidArgumentError
description:@"Invalid source pixel buffer format. Expecting one of " description:@"Some internal error occured."];
@"kCVPixelFormatType_32RGBA, kCVPixelFormatType_32BGRA"];
return nullptr; return nullptr;
} }
} }
@ -149,7 +148,6 @@ static void FreeDataProviderReleaseCallback(void *buffer, const void *data, size
std::unique_ptr<ImageFrame> imageFrame = nullptr; std::unique_ptr<ImageFrame> imageFrame = nullptr;
switch (pixelBufferFormat) { switch (pixelBufferFormat) {
case kCVPixelFormatType_32RGBA:
case kCVPixelFormatType_32BGRA: { case kCVPixelFormatType_32BGRA: {
CVPixelBufferLockBaseAddress(pixelBuffer, 0); CVPixelBufferLockBaseAddress(pixelBuffer, 0);
imageFrame = [MPPPixelDataUtils imageFrame = [MPPPixelDataUtils
@ -165,9 +163,7 @@ static void FreeDataProviderReleaseCallback(void *buffer, const void *data, size
default: { default: {
[MPPCommonUtils createCustomError:error [MPPCommonUtils createCustomError:error
withCode:MPPTasksErrorCodeInvalidArgumentError withCode:MPPTasksErrorCodeInvalidArgumentError
description:@"Unsupported pixel format for CVPixelBuffer. Supported " description:@"Unsupported pixel format for CVPixelBuffer. Supported pixel format is kCVPixelFormatType_32BGRA"];
@"pixel format types are kCVPixelFormatType_32BGRA and "
@"kCVPixelFormatType_32RGBA"];
} }
} }