Skip to content

Commit

Permalink
merge: dev/3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Dec 18, 2020
2 parents 432b088 + de52ca6 commit 8c147a8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions android/src/main/java/io/agora/rtc/base/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
2 changes: 1 addition & 1 deletion android/src/main/java/io/agora/rtc/base/Callback.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.agora.rtc.RtcEngine
import kotlin.math.abs

abstract class Callback {
fun code(code: Int?, runnable: ((Int) -> Any?)? = null) {
fun code(code: Int?, runnable: ((Int?) -> Any?)? = null) {
if (code == null || code < 0) {
val newCode = abs(code ?: Constants.ERR_NOT_INITIALIZED)
failure(newCode.toString(), RtcEngine.getErrorDescription(newCode))
Expand Down
4 changes: 1 addition & 3 deletions android/src/main/java/io/agora/rtc/base/MediaObserver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class MediaObserver(

override fun onMetadataReceived(buffer: ByteArray, uid: Int, timeStampMs: Long) {
emit(hashMapOf(
"buffer" to String(buffer),
"uid" to uid,
"timeStampMs" to timeStampMs
"data" to arrayListOf(String(buffer), uid, timeStampMs)
))
}
}
11 changes: 11 additions & 0 deletions android/src/main/java/io/agora/rtc/base/RtcSurfaceView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class RtcSurfaceView(
) : FrameLayout(context) {
private var surface: SurfaceView
private var canvas: VideoCanvas
private var isMediaOverlay = false
private var onTop = false
private var channel: WeakReference<RtcChannel>? = null

init {
Expand All @@ -26,6 +28,7 @@ class RtcSurfaceView(
}

fun setZOrderMediaOverlay(isMediaOverlay: Boolean) {
this.isMediaOverlay = isMediaOverlay
try {
removeView(surface)
surface.setZOrderMediaOverlay(isMediaOverlay)
Expand All @@ -36,6 +39,7 @@ class RtcSurfaceView(
}

fun setZOrderOnTop(onTop: Boolean) {
this.onTop = onTop
try {
removeView(surface)
surface.setZOrderOnTop(onTop)
Expand All @@ -62,6 +66,13 @@ class RtcSurfaceView(
}

private fun setupVideoCanvas(engine: RtcEngine) {
removeAllViews()
surface = RtcEngine.CreateRendererView(context.applicationContext)
surface.setZOrderMediaOverlay(isMediaOverlay)
surface.setZOrderOnTop(onTop)
addView(surface)
surface.layout(0, 0, width, height)
canvas.view = surface
if (canvas.uid == 0) {
engine.setupLocalVideo(canvas)
} else {
Expand Down
5 changes: 5 additions & 0 deletions android/src/main/java/io/agora/rtc/base/RtcTextureView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class RtcTextureView(
}

private fun setupVideoCanvas(engine: RtcEngine) {
removeAllViews()
texture = RtcEngine.CreateTextureView(context.applicationContext)
addView(texture)
texture.layout(0, 0, width, height)
canvas.view = texture
if (canvas.uid == 0) {
engine.setupLocalVideo(canvas)
} else {
Expand Down

0 comments on commit 8c147a8

Please sign in to comment.