Skip to content

Commit

Permalink
feat: support 3.3.+
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Aug 30, 2021
1 parent c4c1c49 commit ac57d2a
Show file tree
Hide file tree
Showing 64 changed files with 3,675 additions and 701 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
## [3.3.3](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.2...v3.3.3) (2021-04-13)


### Features

* upgrade native SDK to 3.3.2 ([a54feda](https://github.com/AgoraIO-Community/react-native-agora/commit/a54fedab614a80f90450cc789352049f8f1d671f))
* **add example:** channelAudio,liveStream,mediaChannelRelay,streamData ([e4d5ceb](https://github.com/AgoraIO-Community/react-native-agora/commit/e4d5ceb0f42e8ee1a987fc621459eb8b84d25b5c))
* **add voicechange:** add VoiceChange ([c1722cc](https://github.com/AgoraIO-Community/react-native-agora/commit/c1722ccdf1fbfee4b5b6c84ae34e3990b60b18e6))

## [3.3.2](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.2-rc.0...v3.3.2) (2021-03-22)


### Bug Fixes

* iOS selector error ([2d1ac8f](https://github.com/AgoraIO-Community/react-native-agora/commit/2d1ac8f1b902f71c06b0b1729579adf396b58c9b))

## [3.3.2-rc.0](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.1...v3.3.2-rc.0) (2021-03-19)


### Bug Fixes

* support react-native 0.64.0 close [#334](https://github.com/AgoraIO-Community/react-native-agora/issues/334) ([0140754](https://github.com/AgoraIO-Community/react-native-agora/commit/014075441ec3479e7abe84768c3e00b1da2d97fc))

## [3.3.1](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.1-rc.0...v3.3.1) (2021-03-12)

## [3.3.1-rc.0](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.0-rc.1...v3.3.1-rc.0) (2021-03-09)


### Bug Fixes

* annotation build warning ([551ebfe](https://github.com/AgoraIO-Community/react-native-agora/commit/551ebfe3c8dec34cfdf7e006d38523c60123bc58))
* type cast error ([f5af6dc](https://github.com/AgoraIO-Community/react-native-agora/commit/f5af6dc9cec642dd3ae5d1507913141e95dbb71f))
* type cast error ([98c4331](https://github.com/AgoraIO-Community/react-native-agora/commit/98c4331bd97ab1e2dc7216470fc2978c5d4dcd74))


### Features

* add example for `playEffect` ([7987121](https://github.com/AgoraIO-Community/react-native-agora/commit/7987121ff2822c053f327ccdeb60ff17202f6c53))
* support 3.3.1 for Android ([cd7a2cd](https://github.com/AgoraIO-Community/react-native-agora/commit/cd7a2cdaff747cad9d2e386d79589c7299036ff6))
* support 3.3.1 for iOS ([836f3b4](https://github.com/AgoraIO-Community/react-native-agora/commit/836f3b4c87f0c0a478c135a4a6ed0ed4279a446e))
* support 3.3.1 for TS ([b7a1d00](https://github.com/AgoraIO-Community/react-native-agora/commit/b7a1d006bbbd6a635b8cee18c4a50c4a1ab5bbdd))

# [3.3.0-rc.1](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.3.0-rc.0...v3.3.0-rc.1) (2021-01-28)


### Bug Fixes

* type error ([1ffd0f8](https://github.com/AgoraIO-Community/react-native-agora/commit/1ffd0f8923b2968d1d908d4c672ab8c40072635e))

# [3.3.0-rc.0](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.2.2...v3.3.0-rc.0) (2021-01-28)


### Features

* support 3.3.0 for Android ([9c48594](https://github.com/AgoraIO-Community/react-native-agora/commit/9c485942661c0e60c8413f9088b4ed0fa37ae2da))
* support 3.3.0 for iOS ([b422ce8](https://github.com/AgoraIO-Community/react-native-agora/commit/b422ce8e8660067075317e4f0f16a29f5a49b6b7))
* support 3.3.0 for TS ([fc9dd70](https://github.com/AgoraIO-Community/react-native-agora/commit/fc9dd70fd32402f5eed281b4007ffd3aacaf51e0))

## [3.2.2](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.2.1...v3.2.2) (2020-12-28)


Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ yarn test

To edit the Objective-C files, open `example/ios/AgoraExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-agora`.

To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativeagora` under `Android`.
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `react-native-agora` under `Android`.

### Commit message convention

Expand Down
4 changes: 1 addition & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ buildscript {

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Agora_' + name]
Expand Down Expand Up @@ -128,7 +127,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
api "io.agora.rtc:full-sdk:3.2.1"
api "io.agora.rtc:full-sdk:3.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}
86 changes: 84 additions & 2 deletions android/src/main/java/io/agora/rtc/base/Annotations.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.lang.annotation.RetentionPolicy;

import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngineConfig;
import io.agora.rtc.video.BeautyOptions;
import io.agora.rtc.video.VideoCanvas;
Expand Down Expand Up @@ -265,12 +266,14 @@ public class Annotations {
AgoraCameraCaptureOutputPreference.CAPTURER_OUTPUT_PREFERENCE_AUTO,
AgoraCameraCaptureOutputPreference.CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE,
AgoraCameraCaptureOutputPreference.CAPTURER_OUTPUT_PREFERENCE_PREVIEW,
AgoraCameraCaptureOutputPreference.CAPTURER_OUTPUT_PREFERENCE_MANUAL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraCameraCaptureOutputPreference {
int CAPTURER_OUTPUT_PREFERENCE_AUTO = 0;
int CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1;
int CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2;
int CAPTURER_OUTPUT_PREFERENCE_MANUAL = 3;
}

@IntDef({
Expand Down Expand Up @@ -362,6 +365,7 @@ public class Annotations {
Constants.CONNECTION_CHANGED_RENEW_TOKEN,
Constants.CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED,
Constants.CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT,
Constants.CONNECTION_CHANGED_PROXY_SERVER_INTERRUPTED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraConnectionChangedReason {
Expand Down Expand Up @@ -396,6 +400,8 @@ public class Annotations {
AgoraEncryptionMode.AES128ECB,
AgoraEncryptionMode.AES256XTS,
AgoraEncryptionMode.SM4128ECB,
AgoraEncryptionMode.AES128GCM,
AgoraEncryptionMode.AES256GCM,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraEncryptionMode {
Expand All @@ -404,6 +410,8 @@ public class Annotations {
int AES128ECB = 2;
int AES256XTS = 3;
int SM4128ECB = 4;
int AES128GCM = 5;
int AES256GCM = 6;
}

@IntDef({
Expand Down Expand Up @@ -452,6 +460,7 @@ public class Annotations {
Constants.ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR,
Constants.ERR_PUBLISH_STREAM_NOT_FOUND,
Constants.ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED,
Constants.ERR_MODULE_NOT_FOUND,
Constants.ERR_LOAD_MEDIA_ENGINE,
Constants.ERR_START_CALL,
Constants.ERR_START_CAMERA,
Expand Down Expand Up @@ -765,8 +774,7 @@ public class Annotations {
Constants.WARN_ADM_RECORD_IS_OCCUPIED,
Constants.WARN_APM_HOWLING,
Constants.WARN_ADM_GLITCH_STATE,
// TODO(3.3.0) WARN_APM_RESIDUAL_ECHO
Constants.WARN_ADM_IMPROPER_SETTINGS,
Constants.WARN_APM_RESIDUAL_ECHO,
Constants.WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION,
Constants.WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION,
Constants.WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED,
Expand Down Expand Up @@ -845,6 +853,7 @@ public class Annotations {
Constants.CHAT_BEAUTIFIER_MAGNETIC,
Constants.CHAT_BEAUTIFIER_FRESH,
Constants.CHAT_BEAUTIFIER_VITALITY,
Constants.SINGING_BEAUTIFIER,
Constants.TIMBRE_TRANSFORMATION_VIGOROUS,
Constants.TIMBRE_TRANSFORMATION_DEEP,
Constants.TIMBRE_TRANSFORMATION_MELLOW,
Expand All @@ -865,4 +874,77 @@ public class Annotations {
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAudienceLatencyLevelType {
}

@IntDef({
Constants.TRANSPORT_TYPE_NONE_PROXY,
Constants.TRANSPORT_TYPE_UDP_PROXY,
Constants.TRANSPORT_TYPE_TCP_PROXY,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraCloudProxyType {
}

@IntDef({
AgoraLogLevel.LOG_LEVEL_NONE,
AgoraLogLevel.LOG_LEVEL_INFO,
AgoraLogLevel.LOG_LEVEL_WARN,
AgoraLogLevel.LOG_LEVEL_ERROR,
AgoraLogLevel.LOG_LEVEL_FATAL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraLogLevel {
int LOG_LEVEL_NONE = 0;
int LOG_LEVEL_INFO = 1;
int LOG_LEVEL_WARN = 2;
int LOG_LEVEL_ERROR = 4;
int LOG_LEVEL_FATAL = 8;
}

@IntDef({
Constants.CAPTURE_BRIGHTNESS_LEVEL_INVALID,
Constants.CAPTURE_BRIGHTNESS_LEVEL_NORMAL,
Constants.CAPTURE_BRIGHTNESS_LEVEL_BRIGHT,
Constants.CAPTURE_BRIGHTNESS_LEVEL_DARK,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraCaptureBrightnessLevelType {
}

@IntDef({
IRtcEngineEventHandler.UploadErrorReason.UPLOAD_SUCCESS,
IRtcEngineEventHandler.UploadErrorReason.UPLOAD_NET_ERROR,
IRtcEngineEventHandler.UploadErrorReason.UPLOAD_SERVER_ERROR,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraUploadErrorReason {
}

@IntDef({
IRtcEngineEventHandler.ExperienceQuality.EXPERIENCE_GOOD,
IRtcEngineEventHandler.ExperienceQuality.EXPERIENCE_BAD,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraExperienceQualityType {
}

@IntDef({
IRtcEngineEventHandler.ExperiencePoorReason.EXPERIENCE_REASON_NONE,
IRtcEngineEventHandler.ExperiencePoorReason.REMOTE_NETWORK_QUALITY_POOR,
IRtcEngineEventHandler.ExperiencePoorReason.LOCAL_NETWORK_QUALITY_POOR,
IRtcEngineEventHandler.ExperiencePoorReason.WIRELESS_SIGNAL_POOR,
IRtcEngineEventHandler.ExperiencePoorReason.WIFI_BLUETOOTH_COEXIST,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraExperiencePoorReason {
}

@IntDef({
Constants.SR_STATE_REASON_SUCCESS,
Constants.SR_STATE_REASON_STREAM_OVER_LIMITATION,
Constants.SR_STATE_REASON_USER_COUNT_OVER_LIMITATION,
Constants.SR_STATE_REASON_DEVICE_NOT_SUPPORTED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraSuperResolutionStateReason {
}
}
31 changes: 30 additions & 1 deletion android/src/main/java/io/agora/rtc/base/BeanCovertor.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.agora.rtc.base

import android.graphics.Color
import io.agora.rtc.RtcEngineConfig
import io.agora.rtc.internal.EncryptionConfig
import io.agora.rtc.internal.LastmileProbeConfig
import io.agora.rtc.live.LiveInjectStreamConfig
import io.agora.rtc.live.LiveTranscoding
import io.agora.rtc.live.LiveTranscoding.TranscodingUser
import io.agora.rtc.models.ChannelMediaOptions
import io.agora.rtc.models.ClientRoleOptions
import io.agora.rtc.models.DataStreamConfig
import io.agora.rtc.video.*

fun mapToVideoDimensions(map: Map<*, *>): VideoEncoderConfiguration.VideoDimensions {
Expand Down Expand Up @@ -162,7 +164,11 @@ fun mapToCameraCapturerConfiguration(map: Map<*, *>): CameraCapturerConfiguratio
return CameraCapturerConfiguration(
intToCapturerOutputPreference((map["preference"] as Number).toInt()),
intToCameraDirection((map["cameraDirection"] as Number).toInt())
)
).apply {
dimensions = CameraCapturerConfiguration.CaptureDimensions()
(map["captureWidth"] as? Number)?.toInt()?.let { dimensions.width = it }
(map["captureHeight"] as? Number)?.toInt()?.let { dimensions.height = it }
}
}

fun mapToChannelMediaOptions(map: Map<*, *>): ChannelMediaOptions {
Expand All @@ -172,6 +178,14 @@ fun mapToChannelMediaOptions(map: Map<*, *>): ChannelMediaOptions {
}
}

fun mapToRtcEngineConfig(map: Map<*, *>): RtcEngineConfig {
return RtcEngineConfig().apply {
mAppId = map["appId"] as String
(map["areaCode"] as? Number)?.toInt()?.let { mAreaCode = it }
(map["logConfig"] as? Map<*, *>)?.let { mLogConfig = mapToLogConfig(it) }
}
}

fun mapToEncryptionConfig(map: Map<*, *>): EncryptionConfig {
return EncryptionConfig().apply {
(map["encryptionMode"] as? Number)?.let { encryptionMode = intToEncryptionMode(it.toInt()) }
Expand All @@ -184,3 +198,18 @@ fun mapToClientRoleOptions(map: Map<*, *>): ClientRoleOptions {
(map["audienceLatencyLevel"] as? Number)?.let { audienceLatencyLevel = it.toInt() }
}
}

fun mapToLogConfig(map: Map<*, *>): RtcEngineConfig.LogConfig {
return RtcEngineConfig.LogConfig().apply {
(map["filePath"] as? String)?.let { filePath = it }
(map["fileSize"] as? Number)?.let { fileSize = it.toInt() }
(map["level"] as? Number)?.let { level = it.toInt() }
}
}

fun mapToDataStreamConfig(map: Map<*, *>): DataStreamConfig {
return DataStreamConfig().apply {
(map["syncWithAudio"] as? Boolean)?.let { syncWithAudio = it }
(map["ordered"] as? Boolean)?.let { ordered = it }
}
}
8 changes: 6 additions & 2 deletions android/src/main/java/io/agora/rtc/base/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ fun RemoteAudioStats.toMap(): Map<String, Any?> {
"totalFrozenTime" to totalFrozenTime,
"frozenRate" to frozenRate,
"totalActiveTime" to totalActiveTime,
"publishDuration" to publishDuration
"publishDuration" to publishDuration,
"qoeQuality" to qoeQuality,
"qualityChangedReason" to qualityChangedReason,
"mosValue" to mosValue
)
}

Expand All @@ -89,7 +92,8 @@ fun LocalVideoStats.toMap(): Map<String, Any?> {
"encodedFrameCount" to encodedFrameCount,
"codecType" to codecType,
"txPacketLossRate" to txPacketLossRate,
"captureFrameRate" to captureFrameRate
"captureFrameRate" to captureFrameRate,
"captureBrightnessLevel" to captureBrightnessLevel
)
}

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/io/agora/rtc/base/MediaObserver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.util.concurrent.atomic.AtomicInteger
class MediaObserver(
private val emit: (data: Map<String, Any?>?) -> Unit
) : IMetadataObserver {
private var maxMetadataSize = AtomicInteger(0)
private var maxMetadataSize = AtomicInteger(1024)
private var metadataList = Collections.synchronizedList<String>(mutableListOf())

fun addMetadata(metadata: String) {
Expand Down
Loading

0 comments on commit ac57d2a

Please sign in to comment.