Agora Java API Reference for Android
|
Classes | |
interface | Buffer |
interface | ColorSpace |
interface | I420Buffer |
interface | TextureBuffer |
Public Member Functions | |
VideoFrame (Buffer buffer, int rotation, long timestampNs) | |
VideoFrame (Buffer buffer, int rotation, long timestampNs, ColorSpace colorSpace) | |
Buffer | getBuffer () |
int | getRotation () |
long | getTimestampNs () |
VideoFrameMetaInfo | getMetaInfo () |
int | getRotatedWidth () |
int | getRotatedHeight () |
void | replaceBuffer (Buffer buffer, int rotation, long timestampNs) |
ColorSpace | getColorSpace () |
void | retain () |
void | release () |
Java version of webrtc::VideoFrame and webrtc::VideoFrameBuffer. A difference from the C++ version is that no explicit tag is used, and clients are expected to use 'instanceof' to find the right subclass of the buffer. This allows clients to create custom VideoFrame.Buffer in arbitrary format in their custom VideoSources, and then cast it back to the correct subclass in their custom VideoSinks. All implementations must also implement the toI420() function, converting from the underlying representation if necessary. I420 is the most widely accepted format and serves as a fallback for video sinks that can only handle I420, e.g. the internal WebRTC software encoders.
io.agora.base.VideoFrame.VideoFrame | ( | Buffer | buffer, |
int | rotation, | ||
long | timestampNs | ||
) |
Constructs a new VideoFrame backed by the given
.
buffer | not allowed to be null, otherwise exception will throw |
rotation | must be a multiple of 90, otherwise exception will throw |
timestampNs | in nanosecond, otherwise video frame may not been sent |
int io.agora.base.VideoFrame.getRotation | ( | ) |
Rotation of the frame in degrees.
long io.agora.base.VideoFrame.getTimestampNs | ( | ) |
Timestamp of the frame in nano seconds.
int io.agora.base.VideoFrame.getRotatedWidth | ( | ) |
int io.agora.base.VideoFrame.getRotatedHeight | ( | ) |
void io.agora.base.VideoFrame.replaceBuffer | ( | Buffer | buffer, |
int | rotation, | ||
long | timestampNs | ||
) |
replace VideoFrame content.
void io.agora.base.VideoFrame.retain | ( | ) |
Increases inner buffer's ref count by one.
void io.agora.base.VideoFrame.release | ( | ) |
Decreases inner buffer's ref count by one. When the ref count reaches zero, resources related to the inner buffer will be freed.