Package com.sinch.android.rtc.video
Interface VideoFrame
-
- All Known Implementing Classes:
VideoFrame.DefaultVideoFrame
public interface VideoFrame
Interface for representing video frame. Check color format by usinggetColorFormat()
. Most used format is ImageFormat.YUV_420_888 which is I420 format that uses planar or semi-planar (but not fully interleaved) memory layout - do not assume continuity and use useyuvPlanes()
andyuvStrides()
APIs to get correct start line of any plane. NB: do not assume that ByteBuffers ofyuvPlanes()
are backed by Java's byte[] arrays! Most probably frame you receive via this API is natively allocated and NOT backed by Java array. Use slow but secureByteBuffer.put(int, byte)
or better, your own native C++ processing via JNI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
VideoFrame.DefaultVideoFrame
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getColorFormat()
int
getRotation()
int
height()
int
width()
java.nio.ByteBuffer[]
yuvPlanes()
int[]
yuvStrides()
-
-
-
Method Detail
-
width
int width()
- Returns:
- The frame width.
-
height
int height()
- Returns:
- The frame height.
-
yuvStrides
int[] yuvStrides()
- Returns:
- The frame strides for each plane.
-
yuvPlanes
java.nio.ByteBuffer[] yuvPlanes()
- Returns:
- The Y, U and V planes array.
-
getColorFormat
int getColorFormat()
- Returns:
- color format of YUV frame as in
ImageFormat
.
-
getRotation
int getRotation()
- Returns:
- the degree that the frame must be rotated clockwisely to be rendered correctly.
-
-