Package org.bytedeco.copiedstuff
Class Frame
java.lang.Object
org.bytedeco.copiedstuff.Frame
- All Implemented Interfaces:
org.bytedeco.javacpp.indexer.Indexable
public class Frame extends Object implements org.bytedeco.javacpp.indexer.Indexable
A class to manage the data of audio and video frames. It it used by
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
.-
Field Summary
Fields Modifier and Type Field Description int
audioChannels
Information associated with thesamples
field.static int
DEPTH_BYTE
Constants to be used forimageDepth
.static int
DEPTH_DOUBLE
Constants to be used forimageDepth
.static int
DEPTH_FLOAT
Constants to be used forimageDepth
.static int
DEPTH_INT
Constants to be used forimageDepth
.static int
DEPTH_LONG
Constants to be used forimageDepth
.static int
DEPTH_SHORT
Constants to be used forimageDepth
.static int
DEPTH_UBYTE
Constants to be used forimageDepth
.static int
DEPTH_USHORT
Constants to be used forimageDepth
.Buffer[]
image
Buffers to hold image pixels from multiple channels for a video frame.int
imageChannels
Information associated with theimage
field.int
imageDepth
Information associated with theimage
field.int
imageHeight
Information associated with theimage
field.int
imageStride
Information associated with theimage
field.int
imageWidth
Information associated with theimage
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, AVFrame, IplImage, or Mat.int
sampleRate
Information associated with thesamples
field.Buffer[]
samples
Buffers to hold audio samples from multiple channels for an audio frame.long
timestamp
Timestamp of the frame creation. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description Frame
clone()
Care must be taken if this method is to be used in conjunction with movie recordings.<I extends org.bytedeco.javacpp.indexer.Indexer>
IcreateIndexer()
ReturnscreateIndexer(true, 0)
.<I extends org.bytedeco.javacpp.indexer.Indexer>
IcreateIndexer(boolean direct)
<I extends org.bytedeco.javacpp.indexer.Indexer>
IcreateIndexer(boolean direct, int i)
Returns anIndexer
for the ith image plane.
-
Field Details
-
keyFrame
public boolean keyFrameA flag set by a FrameGrabber or a FrameRecorder to indicate a key frame. -
DEPTH_BYTE
public static final int DEPTH_BYTEConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_UBYTE
public static final int DEPTH_UBYTEConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_SHORT
public static final int DEPTH_SHORTConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_USHORT
public static final int DEPTH_USHORTConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_INT
public static final int DEPTH_INTConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_LONG
public static final int DEPTH_LONGConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_FLOAT
public static final int DEPTH_FLOATConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
DEPTH_DOUBLE
public static final int DEPTH_DOUBLEConstants to be used forimageDepth
.- See Also:
- Constant Field Values
-
imageWidth
public int imageWidthInformation associated with theimage
field. -
imageHeight
public int imageHeightInformation associated with theimage
field. -
imageDepth
public int imageDepthInformation associated with theimage
field. -
imageChannels
public int imageChannelsInformation associated with theimage
field. -
imageStride
public int imageStrideInformation associated with theimage
field. -
image
Buffers to hold image pixels from multiple channels for a video frame. Most of the software supports packed data only, but an array is provided to allow users to store images in a planar format as well. -
sampleRate
public int sampleRateInformation associated with thesamples
field. -
audioChannels
public int audioChannelsInformation associated with thesamples
field. -
samples
Buffers to hold audio samples from multiple channels for an audio frame. -
opaque
The underlying data object, for example, AVFrame, IplImage, or Mat. -
timestamp
public long timestampTimestamp of the frame creation.
-
-
Constructor Details
-
Frame
public Frame()Empty constructor. -
Frame
public Frame(int width, int height, int depth, int channels)Allocates a new packed image frame in native memory where rows are 8-byte aligned.
-
-
Method Details
-
createIndexer
public <I extends org.bytedeco.javacpp.indexer.Indexer> I createIndexer()ReturnscreateIndexer(true, 0)
. -
createIndexer
public <I extends org.bytedeco.javacpp.indexer.Indexer> I createIndexer(boolean direct)- Specified by:
createIndexer
in interfaceorg.bytedeco.javacpp.indexer.Indexable
-
createIndexer
public <I extends org.bytedeco.javacpp.indexer.Indexer> I createIndexer(boolean direct, int i)Returns anIndexer
for the ith image plane. -
clone
Care must be taken if this method is to be used in conjunction with movie recordings. Cloning a frame containing a full HD picture (alpha channel included) would take 1920 x 1080 * 4 = 8.294.400 Bytes. Expect a heap overflow exception when using this method without cleaning up.
-