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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattach()Called by thePlayerwhen the new input is added to the Player using the 'use()' methodvoiddetach()Called by thePlayerwhen the input will be changed to a new input, or when the Playercom.banuba.sdk.effect_player.FrameProcessorGet the current framelongGet frame timestamp in nanosecondsvoidpush(FramePixelBuffer framePixelBuffer, long frameTimeNanos) Push the framePixelBuffer into FrameProcessor with default orientation: 0 degrees, no mirroring and face orientation 0voidpush(FramePixelBuffer framePixelBuffer, Orientation orientation, boolean requireMirroring, long frameTimeNanos) Push the framePixelBuffer into FrameProcessor with given orientationvoidpush(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:
frameProcessorin interfaceIInput- Returns:
- the last received frame
-
getFrameTimeNanos
public long getFrameTimeNanos()Get frame timestamp in nanoseconds- Specified by:
getFrameTimeNanosin interfaceIInput- Returns:
- timestamp
-
attach
public void attach()Description copied from interface:IAttachableCalled by thePlayerwhen the new input is added to the Player using the 'use()' method- Specified by:
attachin interfaceIAttachable
-
detach
public void detach()Description copied from interface:IAttachableCalled by thePlayerwhen the input will be changed to a new input, or when the Player- Specified by:
detachin interfaceIAttachable
-