Index: webrtc/api/video/video_content_type.h |
diff --git a/webrtc/api/video/video_content_type.h b/webrtc/api/video/video_content_type.h |
index 5c468c079d35ea2d20c115234cf38d7e7fcd42bd..4afdd279478ec3f3f7fb10de6bcd68d8c2733b94 100644 |
--- a/webrtc/api/video/video_content_type.h |
+++ b/webrtc/api/video/video_content_type.h |
@@ -15,10 +15,33 @@ |
namespace webrtc { |
-enum class VideoContentType : uint8_t { |
- UNSPECIFIED = 0, |
- SCREENSHARE = 1, |
- TOTAL_CONTENT_TYPES // Must be the last value in the enum. |
+// Class designed to behave like enum to be included in RTP header structs. |
+struct VideoContentType { |
+ // Common content types used outside of experiments. |
+ static const VideoContentType UNSPECIFIED; |
tommi
2017/08/29 09:25:45
this isn't an enum, so should be kUnspecified.
ac
ilnik
2017/08/29 10:26:14
It's not enum, because there're 64 different combi
kwiberg-webrtc
2017/08/29 11:44:28
Even with many combinations, it should be convenie
ilnik
2017/08/29 12:01:57
Can you elaborate more, how do I, for example, com
kwiberg-webrtc
2017/08/29 12:12:45
http://en.cppreference.com/w/cpp/language/enum say
ilnik
2017/08/29 12:41:21
Thank you! That was misconception on my side. Plea
|
+ static const VideoContentType SCREENSHARE; |
+ |
+ operator uint8_t() const; |
+ |
+ // No conversion constructor because otherwise this struct and many structs |
+ // it's included into will be considered 'complex' and many chromium style |
+ // errors will be generated. |
+ |
+ uint8_t operator=(uint8_t value); |
+ bool operator==(const VideoContentType& other); |
+ bool operator==(uint8_t value); |
+ |
+ bool SetExperimentId(uint8_t experiment_id); |
+ bool SetSimulcastId(uint8_t simulcast_id); |
+ |
+ uint8_t GetExperimentId() const; |
+ uint8_t GetSimulcastId() const; |
+ |
+ bool IsScreenshare() const; |
+ |
+ static bool IsValidContentType(uint8_t content_type); |
+ |
+ uint8_t content_type; |
tommi
2017/08/29 09:25:45
make this private? (why a struct and not class?)
ilnik
2017/08/29 10:26:15
Can't make it private and class. It will make this
|
}; |
} // namespace webrtc |