Package com.banuba.sdk.output
Class FrameOutput
java.lang.Object
com.banuba.sdk.player.VerifyCloseable
com.banuba.sdk.output.FrameOutput
- All Implemented Interfaces:
IOrientable
,IOutput
,Closeable
,AutoCloseable
Representing a Frame as an Array of Pixels
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface for getting the processed frame as an array of pixelsstatic enum
Pixel reading mode -
Field Summary
Fields inherited from class com.banuba.sdk.player.VerifyCloseable
mIsClosed, mTag
-
Constructor Summary
ConstructorDescriptionCreate a new instance of the FrameOutput with default SimpleDirectBufferAllocator and SYNC read modeFrameOutput
(FrameOutput.IFramePixelBufferProvider callback, FrameOutput.ReadBufferMode readMode) Create a new instance of the FrameOutput with default SimpleDirectBufferAllocatorFrameOutput
(FrameOutput.IFramePixelBufferProvider callback, IDirectBufferAllocator allocator) Create a new instance of the FrameOutput with memory allocator and SYNC read mode The memory allocator helps avoid excessive memory usage, as well as increases performance and reduces the number of GarbageCollector hits.FrameOutput
(FrameOutput.IFramePixelBufferProvider callback, IDirectBufferAllocator allocator, FrameOutput.ReadBufferMode readMode) Create a new instance of the FrameOutput with memory allocator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the resource and frees memoryvoid
present
(IRenderTargetPresentable renderTarget) Presenting the processed frame to the surfacevoid
setFormat
(FramePixelBufferFormat format) Apply output frame format.void
setOrientation
(Orientation orientation, boolean mirroring) Apply output frame orientation.Methods inherited from class com.banuba.sdk.player.VerifyCloseable
finalize
-
Constructor Details
-
FrameOutput
Create a new instance of the FrameOutput with default SimpleDirectBufferAllocator and SYNC read mode- Parameters:
callback
- the processed frame is sent here- See Also:
-
FrameOutput
public FrameOutput(@NonNull FrameOutput.IFramePixelBufferProvider callback, @NonNull FrameOutput.ReadBufferMode readMode) Create a new instance of the FrameOutput with default SimpleDirectBufferAllocator- Parameters:
callback
- the processed frame is sent herereadMode
- pixels reading mode- See Also:
-
FrameOutput
public FrameOutput(@NonNull FrameOutput.IFramePixelBufferProvider callback, IDirectBufferAllocator allocator) Create a new instance of the FrameOutput with memory allocator and SYNC read mode The memory allocator helps avoid excessive memory usage, as well as increases performance and reduces the number of GarbageCollector hits.- Parameters:
callback
- the processed frame is sent hereallocator
- allocator for the images
-
FrameOutput
public FrameOutput(@NonNull FrameOutput.IFramePixelBufferProvider callback, IDirectBufferAllocator allocator, @NonNull FrameOutput.ReadBufferMode readMode) Create a new instance of the FrameOutput with memory allocator. The memory allocator helps avoid excessive memory usage, as well as increases performance and reduces the number of GarbageCollector hits.- Parameters:
callback
- the processed frame is sent hereallocator
- allocator for the imagesreadMode
- pixels reading mode
-
-
Method Details
-
setFormat
Apply output frame format. The nearest output frame will have this format.- Parameters:
format
- desired output format of image- See Also:
-
setOrientation
Apply output frame orientation. The nearest output frame will have this orientation.- Specified by:
setOrientation
in interfaceIOrientable
- Parameters:
orientation
- rotation of output framemirroring
- require mirroring
-
present
Presenting the processed frame to the surface -
close
public void close()Closes the resource and frees memory- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classVerifyCloseable
-