public class Frame extends Object implements AutoCloseable, Indexable
CanvasFrame
, FrameGrabber
, FrameRecorder
, and their
subclasses. We can also make the link with other APIs, such as Android,
Java 2D, FFmpeg, and OpenCV, via a FrameConverter
.Modifier and Type | Class and Description |
---|---|
static class |
Frame.Type
Constants defining data type in the frame.
|
Modifier and Type | Field and Description |
---|---|
int |
audioChannels
Information associated with the
samples field. |
ByteBuffer |
data
Buffer to hold a data stream associated with a frame.
|
static int |
DEPTH_BYTE
Constants to be used for
imageDepth . |
static int |
DEPTH_DOUBLE
Constants to be used for
imageDepth . |
static int |
DEPTH_FLOAT
Constants to be used for
imageDepth . |
static int |
DEPTH_INT
Constants to be used for
imageDepth . |
static int |
DEPTH_LONG
Constants to be used for
imageDepth . |
static int |
DEPTH_SHORT
Constants to be used for
imageDepth . |
static int |
DEPTH_UBYTE
Constants to be used for
imageDepth . |
static int |
DEPTH_USHORT
Constants to be used for
imageDepth . |
Buffer[] |
image
Buffers to hold image pixels from multiple channels for a video frame.
|
int |
imageChannels
Information associated with the
image field. |
int |
imageDepth
Information associated with the
image field. |
int |
imageHeight
Information associated with the
image field. |
int |
imageStride
Information associated with the
image field. |
int |
imageWidth
Information associated with the
image field. |
boolean |
keyFrame
A flag set by a FrameGrabber or a FrameRecorder to indicate a key frame.
|
Object |
opaque
The underlying data object, for example, Pointer, AVFrame, IplImage, or Mat.
|
char |
pictType
The type of the image frame ('I', 'P', 'B', etc).
|
int |
sampleRate
Information associated with the
samples field. |
Buffer[] |
samples
Buffers to hold audio samples from multiple channels for an audio frame.
|
int |
streamIndex
Stream number the audio|video|other data is associated with.
|
long |
timestamp
Timestamp of the frame creation in microseconds.
|
Frame.Type |
type
The type of the stream.
|
Constructor and Description |
---|
Frame()
Empty constructor.
|
Frame(int width,
int height,
int depth,
int channels)
Allocates a new packed image frame in native memory where rows are 8-byte aligned.
|
Frame(int width,
int height,
int depth,
int channels,
int imageStride) |
Modifier and Type | Method and Description |
---|---|
Frame |
clone()
Care must be taken if this method is to be used in conjunction with movie recordings.
|
void |
close() |
<I extends Indexer> |
createIndexer()
Returns
createIndexer(true, 0) . |
<I extends Indexer> |
createIndexer(boolean direct) |
<I extends Indexer> |
createIndexer(boolean direct,
int i)
Returns an
Indexer for the ith image plane. |
EnumSet<Frame.Type> |
getTypes()
Returns types of data containing in the frame
|
static int |
pixelSize(int depth)
Returns
Math.abs(depth) / 8 . |
public boolean keyFrame
public char pictType
public static final int DEPTH_BYTE
imageDepth
.public static final int DEPTH_UBYTE
imageDepth
.public static final int DEPTH_SHORT
imageDepth
.public static final int DEPTH_USHORT
imageDepth
.public static final int DEPTH_INT
imageDepth
.public static final int DEPTH_LONG
imageDepth
.public static final int DEPTH_FLOAT
imageDepth
.public static final int DEPTH_DOUBLE
imageDepth
.public int imageWidth
image
field.public int imageHeight
image
field.public int imageDepth
image
field.public int imageChannels
image
field.public int imageStride
image
field.public Buffer[] image
public int sampleRate
samples
field.public int audioChannels
samples
field.public Buffer[] samples
public ByteBuffer data
public int streamIndex
public Frame.Type type
public Object opaque
public long timestamp
public Frame()
public Frame(int width, int height, int depth, int channels)
public Frame(int width, int height, int depth, int channels, int imageStride)
public static int pixelSize(int depth)
Math.abs(depth) / 8
.public <I extends Indexer> I createIndexer()
createIndexer(true, 0)
.public <I extends Indexer> I createIndexer(boolean direct)
createIndexer
in interface Indexable
public <I extends Indexer> I createIndexer(boolean direct, int i)
Indexer
for the ith image plane.public Frame clone()
public EnumSet<Frame.Type> getTypes()
public void close()
close
in interface AutoCloseable
Copyright © 2024. All rights reserved.