Committed by
GitHub
fix audio max bitrate not being set (#264)
Also set default max bitrate to 20000.
正在显示
1 个修改的文件
包含
9 行增加
和
3 行删除
| @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory | @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory | ||
| 25 | import dagger.assisted.AssistedInject | 25 | import dagger.assisted.AssistedInject |
| 26 | import io.livekit.android.dagger.CapabilitiesGetter | 26 | import io.livekit.android.dagger.CapabilitiesGetter |
| 27 | import io.livekit.android.dagger.InjectionNames | 27 | import io.livekit.android.dagger.InjectionNames |
| 28 | -import io.livekit.android.e2ee.E2EEOptions | ||
| 29 | import io.livekit.android.events.ParticipantEvent | 28 | import io.livekit.android.events.ParticipantEvent |
| 30 | import io.livekit.android.room.ConnectionState | 29 | import io.livekit.android.room.ConnectionState |
| 31 | import io.livekit.android.room.DefaultsManager | 30 | import io.livekit.android.room.DefaultsManager |
| @@ -243,6 +242,13 @@ internal constructor( | @@ -243,6 +242,13 @@ internal constructor( | ||
| 243 | ), | 242 | ), |
| 244 | publishListener: PublishListener? = null | 243 | publishListener: PublishListener? = null |
| 245 | ) { | 244 | ) { |
| 245 | + val encodings = listOf( | ||
| 246 | + RtpParameters.Encoding(null, true, null).apply { | ||
| 247 | + if (options.audioBitrate != null && options.audioBitrate > 0) { | ||
| 248 | + maxBitrateBps = options.audioBitrate | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + ) | ||
| 246 | publishTrackImpl( | 252 | publishTrackImpl( |
| 247 | track = track, | 253 | track = track, |
| 248 | options = options, | 254 | options = options, |
| @@ -250,6 +256,7 @@ internal constructor( | @@ -250,6 +256,7 @@ internal constructor( | ||
| 250 | disableDtx = !options.dtx | 256 | disableDtx = !options.dtx |
| 251 | source = LivekitModels.TrackSource.MICROPHONE | 257 | source = LivekitModels.TrackSource.MICROPHONE |
| 252 | }, | 258 | }, |
| 259 | + encodings = encodings, | ||
| 253 | publishListener = publishListener, | 260 | publishListener = publishListener, |
| 254 | ) | 261 | ) |
| 255 | } | 262 | } |
| @@ -369,7 +376,6 @@ internal constructor( | @@ -369,7 +376,6 @@ internal constructor( | ||
| 369 | transceiver.setCodecPreferences(matched.plus(partialMatched).plus(unmatched)) | 376 | transceiver.setCodecPreferences(matched.plus(partialMatched).plus(unmatched)) |
| 370 | } | 377 | } |
| 371 | 378 | ||
| 372 | - | ||
| 373 | val publication = LocalTrackPublication( | 379 | val publication = LocalTrackPublication( |
| 374 | info = trackInfo, | 380 | info = trackInfo, |
| 375 | track = track, | 381 | track = track, |
| @@ -741,7 +747,7 @@ abstract class BaseAudioTrackPublishOptions { | @@ -741,7 +747,7 @@ abstract class BaseAudioTrackPublishOptions { | ||
| 741 | } | 747 | } |
| 742 | 748 | ||
| 743 | data class AudioTrackPublishDefaults( | 749 | data class AudioTrackPublishDefaults( |
| 744 | - override val audioBitrate: Int? = null, | 750 | + override val audioBitrate: Int? = 20_000, |
| 745 | override val dtx: Boolean = true | 751 | override val dtx: Boolean = true |
| 746 | ) : BaseAudioTrackPublishOptions() | 752 | ) : BaseAudioTrackPublishOptions() |
| 747 | 753 |
-
请 注册 或 登录 后发表评论