提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 码流类型 |
|
6 |
* @date 2022/07/20 14:11:30 |
|
7 |
*/ |
|
8 |
public enum CFG_EM_STREAM_TYPES { |
|
9 |
/** |
|
10 |
* 其它 |
|
11 |
*/ |
|
12 |
CFG_EM_STREAMTYPE_ERR(0, "其它"), |
|
13 |
/** |
|
14 |
* Main -主码流 |
|
15 |
*/ |
|
16 |
CFG_EM_STREAMTYPE_MAIN(1, "Main -主码流"), |
|
17 |
/** |
|
18 |
* Extra1 -辅码流1 |
|
19 |
*/ |
|
20 |
CFG_EM_STREAMTYPE_EXTRA_1(2, "Extra1 -辅码流1"), |
|
21 |
/** |
|
22 |
* Extra2 -辅码流2 |
|
23 |
*/ |
|
24 |
CFG_EM_STREAMTYPE_EXTRA_2(3, "Extra2 -辅码流2"), |
|
25 |
/** |
|
26 |
* Extra3 -辅码流3 |
|
27 |
*/ |
|
28 |
CFG_EM_STREAMTYPE_EXTRA_3(4, "Extra3 -辅码流3"), |
|
29 |
/** |
|
30 |
* Snapshot -抓图码流 |
|
31 |
*/ |
|
32 |
CFG_EM_STREAMTYPE_SNAPSHOT(5, "Snapshot -抓图码流"), |
|
33 |
/** |
|
34 |
* Talkback -对讲码流 |
|
35 |
*/ |
|
36 |
CFG_EM_STREAMTYPE_TALKBACK(6, "Talkback -对讲码流"); |
|
37 |
|
|
38 |
private int value; |
|
39 |
|
|
40 |
private String note; |
|
41 |
|
|
42 |
public String getNote() { |
|
43 |
return note; |
|
44 |
} |
|
45 |
|
|
46 |
public int getValue() { |
|
47 |
return value; |
|
48 |
} |
|
49 |
|
|
50 |
CFG_EM_STREAM_TYPES(int givenValue, String note) { |
|
51 |
this.value = givenValue; |
|
52 |
this.note = note; |
|
53 |
} |
|
54 |
|
|
55 |
public static String getNoteByValue(int givenValue) { |
|
56 |
for (CFG_EM_STREAM_TYPES enumType : CFG_EM_STREAM_TYPES.values()) { |
|
57 |
if (givenValue == enumType.getValue()) { |
|
58 |
return enumType.getNote(); |
|
59 |
} |
|
60 |
} |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
public static int getValueByNote(String givenNote) { |
|
65 |
for (CFG_EM_STREAM_TYPES enumType : CFG_EM_STREAM_TYPES.values()) { |
|
66 |
if (givenNote.equals(enumType.getNote())) { |
|
67 |
return enumType.getValue(); |
|
68 |
} |
|
69 |
} |
|
70 |
return -1; |
|
71 |
} |
|
72 |
} |