Package 

Class FrameManager


  • 
    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 int getPoolSize() Returns the pool size.
      final int getFrameBytes() Returns the frame size in bytes.
      final Class<T> getFrameDataClass() Returns the frame data class.
      void setUp(int format, @NonNull() Size size, @NonNull() Angles angles) Allocates a mPoolSize number of buffers.
      Frame getFrame(@NonNull() T data, long time) Returns a new Frame for the given data.
      void release() Releases all frames controlled by this manager andclears the pool.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPoolSize

         final int getPoolSize()

        Returns the pool size.

      • getFrameBytes

         final int getFrameBytes()

        Returns the frame size in bytes.

      • 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 format
        size - the frame size
        angles - 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 - data
        time - timestamp
      • release

         void release()

        Releases all frames controlled by this manager andclears the pool.