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

Unified Diff: webrtc/media/base/codec.cc

Issue 2651883010: Adding C++ versions of currently spec'd "RtpParameters" structs. (Closed)
Patch Set: Update unit tests (due to switch from special-case values to rtc::Optional) Created 3 years, 10 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/media/base/codec.h ('k') | webrtc/media/base/codec_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/codec.cc
diff --git a/webrtc/media/base/codec.cc b/webrtc/media/base/codec.cc
index 75e5a7bf71d7574f203a63c659ece7b86b75135c..1e305a60b71369e41b797e6b388f15b33f0f7438 100644
--- a/webrtc/media/base/codec.cc
+++ b/webrtc/media/base/codec.cc
@@ -149,8 +149,8 @@ void Codec::IntersectFeedbackParams(const Codec& other) {
webrtc::RtpCodecParameters Codec::ToCodecParameters() const {
webrtc::RtpCodecParameters codec_params;
codec_params.payload_type = id;
- codec_params.mime_type = name;
- codec_params.clock_rate = clockrate;
+ codec_params.name = name;
+ codec_params.clock_rate = rtc::Optional<int>(clockrate);
return codec_params;
}
@@ -190,12 +190,6 @@ bool AudioCodec::Matches(const AudioCodec& codec) const {
((codec.channels < 2 && channels < 2) || channels == codec.channels);
}
-webrtc::RtpCodecParameters AudioCodec::ToCodecParameters() const {
- webrtc::RtpCodecParameters codec_params = Codec::ToCodecParameters();
- codec_params.channels = static_cast<int>(channels);
- return codec_params;
-}
-
std::string AudioCodec::ToString() const {
std::ostringstream os;
os << "AudioCodec[" << id << ":" << name << ":" << clockrate << ":" << bitrate
@@ -203,12 +197,25 @@ std::string AudioCodec::ToString() const {
return os.str();
}
+webrtc::RtpCodecParameters AudioCodec::ToCodecParameters() const {
+ webrtc::RtpCodecParameters codec_params = Codec::ToCodecParameters();
+ codec_params.num_channels = rtc::Optional<int>(static_cast<int>(channels));
+ codec_params.kind = MEDIA_TYPE_AUDIO;
+ return codec_params;
+}
+
std::string VideoCodec::ToString() const {
std::ostringstream os;
os << "VideoCodec[" << id << ":" << name << "]";
return os.str();
}
+webrtc::RtpCodecParameters VideoCodec::ToCodecParameters() const {
+ webrtc::RtpCodecParameters codec_params = Codec::ToCodecParameters();
+ codec_params.kind = MEDIA_TYPE_VIDEO;
+ return codec_params;
+}
+
VideoCodec::VideoCodec(int id, const std::string& name)
: Codec(id, name, kVideoCodecClockrate) {
SetDefaultParameters();
« no previous file with comments | « webrtc/media/base/codec.h ('k') | webrtc/media/base/codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698