-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnumCovertor.kt
More file actions
97 lines (86 loc) · 3.92 KB
/
EnumCovertor.kt
File metadata and controls
97 lines (86 loc) · 3.92 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package io.agora.rtc.base
import io.agora.rtc.internal.EncryptionConfig
import io.agora.rtc.live.LiveInjectStreamConfig
import io.agora.rtc.live.LiveTranscoding
import io.agora.rtc.video.CameraCapturerConfiguration
import io.agora.rtc.video.VideoEncoderConfiguration
fun intToFrameRate(@Annotations.AgoraVideoFrameRate intValue: Int): VideoEncoderConfiguration.FRAME_RATE {
for (value in VideoEncoderConfiguration.FRAME_RATE.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("VideoEncoderConfiguration.FRAME_RATE not contains $intValue")
}
fun intToOrientationMode(@Annotations.AgoraVideoOutputOrientationMode intValue: Int): VideoEncoderConfiguration.ORIENTATION_MODE {
for (value in VideoEncoderConfiguration.ORIENTATION_MODE.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("VideoEncoderConfiguration.ORIENTATION_MODE not contains $intValue")
}
fun intToDegradationPreference(@Annotations.AgoraDegradationPreference intValue: Int): VideoEncoderConfiguration.DEGRADATION_PREFERENCE {
for (value in VideoEncoderConfiguration.DEGRADATION_PREFERENCE.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("VideoEncoderConfiguration.DEGRADATION_PREFERENCE not contains $intValue")
}
fun intToLiveTranscodingAudioSampleRate(@Annotations.AgoraAudioSampleRateType intValue: Int): LiveTranscoding.AudioSampleRateType {
for (value in LiveTranscoding.AudioSampleRateType.values()) {
if (LiveTranscoding.AudioSampleRateType.getValue(value) == intValue) {
return value
}
}
throw RuntimeException("LiveTranscoding.AudioSampleRateType not contains $intValue")
}
fun intToLiveInjectStreamConfigAudioSampleRate(@Annotations.AgoraAudioSampleRateType intValue: Int): LiveInjectStreamConfig.AudioSampleRateType {
for (value in LiveInjectStreamConfig.AudioSampleRateType.values()) {
if (LiveInjectStreamConfig.AudioSampleRateType.getValue(value) == intValue) {
return value
}
}
throw RuntimeException("LiveInjectStreamConfig.AudioSampleRateType not contains $intValue")
}
fun intToAudioCodecProfile(@Annotations.AgoraAudioCodecProfileType intValue: Int): LiveTranscoding.AudioCodecProfileType {
for (value in LiveTranscoding.AudioCodecProfileType.values()) {
if (LiveTranscoding.AudioCodecProfileType.getValue(value) == intValue) {
return value
}
}
throw RuntimeException("LiveTranscoding.AudioCodecProfileType not contains $intValue")
}
fun intToVideoCodecProfile(@Annotations.AgoraVideoCodecProfileType intValue: Int): LiveTranscoding.VideoCodecProfileType {
for (value in LiveTranscoding.VideoCodecProfileType.values()) {
if (LiveTranscoding.VideoCodecProfileType.getValue(value) == intValue) {
return value
}
}
throw RuntimeException("LiveTranscoding.VideoCodecProfileType not contains $intValue")
}
fun intToCapturerOutputPreference(@Annotations.AgoraCameraCaptureOutputPreference intValue: Int): CameraCapturerConfiguration.CAPTURER_OUTPUT_PREFERENCE {
for (value in CameraCapturerConfiguration.CAPTURER_OUTPUT_PREFERENCE.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("CameraCapturerConfiguration.CAPTURER_OUTPUT_PREFERENCE not contains $intValue")
}
fun intToCameraDirection(@Annotations.AgoraCameraDirection intValue: Int): CameraCapturerConfiguration.CAMERA_DIRECTION {
for (value in CameraCapturerConfiguration.CAMERA_DIRECTION.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("CameraCapturerConfiguration.CAMERA_DIRECTION not contains $intValue")
}
fun intToEncryptionMode(@Annotations.AgoraEncryptionMode intValue: Int): EncryptionConfig.EncryptionMode {
for (value in EncryptionConfig.EncryptionMode.values()) {
if (value.value == intValue) {
return value
}
}
throw RuntimeException("EncryptionConfig.EncryptionMode not contains $intValue")
}