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..4ce55bd26efc0c08214a408d8a135b9308169f94 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=(const uint8_t& value); |
+ bool operator==(const VideoContentType& other); |
+ bool operator==(const uint8_t& value); |
+ |
+ void SetExperimentId(const uint8_t& experiment_id); |
+ void SetSimulcastId(const uint8_t& simulcast_id); |
+ |
+ uint8_t GetExperimentId(); |
+ uint8_t GetSimulcastId(); |
+ |
+ bool IsScreenshare(); |
+ |
+ static bool IsValidContentType(uint8_t content_type); |
+ |
+ uint8_t content_type; |
}; |
} // namespace webrtc |