Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit e41cc21

Browse files
committed
Avoid using #ifdef in enum class declaration. (#79)
1 parent 2905d03 commit e41cc21

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

api/video/video_codec_type.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
namespace webrtc {
1515

1616
// GENERATED_JAVA_ENUM_PACKAGE: org.webrtc
17+
#ifndef DISABLE_H265
18+
enum VideoCodecType {
19+
// Java_cpp_enum.py does not allow ifdef in enum class,
20+
// so we have to create two version of VideoCodecType here
21+
kVideoCodecGeneric = 0,
22+
kVideoCodecVP8,
23+
kVideoCodecVP9,
24+
kVideoCodecAV1,
25+
kVideoCodecH264,
26+
kVideoCodecH265,
27+
kVideoCodecMultiplex,
28+
};
29+
#else
1730
enum VideoCodecType {
1831
// There are various memset(..., 0, ...) calls in the code that rely on
1932
// kVideoCodecGeneric being zero.
@@ -22,11 +35,9 @@ enum VideoCodecType {
2235
kVideoCodecVP9,
2336
kVideoCodecAV1,
2437
kVideoCodecH264,
25-
#ifndef DISABLE_H265
26-
kVideoCodecH265,
27-
#endif
2838
kVideoCodecMultiplex,
2939
};
40+
#endif
3041

3142
} // namespace webrtc
3243

0 commit comments

Comments
 (0)