-
public abstract class FrameManager<T>This class manages the allocation of Frame objects. The FrameManager keeps a mPoolSize integer that defines the number of instances to keep. Main methods are: - setUp: to set up with size and allocate buffers - release: to release. After release, a manager can be setUp again. - getFrame: gets a new Frame. For frames to get back to the FrameManager pool, all you have to do is call release when done.
-
-
Method Summary
Modifier and Type Method Description final intgetPoolSize()Returns the pool size. final intgetFrameBytes()Returns the frame size in bytes. final Class<T>getFrameDataClass()Returns the frame data class. voidsetUp(int format, @NonNull() Size size, @NonNull() Angles angles)Allocates a mPoolSize number of buffers. FramegetFrame(@NonNull() T data, long time)Returns a new Frame for the given data. voidrelease()Releases all frames controlled by this manager andclears the pool. -
-
Method Detail
-
getPoolSize
final int getPoolSize()
Returns the pool size.
-
getFrameBytes
final int getFrameBytes()
Returns the frame size in bytes.
-
getFrameDataClass
final Class<T> getFrameDataClass()
Returns the frame data class.
-
setUp
void setUp(int format, @NonNull() Size size, @NonNull() Angles angles)
Allocates a mPoolSize number of buffers. Should be called oncethe preview size and the image format value are known.This method can be called again after release has been called.
- Parameters:
format- the image formatsize- the frame sizeangles- angle object
-
getFrame
@Nullable() Frame getFrame(@NonNull() T data, long time)
Returns a new Frame for the given data. This must be called- after setUp, which sets the buffer size- after the T data has been filled
- Parameters:
data- datatime- timestamp
-
release
void release()
Releases all frames controlled by this manager andclears the pool.
-
-
-
-