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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for getting the processed frame as an array of pixelsstatic enumPixel reading mode -
Field Summary
Fields inherited from class com.banuba.sdk.player.VerifyCloseable
mIsClosed, mTag -
Constructor Summary
ConstructorsConstructorDescriptionCreate 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 TypeMethodDescriptionvoidclose()Closes the resource and frees memoryvoidpresent(IRenderTargetPresentable renderTarget) Presenting the processed frame to the surfacevoidsetFormat(FramePixelBufferFormat format) Apply output frame format.voidsetOrientation(Orientation orientation, boolean mirroring) Apply output frame orientation.voidstart()Start using output by thePlayervoidstop()Stop using output by thePlayerMethods 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:
setOrientationin interfaceIOrientable- Parameters:
orientation- rotation of output framemirroring- require mirroring
-
start
public void start()Description copied from interface:IOutputStart using output by thePlayer -
stop
public void stop()Description copied from interface:IOutputStop using output by thePlayer -
present
Presenting the processed frame to the surface -
close
public void close()Closes the resource and frees memory- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classVerifyCloseable
-