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(); |