Class FrameSource

  • All Implemented Interfaces:
    AutoCloseable

    public final class FrameSource
    extends Object
    implements AutoCloseable
    FrameSource class Represents a source of image frame data, used as input to or output from Vision AI operations. Note: close() must be called in order to release underlying resources held by the object.
    • Method Detail

      • fromFormat

        public static FrameSource fromFormat​(FrameFormat format)
        Initializes a new instance of the FrameSource class.
        Parameters:
        format - The frame format
        Returns:
        A FrameSource instance
      • fromFormat

        public static FrameSource fromFormat​(FrameFormat format,
                                             FrameSourceCallback writeCallback)
        Initializes a new instance of the FrameSource class.
        Parameters:
        format - The frame format
        writeCallback - The callback which is raised from native side when data is requested to write
        Returns:
        A FrameSource instance
      • getWriter

        public FrameWriter getWriter()
        Gets a new instance of FrameWriter that can be used to write (submit) frame data to this FrameSource instance.
        Returns:
        A new FrameWriter instance associated to this FrameSource.
      • closeWriter

        public void closeWriter()
        Closes the frame source for writing.
      • getFormat

        public FrameFormat getFormat()
        Get frame format from the FrameSource
        Returns:
        A FrameFormat instance associated to this FrameSource.
      • getHandle

        public long getHandle()
        Gets the internal native handle.
        Returns:
        Native handle value
      • close

        public void close()
        Explicitly frees any external resource attached to the object. Note: close() must be called in order to release underlying resources held by the object.
        Specified by:
        close in interface AutoCloseable