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

Side by Side Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1486123002: Return a copy of the supported RTP header extensions instead of a reference. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 signal_thread_checker_.DetachFromThread(); 518 signal_thread_checker_.DetachFromThread();
519 std::memset(&default_agc_config_, 0, sizeof(default_agc_config_)); 519 std::memset(&default_agc_config_, 0, sizeof(default_agc_config_));
520 520
521 webrtc::Trace::set_level_filter(kDefaultTraceFilter); 521 webrtc::Trace::set_level_filter(kDefaultTraceFilter);
522 webrtc::Trace::SetTraceCallback(this); 522 webrtc::Trace::SetTraceCallback(this);
523 523
524 // Load our audio codec list. 524 // Load our audio codec list.
525 codecs_ = WebRtcVoiceCodecs::SupportedCodecs(); 525 codecs_ = WebRtcVoiceCodecs::SupportedCodecs();
526 526
527 // Load our RTP Header extensions.
528 rtp_header_extensions_.push_back(
529 RtpHeaderExtension(kRtpAudioLevelHeaderExtension,
530 kRtpAudioLevelHeaderExtensionDefaultId));
531 rtp_header_extensions_.push_back(
532 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension,
533 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId));
534 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") {
535 rtp_header_extensions_.push_back(RtpHeaderExtension(
536 kRtpTransportSequenceNumberHeaderExtension,
537 kRtpTransportSequenceNumberHeaderExtensionDefaultId));
538 }
539 options_ = GetDefaultEngineOptions(); 527 options_ = GetDefaultEngineOptions();
540 } 528 }
541 529
542 WebRtcVoiceEngine::~WebRtcVoiceEngine() { 530 WebRtcVoiceEngine::~WebRtcVoiceEngine() {
543 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 531 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
544 LOG(LS_VERBOSE) << "WebRtcVoiceEngine::~WebRtcVoiceEngine"; 532 LOG(LS_VERBOSE) << "WebRtcVoiceEngine::~WebRtcVoiceEngine";
545 if (adm_) { 533 if (adm_) {
546 voe_wrapper_.reset(); 534 voe_wrapper_.reset();
547 adm_->Release(); 535 adm_->Release();
548 adm_ = NULL; 536 adm_ = NULL;
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 unsigned int ulevel; 1078 unsigned int ulevel;
1091 return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ? 1079 return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ?
1092 static_cast<int>(ulevel) : -1; 1080 static_cast<int>(ulevel) : -1;
1093 } 1081 }
1094 1082
1095 const std::vector<AudioCodec>& WebRtcVoiceEngine::codecs() { 1083 const std::vector<AudioCodec>& WebRtcVoiceEngine::codecs() {
1096 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); 1084 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread());
1097 return codecs_; 1085 return codecs_;
1098 } 1086 }
1099 1087
1100 const std::vector<RtpHeaderExtension>& 1088 std::vector<RtpHeaderExtension>
1101 WebRtcVoiceEngine::rtp_header_extensions() const { 1089 WebRtcVoiceEngine::SupportedRtpHeaderExtensions() const {
1102 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); 1090 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread());
1103 return rtp_header_extensions_; 1091 std::vector<RtpHeaderExtension> rtp_header_extensions;
1092 rtp_header_extensions.push_back(RtpHeaderExtension(
1093 kRtpAudioLevelHeaderExtension, kRtpAudioLevelHeaderExtensionDefaultId));
1094 rtp_header_extensions.push_back(
1095 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension,
1096 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId));
1097 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") {
1098 rtp_header_extensions.push_back(RtpHeaderExtension(
1099 kRtpTransportSequenceNumberHeaderExtension,
1100 kRtpTransportSequenceNumberHeaderExtensionDefaultId));
1101 }
1102 return rtp_header_extensions;
1104 } 1103 }
1105 1104
1106 int WebRtcVoiceEngine::GetLastEngineError() { 1105 int WebRtcVoiceEngine::GetLastEngineError() {
1107 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1106 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
1108 return voe_wrapper_->error(); 1107 return voe_wrapper_->error();
1109 } 1108 }
1110 1109
1111 void WebRtcVoiceEngine::Print(webrtc::TraceLevel level, const char* trace, 1110 void WebRtcVoiceEngine::Print(webrtc::TraceLevel level, const char* trace,
1112 int length) { 1111 int length) {
1113 // Note: This callback can happen on any thread! 1112 // Note: This callback can happen on any thread!
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 } 2661 }
2663 } else { 2662 } else {
2664 LOG(LS_INFO) << "Stopping playout for channel #" << channel; 2663 LOG(LS_INFO) << "Stopping playout for channel #" << channel;
2665 engine()->voe()->base()->StopPlayout(channel); 2664 engine()->voe()->base()->StopPlayout(channel);
2666 } 2665 }
2667 return true; 2666 return true;
2668 } 2667 }
2669 } // namespace cricket 2668 } // namespace cricket
2670 2669
2671 #endif // HAVE_WEBRTC_VOICE 2670 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698