Skip to content

Commit

Permalink
feat: support 3.7.0 (#490)
Browse files Browse the repository at this point in the history
* feat: support 3.7.0

* build: add Provisioning

* chore: fix jira issue

* fix: switch back to camera after stop screen sharing

* fix: expectedDownlinkBitrate issue

* feat: add example for SpatialAudio

* chore: change text color

* chore: optimize demo

* docs: Update for v3.7.0 (#494)

Co-authored-by: TingChen2020 <65653391+TingChen2020@users.noreply.github.com>
  • Loading branch information
LichKing-2234 and TingChen2020 authored May 13, 2022
1 parent 5784268 commit 0d9e681
Show file tree
Hide file tree
Showing 37 changed files with 1,565 additions and 162 deletions.
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
api 'io.agora.rtc:agora-special-full:3.6.2.70-2'
api 'io.agora.rtc:full-sdk:3.7.0'
implementation 'io.agora.rtc:full-screen-sharing:3.7.0'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
51 changes: 50 additions & 1 deletion android/src/main/java/io/agora/rtc/base/BeanCovertor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package io.agora.rtc.base

import io.agora.rtc.AgoraMediaRecorder
import io.agora.rtc.RtcEngineConfig
import io.agora.rtc.ScreenCaptureParameters
import io.agora.rtc.audio.AgoraRhythmPlayerConfig
import io.agora.rtc.audio.AudioRecordingConfiguration
import io.agora.rtc.audio.SpatialAudioParams
import io.agora.rtc.internal.EncryptionConfig
import io.agora.rtc.internal.LastmileProbeConfig
import io.agora.rtc.live.LiveInjectStreamConfig
Expand Down Expand Up @@ -156,7 +158,7 @@ fun mapToLastmileProbeConfig(map: Map<*, *>): LastmileProbeConfig {
(map["probeUplink"] as? Boolean)?.let { probeUplink = it }
(map["probeDownlink"] as? Boolean)?.let { probeDownlink = it }
(map["expectedUplinkBitrate"] as? Number)?.let { expectedUplinkBitrate = it.toInt() }
(map["expectedDownlinkBitrate"] as? Number)?.let { expectedUplinkBitrate = it.toInt() }
(map["expectedDownlinkBitrate"] as? Number)?.let { expectedDownlinkBitrate = it.toInt() }
}
}

Expand Down Expand Up @@ -367,3 +369,50 @@ fun mapToColorEnhanceOptions(map: Map<*, *>): ColorEnhanceOptions {
(map["skinProtectLevel"] as? Number)?.let { skinProtectLevel = it.toFloat() }
}
}

fun mapToScreenCaptureParameters(map: Map<*, *>): ScreenCaptureParameters {
return ScreenCaptureParameters().apply {
(map["captureAudio"] as? Boolean)?.let { captureAudio = it }
(map["audioParams"] as? Map<*, *>)?.let {
audioCaptureParameters = mapToAudioCaptureParameters(it)
}
(map["captureVideo"] as? Boolean)?.let { captureVideo = it }
(map["videoParams"] as? Map<*, *>)?.let {
videoCaptureParameters = mapToVideoCaptureParameters(it)
}
}
}

fun mapToVideoCaptureParameters(map: Map<*, *>): ScreenCaptureParameters.VideoCaptureParameters {
return ScreenCaptureParameters.VideoCaptureParameters().apply {
(map["bitrate"] as? Number)?.let { bitrate = it.toInt() }
(map["frameRate"] as? Number)?.let { framerate = it.toInt() }
(map["dimensions"] as? Map<*, *>)?.let { it ->
mapToVideoDimensions(it).let {
width = it.width
height = it.height
}
}
(map["contentHint"] as? Number)?.let { contentHint = it.toInt() }
}
}

fun mapToAudioCaptureParameters(map: Map<*, *>): ScreenCaptureParameters.AudioCaptureParameters {
return ScreenCaptureParameters.AudioCaptureParameters().apply {
(map["sampleRate"] as? Number)?.let { sampleRate = it.toInt() }
(map["channels"] as? Number)?.let { channels = it.toInt() }
(map["captureSignalVolume"] as? Number)?.let { captureSignalVolume = it.toInt() }
(map["allowCaptureCurrentApp"] as? Boolean)?.let { allowCaptureCurrentApp = it }
}
}

fun mapToSpatialAudioParams(map: Map<*, *>): SpatialAudioParams {
return SpatialAudioParams().apply {
(map["speaker_azimuth"] as? Number)?.let { spk_azimuth = it.toDouble() }
(map["speaker_elevation"] as? Number)?.let { spk_elevation = it.toDouble() }
(map["speaker_distance"] as? Number)?.let { spk_distance = it.toDouble() }
(map["speaker_orientation"] as? Number)?.let { spk_orientation = it.toInt() }
(map["enable_blur"] as? Boolean)?.let { enable_blur = it }
(map["enable_air_absorb"] as? Boolean)?.let { enable_air_absorb = it }
}
}
Loading

0 comments on commit 0d9e681

Please sign in to comment.