提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 视频码流 |
|
6 |
* @date 2021/11/07 |
|
7 |
*/ |
|
8 |
public enum EM_VIDEO_STREAM { |
|
9 |
// 未知 |
|
10 |
EM_VIDEO_STREAM_UNKNOWN(0, "未知"), |
|
11 |
// 主码流 |
|
12 |
EM_VIDEO_STREAM_MAIN(1, "主码流"), |
|
13 |
// 辅码流1 |
|
14 |
EM_VIDEO_STREAM_EXTRA1(2, "辅码流1"), |
|
15 |
// 辅码流2 |
|
16 |
EM_VIDEO_STREAM_EXTRA2(3, "辅码流2"), |
|
17 |
// 辅码流3 |
|
18 |
EM_VIDEO_STREAM_EXTRA3(4, "辅码流3"), |
|
19 |
// 自动选择合适码流 |
|
20 |
EM_VIDEO_STREAM_AUTO(5, "自动选择合适码流"), |
|
21 |
// 预览裸数据码流 |
|
22 |
EM_VIDEO_STREAM_PREVIEW(6, "预览裸数据码流"), |
|
23 |
// 无视频码流(纯音频流) |
|
24 |
EM_VIDEO_STREAM_NO_VIDEO_JUST_AUDIO(7, "无视频码流(纯音频流)"); |
|
25 |
|
|
26 |
private int value; |
|
27 |
private String note; |
|
28 |
|
|
29 |
private EM_VIDEO_STREAM(int givenValue, String note) { |
|
30 |
this.value = givenValue; |
|
31 |
this.note = note; |
|
32 |
} |
|
33 |
|
|
34 |
public String getNote() { |
|
35 |
return note; |
|
36 |
} |
|
37 |
|
|
38 |
public int getValue() { |
|
39 |
return value; |
|
40 |
} |
|
41 |
|
|
42 |
public static String getNoteByValue(int givenValue) { |
|
43 |
for (EM_VIDEO_STREAM enumType : EM_VIDEO_STREAM.values()) { |
|
44 |
if (givenValue == enumType.getValue()) { |
|
45 |
return enumType.getNote(); |
|
46 |
} |
|
47 |
} |
|
48 |
return null; |
|
49 |
} |
|
50 |
|
|
51 |
public static int getValueByNote(String givenNote) { |
|
52 |
for (EM_VIDEO_STREAM enumType : EM_VIDEO_STREAM.values()) { |
|
53 |
if (givenNote.equals(enumType.getNote())) { |
|
54 |
return enumType.getValue(); |
|
55 |
} |
|
56 |
} |
|
57 |
return -1; |
|
58 |
} |
|
59 |
} |