CVPixelBuffer vs. CVImageBuffer, and Buffers in general
Asked Answered
A

1

9

What's the difference between CVImageBuffer which is returned by CMSampleBufferGetmageBuffer and CVPixelBuffer? I just want to retrieve the image planes (RGBA) but I can't figure out how to retrieve this information from CVImageBuffer. I'm using Swift.

Thanks.

Ahl answered 30/3, 2018 at 4:55 Comment(0)
S
14

They are identical in swift. If you look at the definition underneath, you will see this:

public typealias CVPixelBuffer = CVImageBuffer

which means that you can use you can use the methods here if you want to find the image planes(I don't know what that means exactly). But CVPixelBuffer is a concrete implementation of the abstract class CVImageBuffer. There are two types of CVImageBuffers in use at the moment-CVPixelBuffers and OpenGLBuffers. You can choose to break the abstraction if you know for certain that your CVImageBuffer is a CVPixelBuffer.

Seel answered 15/5, 2018 at 17:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.