Agora Java API Reference for Android
Classes | Public Member Functions | Static Public Member Functions | List of all members
io.agora.rtc.gl.VideoFrame Class Reference

Classes

interface  Buffer
 
interface  I420Buffer
 
interface  TextureBuffer
 

Public Member Functions

 VideoFrame (Buffer buffer, int rotation, long timestampNs)
 
Buffer getBuffer ()
 
int getRotation ()
 
long getTimestampNs ()
 
int getRotatedWidth ()
 
int getRotatedHeight ()
 
void retain ()
 
void release ()
 

Static Public Member Functions

static Buffer cropAndScaleI420 (final I420Buffer buffer, int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
 

Detailed Description

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.

Member Function Documentation

◆ getRotation()

int io.agora.rtc.gl.VideoFrame.getRotation ( )

Rotation of the frame in degrees.

◆ getTimestampNs()

long io.agora.rtc.gl.VideoFrame.getTimestampNs ( )

Timestamp of the frame in nano seconds.

◆ retain()

void io.agora.rtc.gl.VideoFrame.retain ( )

Reference counting of the underlying buffer.