Skip to content

Commit

Permalink
Merge pull request #3839 from AgoraIO/auto/sync-cn-proto-to-en-patch-…
Browse files Browse the repository at this point in the history
…1732247354
  • Loading branch information
github-actions[bot] authored Nov 22, 2024
2 parents 28425ec + e92c2a4 commit ff38605
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions en-US/dita/RTC-NG/API/class_videoframe.dita
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public class VideoFrame implements RefCounted {

public interface Buffer extends RefCounted {

@CalledByNative(&quot;Buffer&quot;) int getWidth();

@CalledByNative(&quot;Buffer&quot;) int getHeight();

@CalledByNative(&quot;Buffer&quot;) I420Buffer toI420();

@Override @CalledByNative(&quot;Buffer&quot;) void release();

@Override @CalledByNative(&quot;Buffer&quot;) void retain();

@CalledByNative(&quot;Buffer&quot;)
Buffer cropAndScale(
int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight);

@CalledByNative(&quot;Buffer&quot;) @Nullable Buffer mirror(int frameRotation);

@CalledByNative(&quot;Buffer&quot;) @Nullable Buffer rotate(int frameRotation);

@CalledByNative(&quot;Buffer&quot;)
@Nullable
Buffer transform(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth,
int scaleHeight, int frameRotation);
}

public interface I420Buffer extends Buffer {

@CalledByNative(&quot;I420Buffer&quot;) ByteBuffer getDataY();

@CalledByNative(&quot;I420Buffer&quot;) ByteBuffer getDataU();

@CalledByNative(&quot;I420Buffer&quot;) ByteBuffer getDataV();
@CalledByNative(&quot;I420Buffer&quot;) int getStrideY();
@CalledByNative(&quot;I420Buffer&quot;) int getStrideU();
@CalledByNative(&quot;I420Buffer&quot;) int getStrideV();
}

public interface I422Buffer extends Buffer {
@CalledByNative(&quot;I422Buffer&quot;) ByteBuffer getDataY();
@CalledByNative(&quot;I422Buffer&quot;) ByteBuffer getDataU();
Expand All @@ -55,13 +55,13 @@
@CalledByNative(&quot;I422Buffer&quot;) int getStrideV();
}
public interface RgbaBuffer extends Buffer { @CalledByNative(&quot;RgbaBuffer&quot;) 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) {
Expand All @@ -76,17 +76,17 @@
EGL_CONTEXT_14;
}
Type getType();

@CalledByNative(&quot;TextureBuffer&quot;) int getTextureId();

Matrix getTransformMatrix();

@CalledByNative(&quot;TextureBuffer&quot;) EglBase.Context getEglBaseContext();
@CalledByNative(&quot;TextureBuffer&quot;) Object getSourceTexturePool();
@CalledByNative(&quot;TextureBuffer&quot;) long getNativeEglContext();
@CalledByNative(&quot;TextureBuffer&quot;) int getEglContextType();
@CalledByNative(&quot;TextureBuffer&quot;) float[] getTransformMatrixArray();

@CalledByNative(&quot;TextureBuffer&quot;) int getSequence();
@CalledByNative(&quot;TextureBuffer&quot;) long getFenceObject();
@CalledByNative(&quot;TextureBuffer&quot;) boolean is10BitTexture();
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -243,12 +243,12 @@
public float getSampleAspectRatio() {
return sampleAspectRatio;
}

@CalledByNative
public Buffer getBuffer() {
return buffer;
}

@CalledByNative
public int getRotation() {
return rotation;
Expand All @@ -261,7 +261,7 @@
public void setAlphaStitchMode(int stitchMode) {
alphaStitchMode = AlphaStitchMode.values()[stitchMode];
}

@CalledByNative
public long getTimestampNs() {
return timestampNs;
Expand All @@ -270,7 +270,7 @@
public VideoFrameMetaInfo getMetaInfo() {
return metaInfo;
}

public int getRotatedWidth() {
if (rotation % 180 == 0) {
return (alphaStitchMode == AlphaStitchMode.ALPHA_STITCH_LEFT
Expand All @@ -283,7 +283,7 @@
? buffer.getHeight() / 2
: buffer.getHeight();
}

public int getRotatedHeight() {
if (rotation % 180 == 0) {
return (alphaStitchMode == AlphaStitchMode.ALPHA_STITCH_UP
Expand All @@ -296,7 +296,7 @@
? buffer.getWidth() / 2
: buffer.getWidth();
}

public void replaceBuffer(Buffer buffer, int rotation, long timestampNs) {
release();
this.buffer = buffer;
Expand Down Expand Up @@ -351,12 +351,12 @@
public void fillAlphaData(ByteBuffer buffer) {
alphaBuffer = buffer;
}

@Override
public void retain() {
buffer.retain();
}

@Override
@CalledByNative
public void release() {
Expand Down Expand Up @@ -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;
};</codeblock>
<codeblock props="bp" outputclass="language-cpp">USTRUCT(BlueprintType)
Expand Down

0 comments on commit ff38605

Please sign in to comment.