Interface IEventCallback


public interface IEventCallback
Various events callbacks related to events in Banuba SDK.
  • Method Details

    • onCameraOpenError

      void onCameraOpenError(@NonNull Throwable error)
      Failed to open camera. Check camera permissions first.
      Parameters:
      error - error message
    • onCameraStatus

      void onCameraStatus(boolean opened)
      Camera open status
      Parameters:
      opened - is camera opened
    • onScreenshotReady

      void onScreenshotReady(@NonNull android.graphics.Bitmap photo)
      Parameters:
      photo - "Screenshot" from camera frames stream with current effect.
    • onHQPhotoReady

      void onHQPhotoReady(@NonNull android.graphics.Bitmap photo)
      Parameters:
      photo - High resolution photo from camera with current effect.
    • onVideoRecordingFinished

      void onVideoRecordingFinished(@NonNull RecordedVideoInfo videoInfo)
      Video recording was finished
      Parameters:
      videoInfo - info about recorded video
    • onVideoRecordingStatusChange

      void onVideoRecordingStatusChange(boolean started)
      Video recording status was changed
      Parameters:
      started - status flag
    • onImageProcessed

      void onImageProcessed(@NonNull android.graphics.Bitmap processedBitmap)
      Image processing was finished
      Parameters:
      processedBitmap - image with current effect applied
    • onEditedImageReady

      default void onEditedImageReady(@NonNull android.graphics.Bitmap image)
      Parameters:
      image - edited image with current effect applied
    • onEditingModeFaceFound

      default void onEditingModeFaceFound(boolean faceFound)
      Editing mode face found status
      Parameters:
      faceFound - status flag
    • onFrameRendered

      void onFrameRendered(@NonNull com.banuba.sdk.types.Data data, int width, int height)
      Callback to receive rendered frames. Call close() method of the Data object at the end.
      Parameters:
      data - raw RGBA data, you may decode it with `Bitmap.copyPixelsFromBuffer()`, use `Bitmap.Config.ARGB_8888`.
      width - width of the frame
      height - height of the frame
      
           Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
           bitmap.copyPixelsFromBuffer(data.getData());
       
    • onTextureRendered

      default void onTextureRendered(int texture, int width, int height, long timestamp, float[] matrix)
      Callback to receive rendered textures requested by `BanubaSdkManager.startForwardingTextures`. This method executed in the thread which owns the corresponding EGL context. These textures can be passed to other libraries, e.g. WebRTC: https://chromium.googlesource.com/external/webrtc/+/HEAD/sdk/android/api/org/webrtc/TextureBufferImpl.java
      Parameters:
      texture - OES texture http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt
      width - texture width
      height - texture height
      timestamp - timestamp associated with the texture image in nanoseconds
      matrix - 4x4 texture coordinate transform matrix associated with the texture image. This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample that location from the texture. Sampling the texture outside of the range of this transform is undefined.