Add some more test cases for RTCCVPixelBuffer.

Also fix rendering of certain i420 buffers in debug quicklook.

Bug: None
Change-Id: I793915c3a5a1fcb4cd7b24383d1579655e9a7c28
Reviewed-on: https://webrtc-review.googlesource.com/72080
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23005}
This commit is contained in:
Anders Carlsson
2018-04-24 13:49:34 +02:00
committed by Commit Bot
parent 1a759c6354
commit 2efb665e27
2 changed files with 15 additions and 3 deletions

View File

@ -127,9 +127,9 @@
_i420Buffer->DataV(), _i420Buffer->DataV(),
_i420Buffer->StrideV(), _i420Buffer->StrideV(),
ctxData, ctxData,
_i420Buffer->width() * 4, CGBitmapContextGetBytesPerRow(c),
_i420Buffer->width(), CGBitmapContextGetWidth(c),
_i420Buffer->height()); CGBitmapContextGetHeight(c));
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); UIGraphicsEndImageContext();

View File

@ -133,6 +133,18 @@
outputSize:CGSizeMake(0, 0)]; outputSize:CGSizeMake(0, 0)];
} }
- (void)testCropAndScaleToSmallFormat_NV12 {
[self cropAndScaleTestWithNV12InputFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
outputFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
outputSize:CGSizeMake(148, 320)];
}
- (void)testCropAndScaleToOddFormat_NV12 {
[self cropAndScaleTestWithNV12InputFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
outputFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
outputSize:CGSizeMake(361, 640)];
}
- (void)testCropAndScale_32BGRA { - (void)testCropAndScale_32BGRA {
[self cropAndScaleTestWithRGBPixelFormat:kCVPixelFormatType_32BGRA]; [self cropAndScaleTestWithRGBPixelFormat:kCVPixelFormatType_32BGRA];
} }