Skip to content

Commit

Permalink
Merge pull request #7 from AgoraIO/rc/3.1.2
Browse files Browse the repository at this point in the history
Merge Rc/3.1.2 to doc
  • Loading branch information
yamasite authored Sep 29, 2020
2 parents d37cf87 + 05ba8fa commit 09f411c
Show file tree
Hide file tree
Showing 42 changed files with 3,666 additions and 3,970 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.idea
.vscode
*.iml
gitpull.sh
gitpush.sh

.packages
.pub/
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

## 3.1.2
* upgrade Agora SDK to 3.1.2

## 3.0.1-dev.7
* fix android `VideoSizeChanged` bug

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ You can refer to this [pull request](https://github.com/flutter/engine/pull/1432

## How to contribute

To help work on this sdk, see our [contributor guide](CONTRIBUTING.md).
To help work on this sdk, see our [contributor guide](https://github.com/AgoraIO/Flutter-SDK/blob/master/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Agora 视频 SDK 需要 `摄像头` 和 `麦克风` 权限来开始视频通话

## 参与贡献

为了提升 SDK 的质量和易用性, 请参考我们的 [贡献说明](CONTRIBUTING.md).
为了提升 SDK 的质量和易用性, 请参考我们的 [贡献说明](https://github.com/AgoraIO/Flutter-SDK/blob/master/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${safeExtGet('kotlin_version', '1.3.72')}"
implementation "org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlin_version', '1.3.72')}"
implementation "io.agora.rtc:full-sdk:3.0.1.1"
implementation "io.agora.rtc:full-sdk:3.1.2"
}
91 changes: 55 additions & 36 deletions android/src/main/java/io/agora/rtc/base/Annotations.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package io.agora.rtc.base;

import androidx.annotation.IntDef;
import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import io.agora.rtc.Constants;
import io.agora.rtc.IMetadataObserver;
import io.agora.rtc.RtcEngineConfig;
import io.agora.rtc.video.BeautyOptions;
import io.agora.rtc.video.VideoCanvas;

@SuppressWarnings("deprecation")
public class Annotations {

@IntDef({
AgoraRtcAppType.NATIVE,
AgoraRtcAppType.COCOS,
Expand Down Expand Up @@ -131,15 +130,6 @@ public class Annotations {
public @interface AgoraAudioProfile {
}

@IntDef({
Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY,
Constants.RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY,
Constants.RAW_AUDIO_FRAME_OP_MODE_READ_WRITE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAudioRawFrameOperationMode {
}

@IntDef({
Constants.AUDIO_RECORDING_QUALITY_LOW,
Constants.AUDIO_RECORDING_QUALITY_MEDIUM,
Expand Down Expand Up @@ -386,16 +376,20 @@ public class Annotations {
int MAINTAIN_BALANCED = 2;
}

@StringDef({
@IntDef({
AgoraEncryptionMode.NONE,
AgoraEncryptionMode.AES128XTS,
AgoraEncryptionMode.AES256XTS,
AgoraEncryptionMode.AES128ECB,
AgoraEncryptionMode.AES256XTS,
AgoraEncryptionMode.SM4128ECB,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraEncryptionMode {
String AES128XTS = "aes-128-xts";
String AES256XTS = "aes-256-xts";
String AES128ECB = "aes-128-ecb";
int NONE = 0;
int AES128XTS = 1;
int AES128ECB = 2;
int AES256XTS = 3;
int SM4128ECB = 4;
}

@IntDef({
Expand All @@ -419,6 +413,7 @@ public class Annotations {
Constants.ERR_ALREADY_IN_USE,
Constants.ERR_INVALID_APP_ID,
Constants.ERR_INVALID_CHANNEL_NAME,
Constants.ERR_NO_SERVER_RESOURCES,
Constants.ERR_TOKEN_EXPIRED,
Constants.ERR_INVALID_TOKEN,
Constants.ERR_CONNECTION_INTERRUPTED,
Expand Down Expand Up @@ -543,24 +538,6 @@ public class Annotations {
public @interface AgoraLogFilter {
}

@IntDef({
Constants.MEDIA_TYPE_NONE,
Constants.MEDIA_TYPE_AUDIO_ONLY,
Constants.MEDIA_TYPE_VIDEO_ONLY,
Constants.MEDIA_TYPE_AUDIO_AND_VIDEO,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraMediaType {
}

@IntDef({
IMetadataObserver.UNKNOWN_METADATA,
IMetadataObserver.VIDEO_METADATA,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraMetadataType {
}

@IntDef({
Constants.QUALITY_UNKNOWN,
Constants.QUALITY_EXCELLENT,
Expand Down Expand Up @@ -766,15 +743,57 @@ public class Annotations {
Constants.WARN_ADM_RUNTIME_PLAYOUT_WARNING,
Constants.WARN_ADM_RUNTIME_RECORDING_WARNING,
Constants.WARN_ADM_RECORD_AUDIO_SILENCE,
Constants.WARN_ADM_PLAYOUT_ABNORMAL_FREQUENCY,
Constants.WARN_ADM_RECORD_ABNORMAL_FREQUENCY,
Constants.WARN_ADM_CALL_INTERRUPTION,
Constants.WARN_ADM_RECORD_AUDIO_LOWLEVEL,
Constants.WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL,
Constants.WARN_ADM_RECORD_IS_OCCUPIED,
Constants.WARN_APM_HOWLING,
Constants.WARN_ADM_GLITCH_STATE,
Constants.WARN_ADM_IMPROPER_SETTINGS,
Constants.WARN_APM_RESIDUAL_ECHO,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraWarningCode {
}

@IntDef({
RtcEngineConfig.AreaCode.AREA_CODE_CN,
RtcEngineConfig.AreaCode.AREA_CODE_NA,
RtcEngineConfig.AreaCode.AREA_CODE_EU,
RtcEngineConfig.AreaCode.AREA_CODE_AS,
RtcEngineConfig.AreaCode.AREA_CODE_JP,
RtcEngineConfig.AreaCode.AREA_CODE_IN,
RtcEngineConfig.AreaCode.AREA_CODE_GLOB,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAreaCode {
}

@IntDef({
Constants.SUB_STATE_IDLE,
Constants.SUB_STATE_NO_SUBSCRIBED,
Constants.SUB_STATE_SUBSCRIBING,
Constants.SUB_STATE_SUBSCRIBED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraStreamSubscribeState {
}

@IntDef({
Constants.PUB_STATE_IDLE,
Constants.PUB_STATE_NO_PUBLISHED,
Constants.PUB_STATE_PUBLISHING,
Constants.PUB_STATE_PUBLISHED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraStreamPublishState {
}

@IntDef({
Constants.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraRtmpStreamingEvent {
}
}
8 changes: 8 additions & 0 deletions android/src/main/java/io/agora/rtc/base/BeanCovertor.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.agora.rtc.base

import android.graphics.Color
import io.agora.rtc.internal.EncryptionConfig
import io.agora.rtc.internal.LastmileProbeConfig
import io.agora.rtc.live.LiveInjectStreamConfig
import io.agora.rtc.live.LiveTranscoding
Expand Down Expand Up @@ -169,3 +170,10 @@ fun mapToChannelMediaOptions(map: Map<*, *>): ChannelMediaOptions {
(map["autoSubscribeVideo"] as? Boolean)?.let { autoSubscribeVideo = it }
}
}

fun mapToEncryptionConfig(map: Map<*, *>): EncryptionConfig {
return EncryptionConfig().apply {
(map["encryptionMode"] as? Number)?.let { encryptionMode = intToEncryptionMode(it.toInt()) }
(map["encryptionKey"] as? String)?.let { encryptionKey = it }
}
}
10 changes: 10 additions & 0 deletions android/src/main/java/io/agora/rtc/base/EnumCovertor.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.agora.rtc.base

import io.agora.rtc.internal.EncryptionConfig
import io.agora.rtc.live.LiveInjectStreamConfig
import io.agora.rtc.live.LiveTranscoding
import io.agora.rtc.video.CameraCapturerConfiguration
Expand Down Expand Up @@ -85,3 +86,12 @@ fun intToCameraDirection(@Annotations.AgoraCameraDirection intValue: Int): Camer
}
throw RuntimeException("CameraCapturerConfiguration.CAMERA_DIRECTION not contains $intValue")
}

fun intToEncryptionMode(@Annotations.AgoraEncryptionMode intValue: Int): EncryptionConfig.EncryptionMode {
for (value in EncryptionConfig.EncryptionMode.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("EncryptionConfig.EncryptionMode not contains $intValue")
}
13 changes: 9 additions & 4 deletions android/src/main/java/io/agora/rtc/base/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ fun LocalAudioStats.toMap(): Map<String, Any?> {
return hashMapOf(
"numChannels" to numChannels,
"sentSampleRate" to sentSampleRate,
"sentBitrate" to sentBitrate
"sentBitrate" to sentBitrate,
"txPacketLossRate" to txPacketLossRate
)
}

Expand Down Expand Up @@ -68,7 +69,8 @@ fun RemoteAudioStats.toMap(): Map<String, Any?> {
"receivedBitrate" to receivedBitrate,
"totalFrozenTime" to totalFrozenTime,
"frozenRate" to frozenRate,
"totalActiveTime" to totalActiveTime
"totalActiveTime" to totalActiveTime,
"publishDuration" to publishDuration
)
}

Expand All @@ -85,7 +87,9 @@ fun LocalVideoStats.toMap(): Map<String, Any?> {
"encodedFrameWidth" to encodedFrameWidth,
"encodedFrameHeight" to encodedFrameHeight,
"encodedFrameCount" to encodedFrameCount,
"codecType" to codecType
"codecType" to codecType,
"txPacketLossRate" to txPacketLossRate,
"captureFrameRate" to captureFrameRate
)
}

Expand All @@ -102,7 +106,8 @@ fun RemoteVideoStats.toMap(): Map<String, Any?> {
"rxStreamType" to rxStreamType,
"totalFrozenTime" to totalFrozenTime,
"frozenRate" to frozenRate,
"totalActiveTime" to totalActiveTime
"totalActiveTime" to totalActiveTime,
"publishDuration" to publishDuration
)
}

Expand Down
Loading

0 comments on commit 09f411c

Please sign in to comment.