Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
livekitAndroidXuningTest
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
davidliu
2023-03-03 23:53:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-03-03 23:53:28 +0900
Commit
70d672511a7778ef459375313c7b5776140c9032
70d67251
1 parent
a68fae5b
Add ability to attach VideoProcessor to capturers (#192)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
3 行删除
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
livekit-android-sdk/src/main/java/io/livekit/android/room/track/LocalVideoTrack.kt
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
查看文件 @
70d6725
...
...
@@ -71,6 +71,7 @@ internal constructor(
name: String = "",
capturer: VideoCapturer,
options: LocalVideoTrackOptions = videoTrackCaptureDefaults.copy(),
videoProcessor: VideoProcessor? = null,
): LocalVideoTrack {
return LocalVideoTrack.createTrack(
peerConnectionFactory = peerConnectionFactory,
...
...
@@ -80,6 +81,7 @@ internal constructor(
options = options,
rootEglBase = eglBase,
trackFactory = videoTrackFactory,
videoProcessor = videoProcessor,
)
}
...
...
@@ -91,6 +93,7 @@ internal constructor(
fun createVideoTrack(
name: String = "",
options: LocalVideoTrackOptions = videoTrackCaptureDefaults.copy(),
videoProcessor: VideoProcessor? = null,
): LocalVideoTrack {
return LocalVideoTrack.createTrack(
peerConnectionFactory,
...
...
@@ -99,6 +102,7 @@ internal constructor(
options,
eglBase,
videoTrackFactory,
videoProcessor = videoProcessor,
)
}
...
...
livekit-android-sdk/src/main/java/io/livekit/android/room/track/LocalVideoTrack.kt
查看文件 @
70d6725
...
...
@@ -199,11 +199,12 @@ constructor(
name: String,
capturer: VideoCapturer,
options: LocalVideoTrackOptions = LocalVideoTrackOptions(),
rootEglBase: EglBase,
trackFactory: Factory
trackFactory: Factory,
videoProcessor: VideoProcessor? = null,
): LocalVideoTrack {
val source = peerConnectionFactory.createVideoSource(false)
source.setVideoProcessor(videoProcessor)
val surfaceTextureHelper = SurfaceTextureHelper.create("VideoCaptureThread", rootEglBase.eglBaseContext)
capturer.initialize(
surfaceTextureHelper,
...
...
@@ -226,13 +227,15 @@ constructor(
)
return track
}
internal fun createTrack(
peerConnectionFactory: PeerConnectionFactory,
context: Context,
name: String,
options: LocalVideoTrackOptions,
rootEglBase: EglBase,
trackFactory: Factory
trackFactory: Factory,
videoProcessor: VideoProcessor? = null,
): LocalVideoTrack {
if (ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA) !=
...
...
@@ -242,6 +245,7 @@ constructor(
}
val source = peerConnectionFactory.createVideoSource(options.isScreencast)
source.setVideoProcessor(videoProcessor)
val (capturer, newOptions) = createVideoCapturer(context, options) ?: TODO()
val surfaceTextureHelper = SurfaceTextureHelper.create("VideoCaptureThread", rootEglBase.eglBaseContext)
capturer.initialize(
...
...
请
注册
或
登录
后发表评论