|
Video Effects SDK 2.6.0.118490
AI-powered SDK for real-time video enhancement.
|
Creates IFrame from CVPixelBuffer on Apple platforms. More...
#include <vb_sdk/apple/compat_frame_factory.h>
Public Member Functions | |
| virtual IFrame * | createFrameWithCVPixelBuffer (CVPixelBufferRef pixelBuffer, bool metalCompatible)=0 |
| Creates IFrame with CVPixelBuffer. | |
Creates IFrame from CVPixelBuffer on Apple platforms.
Obtained with IFrameFactory::getInterface() and InterfaceTypeID::appleCompatFrameFactory.
|
pure virtual |
Creates IFrame with CVPixelBuffer.
Metal-compatible CVPixelBuffer is recommended. CVPixelBuffer received within AVCaptureVideoDataOutputSampleBufferDelegate.captureOutput(_:didOutput:from:) from AVCaptureSession is Metal-compatible. To create a Metal-compatible CVPixelBuffer manually, set the kCVPixelBufferMetalCompatibilityKey attribute.
Supported formats:
NV12 of an odd width or height is not supported: nullptr is returned for it.
An NV12 frame has the range of its pixel format and the matrix of its kCVImageBufferYCbCrMatrixKey attachment, BT.601 when it has none; see IFrame::setColorRange() and IFrame::setColorMatrix().
The frame retains the buffer. A pipeline it is given to may retain the buffer too, after the frame is released and after the call it was passed to has returned.
| pixelBuffer | CVPixelBufferRef. |
| metalCompatible | Set to true when the CVPixelBuffer can be used in Metal directly. If you don't know whether it is Metal-compatible, set to false: a buffer backed by an IOSurface may still be used directly then. Has no effect with the CPU pipeline. |