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

Unified Diff: webrtc/media/webrtc/webrtcvoiceengine.cc

Issue 1646253004: Split out dscp option from VideoOptions to new struct MediaChannelOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 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/webrtc/webrtcvoiceengine.h ('k') | webrtc/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/webrtc/webrtcvoiceengine.cc
diff --git a/webrtc/media/webrtc/webrtcvoiceengine.cc b/webrtc/media/webrtc/webrtcvoiceengine.cc
index afdc6783ace9434805574425bf6e2ecaa46b9af1..dfb79f08a0d263741069c478b494be140dd469ff 100644
--- a/webrtc/media/webrtc/webrtcvoiceengine.cc
+++ b/webrtc/media/webrtc/webrtcvoiceengine.cc
@@ -667,9 +667,10 @@ rtc::scoped_refptr<webrtc::AudioState>
}
VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel(webrtc::Call* call,
- const AudioOptions& options) {
+ const MediaChannelOptions& options,
+ const AudioOptions& audio_options) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- return new WebRtcVoiceMediaChannel(this, options, call);
+ return new WebRtcVoiceMediaChannel(this, options, audio_options, call);
}
bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
@@ -1382,14 +1383,16 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioReceiveStream);
};
-WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine,
- const AudioOptions& options,
- webrtc::Call* call)
- : engine_(engine), call_(call) {
+WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(
+ WebRtcVoiceEngine* engine,
+ const MediaChannelOptions& options,
+ const AudioOptions& audio_options,
+ webrtc::Call* call)
+ : VoiceMediaChannel(options), engine_(engine), call_(call) {
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel";
RTC_DCHECK(call);
engine->RegisterChannel(this);
- SetOptions(options);
+ SetOptions(audio_options);
}
WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() {
@@ -1407,6 +1410,10 @@ WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() {
engine()->UnregisterChannel(this);
}
+rtc::DiffServCodePoint WebRtcVoiceMediaChannel::MediaTypeDscpValue() const {
+ return kAudioDscpValue;
+}
+
bool WebRtcVoiceMediaChannel::SetSendParameters(
const AudioSendParameters& params) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
@@ -1470,9 +1477,6 @@ bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) {
LOG(LS_INFO) << "Setting voice channel options: "
<< options.ToString();
- // Check if DSCP value is changed from previous.
- bool dscp_option_changed = (options_.dscp != options.dscp);
-
// We retain all of the existing options, and apply the given ones
// on top. This means there is no way to "clear" options such that
// they go back to the engine default.
@@ -1483,16 +1487,6 @@ bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) {
return false;
}
- if (dscp_option_changed) {
- rtc::DiffServCodePoint dscp = rtc::DSCP_DEFAULT;
- if (options_.dscp.value_or(false)) {
- dscp = kAudioDscpValue;
- }
- if (MediaChannel::SetDscp(dscp) != 0) {
- LOG(LS_WARNING) << "Failed to set DSCP settings for audio channel";
- }
- }
-
LOG(LS_INFO) << "Set voice channel options. Current options: "
<< options_.ToString();
return true;
« no previous file with comments | « webrtc/media/webrtc/webrtcvoiceengine.h ('k') | webrtc/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698