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

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: Use initializers instead of memset Created 4 years, 7 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') | webrtc/common_types.cc » ('J')
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 587b90d753ce3f3eb092dfd01edb8b1b68303719..467afc90fef2636be1a128aa97dd2050578b2734 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -682,7 +682,11 @@ enum VideoCodecMode {
};
// Common video codec properties
-struct VideoCodec {
+class VideoCodec {
+ public:
+ VideoCodec();
+
+ // Public variables. TODO(hta): Make them private with accessors.
tommi 2016/05/23 17:05:09 nit: TODO on a line of its own
hta-webrtc 2016/05/23 17:19:33 Done.
VideoCodecType codecType;
char plName[kPayloadNameSize];
unsigned char plType;
@@ -697,8 +701,6 @@ struct VideoCodec {
unsigned char maxFramerate;
- VideoCodecUnion codecSpecific;
-
unsigned int qpMax;
unsigned char numberOfSimulcastStreams;
SimulcastStream simulcastStream[kMaxSimulcastStreams];
@@ -708,6 +710,22 @@ 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;
+
+ private:
+ // TODO(hta): Consider replacing the union with a pointer type.
+ // This will allow removing the VideoCodec* types from this file.
+ VideoCodecUnion codec_specific_;
};
// Bandwidth over-use detector options. These are used to drive
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/common_types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698