BNBOffscreenEffectPlayer
Deprecated
Use the Player API instead
Objective-C
@interface BNBOffscreenEffectPlayer : NSObject
Swift
class BNBOffscreenEffectPlayer : NSObject
All methods must be called from the same thread (in which the object was created BNBOffscreenEffectPlayer) All methods are synchronous
WARNING: the SDK should be initialized with BNBUtilityManager before BNBOfscreenEffectPlayer creation
-
Deprecated
Use the Player API instead
Initialize with configured BNBEffectPlayer
Declaration
Objective-C
- (nonnull instancetype)initWithEffectPlayer: (nonnull BNBEffectPlayer *)effectPlayer offscreenWidth:(NSUInteger)width offscreenHight:(NSUInteger)height;
Swift
init(effectPlayer: BNBEffectPlayer, offscreenWidth width: UInt, offscreenHight height: UInt)
-
Deprecated
Use the Player API instead
effectWidth andHeight the size of the inner area where the effect is drawn NOTE: There is an assumption that it is the user’s responsibility to make sure that the size of the rendering area is equal to the image size passed to processImage
Declaration
Objective-C
- (nonnull instancetype)initWithEffectWidth:(NSUInteger)width andHeight:(NSUInteger)height manualAudio:(BOOL)manual;
Swift
init(effectWidth width: UInt, andHeight height: UInt, manualAudio manual: Bool)
-
Deprecated
Use the Player API instead
EpImageFormat::imageSize - size of input image the size of the output image is equal to the size of the inner area where the effect is drawn Supported input Image formats: kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, kCVPixelFormatType_420YpCbCr8BiPlanarFullRange, kCVPixelFormatType_420YpCbCr8Planar, kCVPixelFormatType_420YpCbCr8PlanarFullRange, kCVPixelFormatType_32ARGB, kCVPixelFormatType_32BGRA, kCVPixelFormatType_24RGB,
Declaration
Objective-C
- (nullable CVPixelBufferRef)processImage:(CVPixelBufferRef _Nonnull)pixelBuffer withFormat: (const EpImageFormat *_Nonnull)imageFormat;
Swift
func processImage(_ pixelBuffer: CVPixelBuffer, with imageFormat: UnsafePointer<EpImageFormat>) -> CVPixelBuffer?
-
Deprecated
Use the Player API instead
Async version of processImage method
Declaration
Objective-C
- (void)processImage:(CVPixelBufferRef _Nonnull)pixelBuffer withFormat:(const EpImageFormat *_Nonnull)imageFormat frameTimestamp:(nonnull NSNumber *)timestamp completion:(BNBOEPImageReadyBlock _Nonnull)completion;
Swift
func processImage(_ pixelBuffer: CVPixelBuffer, with imageFormat: UnsafePointer<EpImageFormat>, frameTimestamp timestamp: NSNumber) async -> (CVPixelBuffer?, NSNumber)
-
Deprecated
Use the Player API instead
Load effect with the specified name (used folder name) effectName - usually it is the folder name with the effect resources on local storage
Declaration
Objective-C
- (void)loadEffect:(nonnull NSString *)effectName;
Swift
func loadEffect(_ effectName: String)
-
Deprecated
Use the Player API instead
Load effect with specified name asynchronously effectName - usually it is folder name with effect resources on local storage
Declaration
Objective-C
- (void)loadEffect:(NSString *_Nonnull)effectName completion:(nonnull BNBEffectStatusBlock)completion;
Swift
func loadEffect(_ effectName: String) async -> Bool
-
Deprecated
Use the Player API instead
Deactivate the current effect, the same can be achieved by loading effect with the empty name via loadEffect
Declaration
Objective-C
- (void)unloadEffect;
Swift
func unloadEffect()
-
Deprecated
Use the Player API instead
lets the effect player know that the surface has changed
Declaration
Objective-C
- (void)surfaceChanged:(NSUInteger)width withHeight:(NSUInteger)height;
Swift
func surfaceChanged(_ width: UInt, withHeight height: UInt)
-
Deprecated
Use the Player API instead
When you use the EffectPlayer with CallKit, you should enable audio manually at the point when CallKit notifies that its Audio Session is ready (CallKit’s session is created in privileged mode, so it should be respected).
Declaration
Objective-C
- (void)enableAudio:(BOOL)enable;
Swift
func enableAudio(_ enable: Bool)
-
Deprecated
Use the Player API instead
Let you call methods defined in the active effect’s script passing additional data or changing effect’s behaviour
Declaration
Objective-C
- (void)callJsMethod:(nonnull NSString *)method withParam:(nonnull NSString *)param;
Swift
func callJsMethod(_ method: String, withParam param: String)
-
Deprecated
Use the Player API instead
Let you execute scripts or load JS modules to the environment of active effect
Declaration
Objective-C
- (void)evalJs:(NSString *_Nonnull)script resultCallback:(BNBOEPEvalJsResult _Nullable)resultCallback;
Swift
func evalJs(_ script: String, resultCallback: BNBOEPEvalJsResult? = nil)