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
,java.io.Closeable
,java.lang.AutoCloseable
public class FrameOutput extends VerifyCloseable implements IOutput, IOrientable
Representing a Frame as an Array of Pixels
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FrameOutput.IFramePixelBufferProvider
Interface for getting the processed frame as an array of pixelsstatic class
FrameOutput.ReadBufferMode
Pixel reading mode
-
Field Summary
-
Fields inherited from class com.banuba.sdk.player.VerifyCloseable
mIsClosed, mTag
-
-
Constructor Summary
Constructors Constructor Description FrameOutput(FrameOutput.IFramePixelBufferProvider callback)
Create 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 Detail
-
FrameOutput
public FrameOutput(@NonNull FrameOutput.IFramePixelBufferProvider callback)
Create a new instance of the FrameOutput with default SimpleDirectBufferAllocator and SYNC read mode- Parameters:
callback
- the processed frame is sent here- See Also:
SimpleDirectBufferAllocator
-
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:
SimpleDirectBufferAllocator
-
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 Detail
-
setFormat
public void setFormat(FramePixelBufferFormat format)
Apply output frame format. The nearest output frame will have this format.- Parameters:
format
- desired output format of image- See Also:
Available formats
-
setOrientation
public void setOrientation(Orientation orientation, boolean mirroring)
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
public void present(IRenderTargetPresentable renderTarget)
Presenting the processed frame to the surface
-
close
public void close()
Closes the resource and frees memory- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classVerifyCloseable
-
-