提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 视频压缩格式 |
|
5 |
* |
|
6 |
* @author 47040 |
|
7 |
* @since Created at 2021/5/26 22:16 |
|
8 |
*/ |
|
9 |
public enum NET_EM_VIDEO_COMPRESSION { |
|
10 |
|
|
11 |
EM_VIDEO_FORMAT_UNKNOWN(-1, "未知"), |
|
12 |
EM_VIDEO_FORMAT_MPEG4(0, "MPEG4"), |
|
13 |
EM_VIDEO_FORMAT_MS_MPEG4(1, "MS-MPEG4"), |
|
14 |
EM_VIDEO_FORMAT_MPEG2(2, "MPEG2"), |
|
15 |
EM_VIDEO_FORMAT_MPEG1(3, "MPEG1"), |
|
16 |
EM_VIDEO_FORMAT_H263(4, "H.263"), |
|
17 |
EM_VIDEO_FORMAT_MJPG(5, "MJPG"), |
|
18 |
EM_VIDEO_FORMAT_FCC_MPEG4(6, "FCC-MPEG4"), |
|
19 |
EM_VIDEO_FORMAT_H264(7, "H.264"), |
|
20 |
EM_VIDEO_FORMAT_H265(8, "H.265"), |
|
21 |
EM_VIDEO_FORMAT_SVAC(9, "SVAC"); |
|
22 |
|
|
23 |
private final int value; |
|
24 |
private final String note; |
|
25 |
|
|
26 |
NET_EM_VIDEO_COMPRESSION(int givenValue, String note) { |
|
27 |
this.value = givenValue; |
|
28 |
this.note = note; |
|
29 |
} |
|
30 |
|
|
31 |
public String getNote() { |
|
32 |
return note; |
|
33 |
} |
|
34 |
|
|
35 |
public int getValue() { |
|
36 |
return value; |
|
37 |
} |
|
38 |
|
|
39 |
public static String getNoteByValue(int givenValue) { |
|
40 |
for (NET_EM_VIDEO_COMPRESSION enumType : NET_EM_VIDEO_COMPRESSION.values()) { |
|
41 |
if (givenValue == enumType.getValue()) { |
|
42 |
return enumType.getNote(); |
|
43 |
} |
|
44 |
} |
|
45 |
return null; |
|
46 |
} |
|
47 |
|
|
48 |
public static int getValueByNote(String givenNote) { |
|
49 |
for (NET_EM_VIDEO_COMPRESSION enumType : NET_EM_VIDEO_COMPRESSION.values()) { |
|
50 |
if (givenNote.equals(enumType.getNote())) { |
|
51 |
return enumType.getValue(); |
|
52 |
} |
|
53 |
} |
|
54 |
return -1; |
|
55 |
} |
|
56 |
|
|
57 |
public static NET_EM_VIDEO_COMPRESSION getEnum(int value) { |
|
58 |
for (NET_EM_VIDEO_COMPRESSION e : NET_EM_VIDEO_COMPRESSION.values()) { |
|
59 |
if (e.getValue() == value) |
|
60 |
return e; |
|
61 |
} |
|
62 |
return NET_EM_VIDEO_COMPRESSION.EM_VIDEO_FORMAT_UNKNOWN; |
|
63 |
} |
|
64 |
} |