public class VideoFrame
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
VideoFrame.Buffer
Implements image storage medium.
|
static interface |
VideoFrame.ColorSpace |
static interface |
VideoFrame.I420Buffer
Interface for I420 buffers.
|
static interface |
VideoFrame.I422Buffer
Interface for I420 buffers.
|
static interface |
VideoFrame.RgbaBuffer |
static class |
VideoFrame.SourceType |
static interface |
VideoFrame.TextureBuffer
Interface for buffers that are stored as a single texture, either in OES or RGB format.
|
Constructor and Description |
---|
VideoFrame(VideoFrame.Buffer buffer,
int rotation,
long timestampNs)
Constructs a new VideoFrame backed by the given
buffer . |
VideoFrame(VideoFrame.Buffer buffer,
int rotation,
long timestampNs,
VideoFrame.ColorSpace colorSpace,
byte[] alphaBuffer,
float sampleAspectRatio,
int sourceType) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getAlphaBuffer() |
VideoFrame.Buffer |
getBuffer() |
VideoFrame.ColorSpace |
getColorSpace() |
VideoFrameMetaInfo |
getMetaInfo() |
int |
getRotatedHeight() |
int |
getRotatedWidth() |
int |
getRotation()
Rotation of the frame in degrees.
|
float |
getSampleAspectRatio() |
VideoFrame.SourceType |
getSourceType() |
long |
getTimestampNs()
Timestamp of the frame in nano seconds.
|
void |
release()
Decreases inner buffer's ref count by one.
|
void |
replaceBuffer(VideoFrame.Buffer buffer,
int rotation,
long timestampNs)
replace VideoFrame content.
|
void |
retain()
Increases inner buffer's ref count by one.
|
public VideoFrame(VideoFrame.Buffer buffer, int rotation, long timestampNs)
buffer
.buffer
- not allowed to be null, otherwise exception will throwrotation
- must be a multiple of 90, otherwise exception will throwtimestampNs
- in nanosecond, otherwise video frame may not been sentpublic VideoFrame(VideoFrame.Buffer buffer, int rotation, long timestampNs, VideoFrame.ColorSpace colorSpace, byte[] alphaBuffer, float sampleAspectRatio, int sourceType)
public VideoFrame.SourceType getSourceType()
public float getSampleAspectRatio()
public VideoFrame.Buffer getBuffer()
VideoFrame.Buffer
.public int getRotation()
public long getTimestampNs()
public VideoFrameMetaInfo getMetaInfo()
public int getRotatedWidth()
public int getRotatedHeight()
public void replaceBuffer(VideoFrame.Buffer buffer, int rotation, long timestampNs)
public VideoFrame.ColorSpace getColorSpace()
public byte[] getAlphaBuffer()
public void retain()
public void release()