LocalVideoTrackOptions.kt
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package io.livekit.android.room.track
class LocalVideoTrackOptions(
var isScreencast: Boolean = false,
var position: CameraPosition = CameraPosition.FRONT,
var captureParams: VideoCaptureParameter = VideoPreset.QHD.capture
)
class VideoCaptureParameter(
val width: Int,
val height: Int,
val maxFps: Int,
)
class VideoEncoding(
val maxBitrate: Int,
val maxFps: Int,
)
enum class CameraPosition {
FRONT,
BACK
}
/**
* Video presets along with suggested bitrates
*/
enum class VideoPreset(
val capture: VideoCaptureParameter,
val encoding: VideoEncoding,
) {
QVGA(
VideoCaptureParameter(320, 240, 15),
VideoEncoding(100_000, 15),
),
VGA(
VideoCaptureParameter(640, 360, 30),
VideoEncoding(400_000, 30),
),
QHD(
VideoCaptureParameter(960, 540, 30),
VideoEncoding(700_000, 30),
),
HD(
VideoCaptureParameter(1280, 720, 30),
VideoEncoding(2_000_000, 30),
),
FHD(
VideoCaptureParameter(1920, 1080, 30),
VideoEncoding(4_000_000, 30),
)
}