Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: webrtc/api/video/video_content_type.h

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: Remove static initialization from VideoContentType and remove memoization in AlrDetector Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0aaa909b79ab7f9f069b7cad917e0bac15375408 100644
--- a/webrtc/api/video/video_content_type.h
+++ b/webrtc/api/video/video_content_type.h
@@ -15,10 +15,32 @@
namespace webrtc {
-enum class VideoContentType : uint8_t {
- UNSPECIFIED = 0,
- SCREENSHARE = 1,
- TOTAL_CONTENT_TYPES // Must be the last value in the enum.
+struct VideoContentType {
+ // Common content types used outside of experiments.
+ static VideoContentType Unspecified();
+ static 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;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698