Browse Source

Cleanup enums

Paul-Louis Ageneau 1 year ago
parent
commit
589d5ab879
1 changed files with 7 additions and 7 deletions
  1. 7 7
      include/rtc/nalunit.hpp

+ 7 - 7
include/rtc/nalunit.hpp

@@ -49,29 +49,29 @@ struct RTC_CPP_EXPORT NalUnitFragmentHeader {
 
 #pragma pack(pop)
 
-typedef enum {
+enum NalUnitStartSequenceMatch {
 	NUSM_noMatch,
 	NUSM_firstZero,
 	NUSM_secondZero,
 	NUSM_thirdZero,
 	NUSM_shortMatch,
 	NUSM_longMatch
-} NalUnitStartSequenceMatch;
+};
 
 static const size_t H264_NAL_HEADER_SIZE = 1;
 static const size_t H265_NAL_HEADER_SIZE = 2;
 /// Nal unit
 struct RTC_CPP_EXPORT NalUnit : binary {
-	typedef enum { H264, H265 } Type;
+	enum class Type { H264, H265 };
 
 	NalUnit(const NalUnit &unit) = default;
-	NalUnit(size_t size, bool includingHeader = true, Type type = H264)
+	NalUnit(size_t size, bool includingHeader = true, Type type = Type::H264)
 	    : binary(size + (includingHeader
 	                         ? 0
-	                         : (type == H264 ? H264_NAL_HEADER_SIZE : H265_NAL_HEADER_SIZE))) {}
+	                         : (type == Type::H264 ? H264_NAL_HEADER_SIZE : H265_NAL_HEADER_SIZE))) {}
 	NalUnit(binary &&data) : binary(std::move(data)) {}
-	NalUnit(Type type = H264)
-	    : binary(type == H264 ? H264_NAL_HEADER_SIZE : H265_NAL_HEADER_SIZE) {}
+	NalUnit(Type type = Type::H264)
+	    : binary(type == Type::H264 ? H264_NAL_HEADER_SIZE : H265_NAL_HEADER_SIZE) {}
 	template <typename Iterator> NalUnit(Iterator begin_, Iterator end_) : binary(begin_, end_) {}
 
 	bool forbiddenBit() const { return header()->forbiddenBit(); }