Class StreamInput

  • All Implemented Interfaces:
    IAttachable, IInput

    public class StreamInput
    extends java.lang.Object
    implements IInput
    Stream input provides ability to push `FrameData` or `FramePixelBuffer` into the video processor. Uses synchronous processor, so frames cannot be dropped in case of `Player` latency.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamInput()
      Create a new StreamInput with VideoProcessor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attach()
      Called by the Player when the new input is added to the Player using the 'use()' method
      void detach()
      Called by the Player when the input will be changed to a new input, or when the Player
      com.banuba.sdk.effect_player.FrameProcessor frameProcessor()
      Get the current frame
      long getFrameTimeNanos()
      Get frame timestamp in nanoseconds
      void push​(FramePixelBuffer framePixelBuffer, long frameTimeNanos)
      Push the framePixelBuffer into FrameProcessor with default orientation: 0 degrees, no mirroring and face orientation 0
      void push​(FramePixelBuffer framePixelBuffer, Orientation orientation, boolean requireMirroring, long frameTimeNanos)
      Push the framePixelBuffer into FrameProcessor with given orientation
      void push​(com.banuba.sdk.types.FrameData frameData, long frameTimeNanos)
      Push the frameData to the FrameProcessor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StreamInput

        public StreamInput()
        Create a new StreamInput with VideoProcessor
    • Method Detail

      • push

        public void push​(@NonNull
                         com.banuba.sdk.types.FrameData frameData,
                         long frameTimeNanos)
        Push the frameData to the FrameProcessor
        Parameters:
        frameData - frame data
        frameTimeNanos - timestamp in nanoseconds
      • push

        public void push​(FramePixelBuffer framePixelBuffer,
                         Orientation orientation,
                         boolean requireMirroring,
                         long frameTimeNanos)
        Push the framePixelBuffer into FrameProcessor with given orientation
        Parameters:
        framePixelBuffer - image (array of pixels)
        orientation - orientation of the image
        frameTimeNanos - timestamp in nanoseconds
      • push

        public void push​(FramePixelBuffer framePixelBuffer,
                         long frameTimeNanos)
        Push the framePixelBuffer into FrameProcessor with default orientation: 0 degrees, no mirroring and face orientation 0
        Parameters:
        framePixelBuffer - image (array of pixels)
        frameTimeNanos - timestamp in nanoseconds
      • frameProcessor

        @NonNull
        public com.banuba.sdk.effect_player.FrameProcessor frameProcessor()
        Get the current frame
        Specified by:
        frameProcessor in interface IInput
        Returns:
        the last received frame
      • getFrameTimeNanos

        public long getFrameTimeNanos()
        Get frame timestamp in nanoseconds
        Specified by:
        getFrameTimeNanos in interface IInput
        Returns:
        timestamp
      • attach

        public void attach()
        Description copied from interface: IAttachable
        Called by the Player when the new input is added to the Player using the 'use()' method
        Specified by:
        attach in interface IAttachable
      • detach

        public void detach()
        Description copied from interface: IAttachable
        Called by the Player when the input will be changed to a new input, or when the Player
        Specified by:
        detach in interface IAttachable