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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_ 11 #ifndef WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_
12 #define WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_ 12 #define WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_
13 13
14 #include <stdint.h> 14 #include <stdint.h>
15 15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 enum class VideoContentType : uint8_t { 18 // Class designed to behave like enum to be included in RTP header structs.
19 UNSPECIFIED = 0, 19 struct VideoContentType {
20 SCREENSHARE = 1, 20 // Common content types used outside of experiments.
21 TOTAL_CONTENT_TYPES // Must be the last value in the enum. 21 static const VideoContentType UNSPECIFIED;
sprang_webrtc 2017/07/26 14:13:42 Maybe declare these as constexpr instead?
ilnik 2017/07/26 14:49:48 In that case, I have to initialize it right here,
22 static const VideoContentType SCREENSHARE;
23
24 operator uint8_t() const;
sprang_webrtc 2017/07/26 14:13:42 Is this really needed? Would prefer to have the co
ilnik 2017/07/26 14:49:48 That is done, so we could replace this class with
25
26 // No conversion constructor because otherwise this struct and many structs
27 // it's included into will be considered 'complex' and many chromium style
28 // errors will be generated.
29
30 uint8_t operator=(const uint8_t& value);
31 bool operator==(const VideoContentType& other);
32 bool operator==(const uint8_t& value);
33
34 void SetExperimentId(const uint8_t& experiment_id);
35 void SetSimulcastId(const uint8_t& simulcast_id);
sprang_webrtc 2017/07/26 14:13:42 Pass uint8_t parameters by value rather than refer
ilnik 2017/07/26 14:49:48 Done.
36
37 uint8_t GetExperimentId();
38 uint8_t GetSimulcastId();
39
40 bool IsScreenshare();
sprang_webrtc 2017/07/26 14:13:42 Looks like these three methods can be const?
ilnik 2017/07/26 14:49:48 Done.
41
42 static bool IsValidContentType(uint8_t content_type);
43
44 uint8_t content_type;
sprang_webrtc 2017/07/26 14:13:42 Make it private and have a setter method?
ilnik 2017/07/26 14:49:48 For some usages it's easier to have it accessible
22 }; 45 };
23 46
24 } // namespace webrtc 47 } // namespace webrtc
25 48
26 #endif // WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_ 49 #endif // WEBRTC_API_VIDEO_VIDEO_CONTENT_TYPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698