Quick Look in the Xcode Debugger for Obj-C frame buffer classes.

Implement debugQuickLookObject for RTCI420Buffers and RTCCVPixelBuffers.

Also draw gradients consistently regardless of endianness in the unit
tests for RTCCVPixelBuffers and ObjCVideoTrackSource.

Bug: webrtc:9007
Change-Id: Ia5a3d0905a763efc190165471983061fc07551f2
Reviewed-on: https://webrtc-review.googlesource.com/64987
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22746}
This commit is contained in:
Anders Carlsson
2018-04-05 13:07:39 +02:00
committed by Commit Bot
parent 0e075723ad
commit 498644e645
3 changed files with 59 additions and 3 deletions

View File

@ -18,13 +18,16 @@ void DrawGradientInRGBPixelBuffer(CVPixelBufferRef pixelBuffer) {
size_t width = CVPixelBufferGetWidth(pixelBuffer);
size_t height = CVPixelBufferGetHeight(pixelBuffer);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
int byteOrder = CVPixelBufferGetPixelFormatType(pixelBuffer) == kCVPixelFormatType_32ARGB ?
kCGBitmapByteOrder32Little :
0;
CGContextRef cgContext = CGBitmapContextCreate(baseAddr,
width,
height,
8,
CVPixelBufferGetBytesPerRow(pixelBuffer),
colorSpace,
kCGImageAlphaNoneSkipLast);
byteOrder | kCGImageAlphaNoneSkipLast);
// Create a gradient
CGFloat colors[] = {