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

Unified Diff: webrtc/common_types.h

Issue 2001533003: Refactoring: Hide VideoCodec.codecSpecific as "private" (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 2 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
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.h
diff --git a/webrtc/common_types.h b/webrtc/common_types.h
index b1842ef59598e78e86f99f71d495661b0d1a9483..c3e9a84c3cc729b5cb3e1b1287731cc102aa3ba0 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -593,7 +593,11 @@ struct SpatialLayer {
enum VideoCodecMode { kRealtimeVideo, kScreensharing };
// Common video codec properties
-struct VideoCodec {
+class VideoCodec {
+ public:
+ VideoCodec();
+
+ // Public variables. TODO(hta): Make them private with accessors.
VideoCodecType codecType;
char plName[kPayloadNameSize];
unsigned char plType;
@@ -608,8 +612,6 @@ struct VideoCodec {
unsigned char maxFramerate;
- VideoCodecUnion codecSpecific;
-
unsigned int qpMax;
unsigned char numberOfSimulcastStreams;
SimulcastStream simulcastStream[kMaxSimulcastStreams];
@@ -620,6 +622,23 @@ struct VideoCodec {
bool operator==(const VideoCodec& other) const = delete;
bool operator!=(const VideoCodec& other) const = delete;
+
+ // Accessors for codec specific information.
+ // There is a const version of each that returns a reference,
+ // and a non-const version that returns a pointer, in order
+ // to allow modification of the parameters.
+ VideoCodecVP8* VP8();
+ const VideoCodecVP8& VP8() const;
+ VideoCodecVP9* VP9();
+ const VideoCodecVP9& VP9() const;
+ VideoCodecH264* H264();
+ const VideoCodecH264& H264() const;
+
+ // This variable will be declared private and renamed to codec_specific_
+ // once Chromium is not accessing it.
+ // TODO(hta): Consider replacing the union with a pointer type.
+ // This will allow removing the VideoCodec* types from this file.
+ VideoCodecUnion codecSpecific;
};
// Bandwidth over-use detector options. These are used to drive
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698