Skip to content

Commit

Permalink
feat: Upgrade native sdk 4.3.1 (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl authored May 9, 2024
1 parent 0052cc7 commit 18f1a56
Show file tree
Hide file tree
Showing 82 changed files with 3,721 additions and 1,220 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Download the `iris_web`(see the link below) artifact and include it as a `<scrip
</body>
</html>
```
Download: https://download.agora.io/sdk/release/iris-web-rtc_n430_w4200_0.6.0.js
Download: https://download.agora.io/sdk/release/iris-web-rtc_n430_w4200_0.7.0.js

**For Testing Purposes**

Expand All @@ -101,7 +101,7 @@ You can directly depend on the Agora CDN for testing purposes:
...
<body>
...
<script src="https://download.agora.io/sdk/release/iris-web-rtc_n430_w4200_0.6.0.js"></script>
<script src="https://download.agora.io/sdk/release/iris-web-rtc_n430_w4200_0.7.0.js"></script>
</body>
</html>
```
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ dependencies {
if (isDev(project)) {
api fileTree(dir: "libs", include: ["*.jar"])
} else {
api 'io.agora.rtc:iris-rtc:4.3.0-build.2'
api 'io.agora.rtc:full-sdk:4.3.0'
api 'io.agora.rtc:full-screen-sharing:4.3.0'
api 'io.agora.rtc:iris-rtc:4.3.1-build.1'
api 'io.agora.rtc:full-sdk:4.3.1'
api 'io.agora.rtc:full-screen-sharing:4.3.1'
}
}

Expand Down
12 changes: 10 additions & 2 deletions android/src/main/cpp/iris_rtc_rendering_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ class Texture2DRendering final : public RenderingOp {
CHECK_GL_ERROR()
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
CHECK_GL_ERROR()
glViewport(0, 0, video_frame->width, video_frame->height);
CHECK_GL_ERROR()

// Bind 2D texture
glActiveTexture(GL_TEXTURE0);
Expand Down Expand Up @@ -409,6 +411,8 @@ class OESTextureRendering final : public RenderingOp {
CHECK_GL_ERROR()
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
CHECK_GL_ERROR()
glViewport(0, 0, video_frame->width, video_frame->height);
CHECK_GL_ERROR()

// Bind external oes texture
glActiveTexture(GL_TEXTURE0);
Expand Down Expand Up @@ -528,6 +532,8 @@ class YUVRendering final : public RenderingOp {
CHECK_GL_ERROR()
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
CHECK_GL_ERROR()
glViewport(0, 0, width, height);
CHECK_GL_ERROR()

glEnableVertexAttribArray(aPositionLoc_);
CHECK_GL_ERROR()
Expand All @@ -538,8 +544,8 @@ class YUVRendering final : public RenderingOp {

// Adjust the tex coords to avoid green edge issue
float sFactor = 1.0f;
if (video_frame->width != video_frame->yStride) {
sFactor = (float) video_frame->width / (float) video_frame->yStride - 0.02f;
if (width != yStride) {
sFactor = (float) width / (float) yStride - 0.02f;
}

float fragment[] = {sFactor, 0.0f, 0.0f, 0.0f, sFactor, 1.0f, 0.0f, 1.0f};
Expand Down Expand Up @@ -704,6 +710,8 @@ class NativeTextureRenderer final
strcpy(config.channelId, "");
}
config.video_view_setup_mode = video_view_setup_mode;
config.observed_frame_position = agora::media::base::VIDEO_MODULE_POSITION::POSITION_POST_CAPTURER
| agora::media::base::VIDEO_MODULE_POSITION::POSITION_PRE_RENDERER;

if (iris_rtc_rendering_) {
delegate_id_ =
Expand Down
125 changes: 115 additions & 10 deletions android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,19 @@ enum ERROR_CODE_TYPE {
*/
ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
/**
* 120: Decryption fails. The user may have tried to join the channel with a wrong
* 120: MediaStream decryption fails. The user may have tried to join the channel with a wrong
* password. Check your settings or try rejoining the channel.
*/
ERR_DECRYPTION_FAILED = 120,
/**
* 121: The user ID is invalid.
*/
ERR_INVALID_USER_ID = 121,
/**
* 122: DataStream decryption fails. The peer may have tried to join the channel with a wrong
* password, or did't enable datastream encryption
*/
ERR_DATASTREAM_DECRYPTION_FAILED = 122,
/**
* 123: The app is banned by the server.
*/
Expand Down Expand Up @@ -1167,8 +1172,9 @@ enum VIDEO_CODEC_TYPE {
*/
VIDEO_CODEC_GENERIC_H264 = 7,
/**
* 12: AV1.
*/
* 12: AV1.
* @technical preview
*/
VIDEO_CODEC_AV1 = 12,
/**
* 13: VP9.
Expand All @@ -1180,6 +1186,28 @@ enum VIDEO_CODEC_TYPE {
VIDEO_CODEC_GENERIC_JPEG = 20,
};

/**
* Camera focal length type.
*/
enum CAMERA_FOCAL_LENGTH_TYPE {
/**
* By default, there are no wide-angle and ultra-wide-angle properties.
*/
CAMERA_FOCAL_LENGTH_DEFAULT = 0,
/**
* Lens with focal length from 24mm to 35mm.
*/
CAMERA_FOCAL_LENGTH_WIDE_ANGLE = 1,
/**
* Lens with focal length of less than 24mm.
*/
CAMERA_FOCAL_LENGTH_ULTRA_WIDE = 2,
/**
* Telephoto lens.
*/
CAMERA_FOCAL_LENGTH_TELEPHOTO = 3,
};

/**
* The CC (Congestion Control) mode options.
*/
Expand Down Expand Up @@ -1567,7 +1595,8 @@ struct EncodedVideoFrameInfo {
trackId(0),
captureTimeMs(0),
decodeTimeMs(0),
streamType(VIDEO_STREAM_HIGH) {}
streamType(VIDEO_STREAM_HIGH),
presentationMs(-1) {}

EncodedVideoFrameInfo(const EncodedVideoFrameInfo& rhs)
: uid(rhs.uid),
Expand All @@ -1580,7 +1609,8 @@ struct EncodedVideoFrameInfo {
trackId(rhs.trackId),
captureTimeMs(rhs.captureTimeMs),
decodeTimeMs(rhs.decodeTimeMs),
streamType(rhs.streamType) {}
streamType(rhs.streamType),
presentationMs(rhs.presentationMs) {}

EncodedVideoFrameInfo& operator=(const EncodedVideoFrameInfo& rhs) {
if (this == &rhs) return *this;
Expand All @@ -1595,6 +1625,7 @@ struct EncodedVideoFrameInfo {
captureTimeMs = rhs.captureTimeMs;
decodeTimeMs = rhs.decodeTimeMs;
streamType = rhs.streamType;
presentationMs = rhs.presentationMs;
return *this;
}

Expand Down Expand Up @@ -1646,6 +1677,8 @@ struct EncodedVideoFrameInfo {
*/
VIDEO_STREAM_TYPE streamType;

// @technical preview
int64_t presentationMs;
};

/**
Expand Down Expand Up @@ -1766,6 +1799,14 @@ struct CodecCapInfo {
CodecCapInfo(): codecType(VIDEO_CODEC_NONE), codecCapMask(0) {}
};

/** FocalLengthInfo contains the IDs of the front and rear cameras, along with the wide-angle types. */
struct FocalLengthInfo {
/** The camera direction. */
int cameraDirection;
/** Camera focal segment type. */
CAMERA_FOCAL_LENGTH_TYPE focalLengthType;
};

/**
* The definition of the VideoEncoderConfiguration struct.
*/
Expand Down Expand Up @@ -2639,6 +2680,27 @@ enum CAPTURE_BRIGHTNESS_LEVEL_TYPE {
CAPTURE_BRIGHTNESS_LEVEL_DARK = 2,
};

enum CAMERA_STABILIZATION_MODE {
/** The camera stabilization mode is disabled.
*/
CAMERA_STABILIZATION_MODE_OFF = -1,
/** device choose stabilization mode automatically.
*/
CAMERA_STABILIZATION_MODE_AUTO = 0,
/** stabilization mode level 1.
*/
CAMERA_STABILIZATION_MODE_LEVEL_1 = 1,
/** stabilization mode level 2.
*/
CAMERA_STABILIZATION_MODE_LEVEL_2 = 2,
/** stabilization mode level 3.
*/
CAMERA_STABILIZATION_MODE_LEVEL_3 = 3,
/** The maximum level of the camera stabilization mode.
*/
CAMERA_STABILIZATION_MODE_MAX_LEVEL = CAMERA_STABILIZATION_MODE_LEVEL_3,
};

/**
* Local audio states.
*/
Expand Down Expand Up @@ -2792,6 +2854,16 @@ enum LOCAL_VIDEO_STREAM_REASON {
* Check whether the ID of the video device is valid.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_INVALID_ID = 10,
/**
* 14: (Android only) Video capture was interrupted, possibly due to the camera being occupied
* or some policy reasons such as background termination.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_INTERRUPT = 14,
/**
* 15: (Android only) The device may need to be shut down and restarted to restore camera function,
* or there may be a persistent hardware problem.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_FATAL_ERROR = 15,
/**
* 101: The current video capture device is unavailable due to excessive system pressure.
*/
Expand Down Expand Up @@ -2835,7 +2907,7 @@ enum LOCAL_VIDEO_STREAM_REASON {
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_HIDDEN = 25,
/** 26: (Windows only) The local screen capture window is recovered from its hidden state. */
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26,
/** 27:(Windows only) The window is recovered from miniminzed */
/** 27: (Windows and macOS only) The window is recovered from miniminzed */
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27,
/**
* 28: The screen capture paused.
Expand Down Expand Up @@ -2924,6 +2996,14 @@ enum REMOTE_AUDIO_STATE_REASON
* 7: The remote user leaves the channel.
*/
REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7,
/**
* 8: The local user does not receive any audio packet from remote user.
*/
REMOTE_AUDIO_REASON_NO_PACKET_RECEIVE = 8,
/**
* 9: The local user receives remote audio packet but fails to play.
*/
REMOTE_AUDIO_REASON_LOCAL_PLAY_FAILED = 9,
};

/**
Expand Down Expand Up @@ -4686,6 +4766,7 @@ enum VOICE_BEAUTIFIER_PRESET {
* - `ROOM_ACOUSTICS_PHONOGRAPH`
* - `ROOM_ACOUSTICS_SPACIAL`
* - `ROOM_ACOUSTICS_ETHEREAL`
* - `ROOM_ACOUSTICS_CHORUS`
* - `VOICE_CHANGER_EFFECT_UNCLE`
* - `VOICE_CHANGER_EFFECT_OLDMAN`
* - `VOICE_CHANGER_EFFECT_BOY`
Expand Down Expand Up @@ -4747,6 +4828,14 @@ enum AUDIO_EFFECT_PRESET {
* setting this enumerator.
*/
ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND = 0x02010900,
/** The voice effect for chorus.
*
* @note: To achieve better audio effect quality, Agora recommends calling \ref
* IRtcEngine::setAudioProfile "setAudioProfile" and setting the `profile` parameter to
* `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
* setting this enumerator.
*/
ROOM_ACOUSTICS_CHORUS = 0x02010D00,
/** A middle-aged man's voice.
*
* @note
Expand Down Expand Up @@ -5534,10 +5623,13 @@ struct EncryptionConfig {
* In this case, ensure that this parameter is not 0.
*/
uint8_t encryptionKdfSalt[32];

bool datastreamEncryptionEnabled;

EncryptionConfig()
: encryptionMode(AES_128_GCM2),
encryptionKey(OPTIONAL_NULLPTR)
encryptionKey(OPTIONAL_NULLPTR),
datastreamEncryptionEnabled(false)
{
memset(encryptionKdfSalt, 0, sizeof(encryptionKdfSalt));
}
Expand Down Expand Up @@ -5577,13 +5669,21 @@ enum ENCRYPTION_ERROR_TYPE {
*/
ENCRYPTION_ERROR_INTERNAL_FAILURE = 0,
/**
* 1: Decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
* 1: MediaStream decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
*/
ENCRYPTION_ERROR_DECRYPTION_FAILURE = 1,
/**
* 2: Encryption errors.
* 2: MediaStream encryption errors.
*/
ENCRYPTION_ERROR_ENCRYPTION_FAILURE = 2,
/**
* 3: DataStream decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
*/
ENCRYPTION_ERROR_DATASTREAM_DECRYPTION_FAILURE = 3,
/**
* 4: DataStream encryption errors.
*/
ENCRYPTION_ERROR_DATASTREAM_ENCRYPTION_FAILURE = 4,
};

enum UPLOAD_ERROR_REASON
Expand Down Expand Up @@ -5717,7 +5817,12 @@ enum EAR_MONITORING_FILTER_TYPE {
/**
* 4: Enable noise suppression to the in-ear monitor.
*/
EAR_MONITORING_FILTER_NOISE_SUPPRESSION = (1<<2)
EAR_MONITORING_FILTER_NOISE_SUPPRESSION = (1<<2),
/**
* 32768: Enable audio filters by reuse post-processing filter to the in-ear monitor.
* This bit is intended to be used in exclusive mode, which means, if this bit is set, all other bits will be disregarded.
*/
EAR_MONITORING_FILTER_REUSE_POST_PROCESSING_FILTER = (1<<15),
};

/**
Expand Down
Loading

0 comments on commit 18f1a56

Please sign in to comment.