Package com.banuba.sdk.input
Class StreamInput
- java.lang.Object
-
- com.banuba.sdk.input.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 thePlayer
when the new input is added to the Player using the 'use()' methodvoid
detach()
Called by thePlayer
when the input will be changed to a new input, or when the Playercom.banuba.sdk.effect_player.FrameProcessor
frameProcessor()
Get the current framelong
getFrameTimeNanos()
Get frame timestamp in nanosecondsvoid
push(FramePixelBuffer framePixelBuffer, long frameTimeNanos)
Push the framePixelBuffer into FrameProcessor with default orientation: 0 degrees, no mirroring and face orientation 0void
push(FramePixelBuffer framePixelBuffer, Orientation orientation, boolean requireMirroring, long frameTimeNanos)
Push the framePixelBuffer into FrameProcessor with given orientationvoid
push(com.banuba.sdk.types.FrameData frameData, long frameTimeNanos)
Push the frameData to the FrameProcessor
-
-
-
Method Detail
-
push
public void push(@NonNull com.banuba.sdk.types.FrameData frameData, long frameTimeNanos)
Push the frameData to the FrameProcessor- Parameters:
frameData
- frame dataframeTimeNanos
- 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 imageframeTimeNanos
- 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 interfaceIInput
- Returns:
- the last received frame
-
getFrameTimeNanos
public long getFrameTimeNanos()
Get frame timestamp in nanoseconds- Specified by:
getFrameTimeNanos
in interfaceIInput
- Returns:
- timestamp
-
attach
public void attach()
Description copied from interface:IAttachable
Called by thePlayer
when the new input is added to the Player using the 'use()' method- Specified by:
attach
in interfaceIAttachable
-
detach
public void detach()
Description copied from interface:IAttachable
Called by thePlayer
when the input will be changed to a new input, or when the Player- Specified by:
detach
in interfaceIAttachable
-
-