Skip to content

Commit

Permalink
fix issues after gradle and kotlin updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyiz-amzn committed Sep 3, 2024
1 parent 7af48a3 commit 46d1e6b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class DefaultCameraCaptureSource @JvmOverloads constructor(
val maxFps: Int = 30

val chosenCaptureFormat: VideoCaptureFormat? =
MediaDevice.listSupportedVideoCaptureFormats(cameraManager, device, maxFps, maxWidth, maxHeight).minBy { format ->
MediaDevice.listSupportedVideoCaptureFormats(cameraManager, device, maxFps, maxWidth, maxHeight).minByOrNull { format ->
abs(format.width - this.format.width) + abs(format.height - this.format.height)
}
val surfaceTextureFormat: VideoCaptureFormat = chosenCaptureFormat ?: run {
Expand Down Expand Up @@ -390,11 +390,11 @@ class DefaultCameraCaptureSource @JvmOverloads constructor(
// Pick range with max closest to but not exceeding the set max framerate
val bestFpsRange = fpsRanges
.filter { it.upper <= this.format.maxFps }
.minBy { this.format.maxFps - it.upper }
.minByOrNull { this.format.maxFps - it.upper }
?: run {
logger.warn(TAG, "No FPS ranges below set max FPS")
// Just fall back to the closest
return@run fpsRanges.minBy { abs(this.format.maxFps - it.upper) }
return@run fpsRanges.minByOrNull { abs(this.format.maxFps - it.upper) }
} ?: run {
logger.error(TAG, "No valid FPS ranges")
handleCameraCaptureFail(CaptureSourceError.ConfigurationFailure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ data class MediaDevice(
val characteristics = cameraManager.getCameraCharacteristics(mediaDevice.id ?: return emptyList())
val fps = characteristics.get(
CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
)?.map { it.upper }?.filter { it <= maxVideoFps }?.max() ?: DEFAULT_MAX_VIDEO_FORMAT_FPS
)?.map { it.upper }?.filter { it <= maxVideoFps }?.maxOrNull() ?: DEFAULT_MAX_VIDEO_FORMAT_FPS

val streamMap =
characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ class DefaultAudioClientObserver(
}

private fun notifyFailed(statusCode: MeetingSessionStatusCode?) {
val attributes = statusCode?.let {
val attributes: MutableMap<EventAttributeName, Any>? = statusCode?.let {
mutableMapOf(
EventAttributeName.meetingStatus to statusCode,
EventAttributeName.meetingErrorMessage to statusCode.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object IngestionEventConverter {
}

private fun toIngestionPayload(event: MeetingEventItem, metadataAttributeKeys: Set<String>): IngestionPayload {
val payload = mutableMapOf(
val payload: MutableMap<String, Any> = mutableMapOf(
NAME_KEY to event.data.name,
TIMESTAMP_KEY to (event.data.eventAttributes[EventAttributeName.timestampMs.name] as Double).toLong(),
ID_KEY to event.id
Expand All @@ -130,7 +130,7 @@ object IngestionEventConverter {
}

private fun toIngestionPayload(dirtyEvent: DirtyMeetingEventItem, metadataAttributeKeys: Set<String>): IngestionPayload {
val payload = mutableMapOf(
val payload: MutableMap<String, Any> = mutableMapOf(
NAME_KEY to dirtyEvent.data.name,
TTL_KEY to dirtyEvent.ttl,
TIMESTAMP_KEY to (dirtyEvent.data.eventAttributes[EventAttributeName.timestampMs.name] as Double).toLong(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class CpuVideoProcessor(private val logger: Logger, eglCoreFactory: EglCoreFacto
val gValue = rgbaBuffer.data[gLocation].toPositiveInt()
val bValue = rgbaBuffer.data[bLocation].toPositiveInt()

val newValue = ((rValue + gValue + bValue) / (3.0)).toByte()
val newValue = ((rValue + gValue + bValue) / (3.0)).toInt().toByte()

rgbaBuffer.data.put(rLocation, newValue)
rgbaBuffer.data.put(gLocation, newValue)
Expand Down

0 comments on commit 46d1e6b

Please sign in to comment.