Package com.banuba.sdk.input
Class StreamInput
java.lang.Object
com.banuba.sdk.input.StreamInput
- All Implemented Interfaces:
IAttachable
,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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Get the current framelong
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
-
Constructor Details
-
StreamInput
public StreamInput()Create a new StreamInput with VideoProcessor
-
-
Method Details
-
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
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
-