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..45e3cac21b100c39e8a71389c5650d6c55c7ed34 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; |
+ 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); |
+ |
+ void SetExperimentId(uint8_t experiment_id); |
+ void 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; |
sprang_webrtc
2017/08/24 09:13:16
Should we add a SetScreenshare(bool) as well and m
ilnik
2017/08/25 12:35:07
Can't do. It will make this class to be considered
|
}; |
} // namespace webrtc |