Video Effects SDK 2.6.0.118490
AI-powered SDK for real-time video enhancement.
Loading...
Searching...
No Matches
tsvb::IAppleCompatFrameFactory Class Referenceabstract

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.

Detailed Description

Creates IFrame from CVPixelBuffer on Apple platforms.

Obtained with IFrameFactory::getInterface() and InterfaceTypeID::appleCompatFrameFactory.

Member Function Documentation

◆ createFrameWithCVPixelBuffer()

virtual IFrame * tsvb::IAppleCompatFrameFactory::createFrameWithCVPixelBuffer ( CVPixelBufferRef pixelBuffer,
bool metalCompatible )
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:

  • kCVPixelFormatType_32BGRA
  • kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
  • kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

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.

frameFactory->getInterface(InterfaceTypeID::appleCompatFrameFactory)
);
IFrame* frame =
appleCompatFrameFactory->createFrameWithCVPixelBuffer(cvPixelBuffer, true);
Creates IFrame from CVPixelBuffer on Apple platforms.
Definition compat_frame_factory.h:14
Video frame.
Definition frame.h:78
@ appleCompatFrameFactory
IAppleCompatFrameFactory, supported by IFrameFactory on Apple platforms.
Definition common.h:13
Parameters
pixelBufferCVPixelBufferRef.
metalCompatibleSet 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.
Returns
An instance of IFrame, or nullptr on failure.

The documentation for this class was generated from the following file: