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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc

Issue 2523843002: Send audio and video codecs to RTPPayloadRegistry (Closed)
Patch Set: Change strcpy to strncpy Created 4 years, 1 month 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/modules/rtp_rtcp/source/rtp_receiver_audio.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc
index 082d2a8b18514f215d0192e2dcee57ac71299198..acc5926e5b5829db837678226958890b0f90ebb8 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc
@@ -14,6 +14,7 @@
#include <math.h> // pow()
#include <string.h> // memcpy()
+#include "webrtc/common_types.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
@@ -103,24 +104,22 @@ bool RTPReceiverAudio::ShouldReportCsrcChanges(uint8_t payload_type) const {
// -
// - G7221 frame N/A
int32_t RTPReceiverAudio::OnNewPayloadTypeCreated(
- const char payload_name[RTP_PAYLOAD_NAME_SIZE],
- int8_t payload_type,
- uint32_t frequency) {
+ const CodecInst& audio_codec) {
rtc::CritScope lock(&crit_sect_);
- if (RtpUtility::StringCompare(payload_name, "telephone-event", 15)) {
- telephone_event_payload_type_ = payload_type;
+ if (RtpUtility::StringCompare(audio_codec.plname, "telephone-event", 15)) {
+ telephone_event_payload_type_ = audio_codec.pltype;
}
- if (RtpUtility::StringCompare(payload_name, "cn", 2)) {
+ if (RtpUtility::StringCompare(audio_codec.plname, "cn", 2)) {
// We support comfort noise at four different frequencies.
- if (frequency == 8000) {
- cng_nb_payload_type_ = payload_type;
- } else if (frequency == 16000) {
- cng_wb_payload_type_ = payload_type;
- } else if (frequency == 32000) {
- cng_swb_payload_type_ = payload_type;
- } else if (frequency == 48000) {
- cng_fb_payload_type_ = payload_type;
+ if (audio_codec.plfreq == 8000) {
+ cng_nb_payload_type_ = audio_codec.pltype;
+ } else if (audio_codec.plfreq == 16000) {
+ cng_wb_payload_type_ = audio_codec.pltype;
+ } else if (audio_codec.plfreq == 32000) {
+ cng_swb_payload_type_ = audio_codec.pltype;
+ } else if (audio_codec.plfreq == 48000) {
+ cng_fb_payload_type_ = audio_codec.pltype;
} else {
assert(false);
return -1;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698