Skip to content

Commit

Permalink
More KTLint Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aschulz90 committed Feb 2, 2024
1 parent 8bab984 commit f866b4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.shepeliev.webrtckmp
import dev.onvoid.webrtc.media.video.VideoDeviceSource
import dev.onvoid.webrtc.media.video.VideoTrack


internal class LocalVideoStreamTrack(
native: VideoTrack,
private val videoSource: VideoDeviceSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal object MediaDevicesImpl : MediaDevices, DeviceChangeListener {
if (constraints.audio != null) {
val audioDevices = NativeMediaDevices.getAudioCaptureDevices()

if(audioDevices.isNotEmpty()) {
if (audioDevices.isNotEmpty()) {
val device = constraints.audio.deviceId?.let { deviceId ->
audioDevices.first { device ->
device.descriptor == deviceId
Expand Down Expand Up @@ -77,7 +77,7 @@ internal object MediaDevicesImpl : MediaDevices, DeviceChangeListener {
it.second.isNotEmpty()
}

if(matchingDevice != null) {
if (matchingDevice != null) {
val videoSource = VideoDeviceSource().apply {
setVideoCaptureDevice(matchingDevice.first)
setVideoCaptureCapability(matchingDevice.second.first())
Expand Down Expand Up @@ -106,8 +106,8 @@ internal object MediaDevicesImpl : MediaDevices, DeviceChangeListener {

val exact = capabilities.firstOrNull { capability ->
constraints.height?.exact?.let { it == capability.height } ?: true &&
constraints.width?.exact?.let { it == capability.width } ?: true &&
constraints.frameRate?.exact?.let { it.toInt() == capability.frameRate } ?: true
constraints.width?.exact?.let { it == capability.width } ?: true &&
constraints.frameRate?.exact?.let { it.toInt() == capability.frameRate } ?: true
}?.let {
listOf(it)
}
Expand Down Expand Up @@ -185,7 +185,7 @@ internal object MediaDevicesImpl : MediaDevices, DeviceChangeListener {
val deviceInfo = MediaDeviceInfo(
deviceId = device.descriptor,
label = device.name,
kind = when(device) {
kind = when (device) {
is AudioDevice -> MediaDeviceKind.AudioInput
else -> MediaDeviceKind.VideoInput
}
Expand All @@ -199,11 +199,12 @@ internal object MediaDevicesImpl : MediaDevices, DeviceChangeListener {
val deviceInfo = MediaDeviceInfo(
deviceId = device.descriptor,
label = device.name,
kind = when(device) {
is AudioDevice -> if(NativeMediaDevices.getAudioCaptureDevices().contains(device))
kind = when (device) {
is AudioDevice -> if (NativeMediaDevices.getAudioCaptureDevices().contains(device))
MediaDeviceKind.AudioInput
else
MediaDeviceKind.AudioOutput

else -> MediaDeviceKind.VideoInput
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.shepeliev.webrtckmp

import dev.onvoid.webrtc.media.audio.AudioTrack
import dev.onvoid.webrtc.media.video.VideoTrack
import dev.onvoid.webrtc.media.MediaStream as NativeMediaStream
import java.util.UUID
import dev.onvoid.webrtc.media.MediaStream as NativeMediaStream

actual class MediaStream internal constructor(
val native: NativeMediaStream? = null,
Expand Down

0 comments on commit f866b4c

Please sign in to comment.