Class FrameSource
- java.lang.Object
-
- com.azure.android.ai.vision.common.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Explicitly frees any external resource attached to the object.void
closeWriter()
Closes the frame source for writing.static FrameSource
fromFormat(FrameFormat format)
Initializes a new instance of the FrameSource class.static FrameSource
fromFormat(FrameFormat format, FrameSourceCallback writeCallback)
Initializes a new instance of the FrameSource class.FrameFormat
getFormat()
Get frame format from the FrameSourcelong
getHandle()
Gets the internal native handle.FrameWriter
getWriter()
Gets a new instance of FrameWriter that can be used to write (submit) frame data to this FrameSource instance.
-
-
-
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 formatwriteCallback
- 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 interfaceAutoCloseable
-
-