FrameSource Class

  • java.lang.Object
    • com.azure.ai.vision.common.FrameSource

Implements

java.lang.AutoCloseable

public final class FrameSource
implements java.lang.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

Modifier and Type Method and Description
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.

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, Consumer<FrameSource> frameSourceConsumer)

Initializes a new instance of the FrameSource class.

FrameFormat getFormat()

Get frame format from the FrameSource

long 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.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

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.

closeWriter

public void closeWriter()

Closes the frame source for writing.

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, Consumer<FrameSource> frameSourceConsumer)

Initializes a new instance of the FrameSource class.

Parameters:

format - The frame format
frameSourceConsumer - The consumer to be called when a new frame is required.

Returns:

A FrameSource instance

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

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.

Applies to