The sample is deprecated. Please, rely on this repo instead.
Quick start examples for integrating Banuba SDK on macos.
- Get the latest Banuba SDK archive for MacOS and the client token. Please fill out our form at form at banuba.com website, or contact us via info@banuba.com.
- Copy
bnb_sdk.zip/mac
into theOEP_macos/bnb_sdk
dir. - Copy
bnb_sdk.zip/effects
files into theOEP_macos/resources
dir. - Copy and Paste your client token into the appropriate section of
OEP_macos/ViewController.swift
- Configure effect in the appropriate section of
OEP_macos/ViewController.swift
, e.g.test_BG
More effects can be found here - Load the OEP-module by executing the following commands:
Then go to the
cd %path_to_repository% git submodule update --init --recursive
OEP-module
folder, open theCMakeLists.txt
and set the "Use bnb offscreen_render_target implementation" option toOFF
. We don`t need this part of the OEP-module in this sample. - Generate project files by executing the following commands:
cd %path_to_repository% mkdir build cd build cmake -G Xcode ..
- The previous step will generate a Xcode project for MacOS. Open the offscreen_effect_player_macos project in an appropriate IDE on your platform.
- Select target
example_mac
. - Run build.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- interfaces - add some METAL-specific interfaces in addition to OEP-module
- OEP-module - is a submodule of the offscreen effect player.
- offscreen_render_target - is an implementation option for the offscreen_render_target interface. Allows to prepare METAL framebuffers and textures for receiving a frame from gpu, receive bytes of the processed frame from the gpu and pass them to the cpu, as well as, if necessary, set the orientation for the received frame.
- libraries
- utils
- utils - сontains common helper classes such as thread_pool
- utils
- oep_framework - contains build rules banuba_oep framework and BNBOffscreenEffectPlayer, which is a class for working with the effect player
- ViewController.swift - contains a pipeline of frames received from the camera and sent for processing the effect and the subsequent receipt of processed frames
-
if you need to build METAL shaders library you should use next commands: xcrun -sdk macosx metal -c OEPShaders.metal -o OEPShaders.air xcrun -sdk macosx metallib OEPShaders.air -o OEPShaders.metallib
-
while running test app in Xcode, you could see memory leak. This is some effects of Xcode. You could run the app without Xcode and use system monitor to make certain, that there is no memory leak in release version of the app.