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

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: 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 | « webrtc/common_types.h ('k') | webrtc/modules/video_coding/codec_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.cc
diff --git a/webrtc/common_types.cc b/webrtc/common_types.cc
index 8f117e11530b027fd80aea33354804ec8676e326..e78a4aacca75f538e663dcf00732a691ad9570f8 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>
@@ -42,4 +43,52 @@ RTPHeader::RTPHeader()
payload_type_frequency(0),
extension() {}
+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),
+ codecSpecific() {}
+
+VideoCodecVP8* VideoCodec::VP8() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
+ return &codecSpecific.VP8;
+}
+
+const VideoCodecVP8& VideoCodec::VP8() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
+ return codecSpecific.VP8;
+}
+
+VideoCodecVP9* VideoCodec::VP9() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
+ return &codecSpecific.VP9;
+}
+
+const VideoCodecVP9& VideoCodec::VP9() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
+ return codecSpecific.VP9;
+}
+
+VideoCodecH264* VideoCodec::H264() {
+ RTC_DCHECK_EQ(codecType, kVideoCodecH264);
+ return &codecSpecific.H264;
+}
+
+const VideoCodecH264& VideoCodec::H264() const {
+ RTC_DCHECK_EQ(codecType, kVideoCodecH264);
+ return codecSpecific.H264;
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/common_types.h ('k') | webrtc/modules/video_coding/codec_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698