Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Also apply CVPixelBufferGetBytesPerRowOfPlane fix to test card
Browse files Browse the repository at this point in the history
  • Loading branch information
johnboiles committed Oct 21, 2020
1 parent 3c8e066 commit 4bd5852
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dal-plugin/Stream.mm
Expand Up @@ -172,11 +172,11 @@ - (CVPixelBufferRef)createPixelBufferWithTestAnimation {
NSParameterAssert(status == kCVReturnSuccess && pxbuffer != NULL);

CVPixelBufferLockBaseAddress(pxbuffer, 0);
void *pxdata = CVPixelBufferGetBaseAddress(pxbuffer);
void *pxdata = CVPixelBufferGetBaseAddressOfPlane(pxbuffer, 0);
NSParameterAssert(pxdata != NULL);

CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(pxdata, width, height, 8, CVPixelBufferGetBytesPerRow(pxbuffer), rgbColorSpace, kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Big);
CGContextRef context = CGBitmapContextCreate(pxdata, width, height, 8, CVPixelBufferGetBytesPerRowOfPlane(pxbuffer, 0), rgbColorSpace, kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Big);
NSParameterAssert(context);

NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithCGContext:context flipped:NO];
Expand Down

0 comments on commit 4bd5852

Please sign in to comment.