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

Unified Diff: webrtc/common_types.cc

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
Index: webrtc/common_types.cc
diff --git a/webrtc/common_types.cc b/webrtc/common_types.cc
index 7b99f3c5a83859d17a6891b99c49dc4d218808ee..4f2915a629b6a66b87180203c25c1453b5f8b4f3 100644
--- a/webrtc/common_types.cc
+++ b/webrtc/common_types.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/base/checks.h"
#include "webrtc/common_types.h"
#include <string.h>
@@ -48,4 +49,52 @@ RTPHeader::RTPHeader()
memset(&arrOfCSRCs, 0, sizeof(arrOfCSRCs));
tommi 2016/05/23 17:05:08 can we get rid of this memset as well?
hta-webrtc 2016/05/23 17:19:33 If the tests still pass....
}
+VideoCodec::VideoCodec()
+ : codecType(kVideoCodecUnknown),
+ plName(),
+ plType(0),
+ width(0),
+ height(0),
+ startBitrate(0),
+ maxBitrate(0),
+ minBitrate(0),
+ targetBitrate(0),
+ maxFramerate(0),
+ qpMax(0),
+ numberOfSimulcastStreams(0),
+ simulcastStream(),
+ spatialLayers(),
+ mode(kRealtimeVideo),
+ codec_specific_() {}
+
+VideoCodecVP8* VideoCodec::VP8() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
+ return &codec_specific_.VP8;
+}
+
+const VideoCodecVP8& VideoCodec::VP8() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
+ return codec_specific_.VP8;
+}
+
+VideoCodecVP9* VideoCodec::VP9() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
+ return &codec_specific_.VP9;
+}
+
+const VideoCodecVP9& VideoCodec::VP9() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
+ return codec_specific_.VP9;
+}
+
+VideoCodecH264* VideoCodec::H264() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecH264);
+ return &codec_specific_.H264;
+}
+
+const VideoCodecH264& VideoCodec::H264() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecH264);
+ return codec_specific_.H264;
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698