Skip to content

Commit

Permalink
GPUImageFramebuffer add get CVPixelBufferRef method, VideoToolBox enc…
Browse files Browse the repository at this point in the history
…ode need CVPixelBufferRef format,otherwise need createPixelBuffer for bytes
  • Loading branch information
chenliming committed May 26, 2016
1 parent 4a72158 commit 5f8219d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/Source/GPUImageFramebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ typedef struct GPUTextureOptions {
- (void)unlockAfterReading;
- (NSUInteger)bytesPerRow;
- (GLubyte *)byteBuffer;
- (CVPixelBufferRef)pixelBuffer;

@end
9 changes: 9 additions & 0 deletions framework/Source/GPUImageFramebuffer.m
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,15 @@ - (GLubyte *)byteBuffer;
#endif
}

- (CVPixelBufferRef )pixelBuffer;
{
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
return renderTarget;
#else
return NULL; // TODO: do more with this on the non-texture-cache side
#endif
}

- (GLuint)texture;
{
// NSLog(@"Accessing texture: %d from FB: %@", _texture, self);
Expand Down

0 comments on commit 5f8219d

Please sign in to comment.