public class VideoFrame implements RefCounted {
-
+
public interface Buffer extends RefCounted {
-
+
@CalledByNative("Buffer") int getWidth();
-
+
@CalledByNative("Buffer") int getHeight();
-
+
@CalledByNative("Buffer") I420Buffer toI420();
-
+
@Override @CalledByNative("Buffer") void release();
-
+
@Override @CalledByNative("Buffer") void retain();
-
+
@CalledByNative("Buffer")
Buffer cropAndScale(
int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight);
-
+
@CalledByNative("Buffer") @Nullable Buffer mirror(int frameRotation);
-
+
@CalledByNative("Buffer") @Nullable Buffer rotate(int frameRotation);
-
+
@CalledByNative("Buffer")
@Nullable
Buffer transform(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth,
int scaleHeight, int frameRotation);
}
-
+
public interface I420Buffer extends Buffer {
-
+
@CalledByNative("I420Buffer") ByteBuffer getDataY();
-
+
@CalledByNative("I420Buffer") ByteBuffer getDataU();
-
+
@CalledByNative("I420Buffer") ByteBuffer getDataV();
@CalledByNative("I420Buffer") int getStrideY();
@CalledByNative("I420Buffer") int getStrideU();
@CalledByNative("I420Buffer") int getStrideV();
}
-
+
public interface I422Buffer extends Buffer {
@CalledByNative("I422Buffer") ByteBuffer getDataY();
@CalledByNative("I422Buffer") ByteBuffer getDataU();
@@ -55,13 +55,13 @@
@CalledByNative("I422Buffer") int getStrideV();
}
public interface RgbaBuffer extends Buffer { @CalledByNative("RgbaBuffer") ByteBuffer getData(); }
-
+
public interface TextureBuffer extends Buffer {
-
+
enum Type {
-
+
OES(GLES11Ext.GL_TEXTURE_EXTERNAL_OES),
-
+
RGB(GLES20.GL_TEXTURE_2D);
private final int glTarget;
private Type(final int glTarget) {
@@ -76,17 +76,17 @@
EGL_CONTEXT_14;
}
Type getType();
-
+
@CalledByNative("TextureBuffer") int getTextureId();
-
+
Matrix getTransformMatrix();
-
+
@CalledByNative("TextureBuffer") EglBase.Context getEglBaseContext();
@CalledByNative("TextureBuffer") Object getSourceTexturePool();
@CalledByNative("TextureBuffer") long getNativeEglContext();
@CalledByNative("TextureBuffer") int getEglContextType();
@CalledByNative("TextureBuffer") float[] getTransformMatrixArray();
-
+
@CalledByNative("TextureBuffer") int getSequence();
@CalledByNative("TextureBuffer") long getFenceObject();
@CalledByNative("TextureBuffer") boolean is10BitTexture();
@@ -198,22 +198,22 @@
return stitchMode;
}
}
-
+
private Buffer buffer;
-
+
private int rotation;
-
+
private long timestampNs;
private ColorSpace colorSpace;
private SourceType sourceType;
private float sampleAspectRatio;
-
+
private AlphaStitchMode alphaStitchMode = AlphaStitchMode.ALPHA_NO_STITCH;
private VideoFrameMetaInfo metaInfo = new VideoFrameMetaInfo();
-
+
private @Nullable ByteBuffer alphaBuffer;
private long nativeAlphaBuffer;
-
+
public VideoFrame(Buffer buffer, int rotation, long timestampNs) {
this(buffer, rotation, timestampNs, new WrappedNativeColorSpace(), null, 0L, 1.0f,
SourceType.kUnspecified.ordinal());
@@ -243,12 +243,12 @@
public float getSampleAspectRatio() {
return sampleAspectRatio;
}
-
+
@CalledByNative
public Buffer getBuffer() {
return buffer;
}
-
+
@CalledByNative
public int getRotation() {
return rotation;
@@ -261,7 +261,7 @@
public void setAlphaStitchMode(int stitchMode) {
alphaStitchMode = AlphaStitchMode.values()[stitchMode];
}
-
+
@CalledByNative
public long getTimestampNs() {
return timestampNs;
@@ -270,7 +270,7 @@
public VideoFrameMetaInfo getMetaInfo() {
return metaInfo;
}
-
+
public int getRotatedWidth() {
if (rotation % 180 == 0) {
return (alphaStitchMode == AlphaStitchMode.ALPHA_STITCH_LEFT
@@ -283,7 +283,7 @@
? buffer.getHeight() / 2
: buffer.getHeight();
}
-
+
public int getRotatedHeight() {
if (rotation % 180 == 0) {
return (alphaStitchMode == AlphaStitchMode.ALPHA_STITCH_UP
@@ -296,7 +296,7 @@
? buffer.getWidth() / 2
: buffer.getWidth();
}
-
+
public void replaceBuffer(Buffer buffer, int rotation, long timestampNs) {
release();
this.buffer = buffer;
@@ -351,12 +351,12 @@
public void fillAlphaData(ByteBuffer buffer) {
alphaBuffer = buffer;
}
-
+
@Override
public void retain() {
buffer.retain();
}
-
+
@Override
@CalledByNative
public void release() {
@@ -431,51 +431,51 @@ struct VideoFrame {
metaInfo(NULL){
memset(matrix, 0, sizeof(matrix));
}
-
+
VIDEO_PIXEL_FORMAT type;
-
+
int width;
-
+
int height;
-
+
int yStride;
-
+
int uStride;
-
+
int vStride;
-
+
uint8_t* yBuffer;
-
+
uint8_t* uBuffer;
-
+
uint8_t* vBuffer;
-
+
int rotation;
-
+
int64_t renderTimeMs;
-
+
int avsync_type;
-
+
uint8_t* metadata_buffer;
-
+
int metadata_size;
-
+
void* sharedContext;
-
+
int textureId;
-
+
void* d3d11Texture2d;
-
+
float matrix[16];
-
+
uint8_t* alphaBuffer;
-
+
ALPHA_STITCH_MODE alphaStitchMode;
-
+
void* pixelBuffer;
-
+
IVideoFrameMetaInfo* metaInfo;
-
+
ColorSpace colorSpace;
};
USTRUCT(BlueprintType)
@@ -742,19 +742,6 @@ class VideoFrame {
缓冲区给出的是指向指针的指针,该接口不能修改缓冲区的指针,只能修改缓冲区的内容。
-
- 方法
-
-
- getColorSpace
- 获取视频帧的色彩空间属性。
-
-
- setColorSpace
- 设置视频帧的色彩空间属性。
-
-
-
diff --git a/dita/RTC-NG/RTC_NG_API_Android.ditamap b/dita/RTC-NG/RTC_NG_API_Android.ditamap
index 7bb07b2d790..96b00956087 100644
--- a/dita/RTC-NG/RTC_NG_API_Android.ditamap
+++ b/dita/RTC-NG/RTC_NG_API_Android.ditamap
@@ -469,6 +469,7 @@
+
diff --git a/dita/RTC-NG/config/keys-rtc-ng-api-java.ditamap b/dita/RTC-NG/config/keys-rtc-ng-api-java.ditamap
index 00946ab6624..baf188eaf26 100644
--- a/dita/RTC-NG/config/keys-rtc-ng-api-java.ditamap
+++ b/dita/RTC-NG/config/keys-rtc-ng-api-java.ditamap
@@ -945,6 +945,13 @@