| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/media/cast_receiver_session.h" | 5 #include "chrome/renderer/media/cast_receiver_session.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "chrome/renderer/media/cast_receiver_audio_valve.h" | 10 #include "chrome/renderer/media/cast_receiver_audio_valve.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 const media::AudioParameters& params, | 162 const media::AudioParameters& params, |
| 163 CaptureCallback* callback, | 163 CaptureCallback* callback, |
| 164 int session_id) { | 164 int session_id) { |
| 165 // TODO(hubbe): Consider converting the audio to whatever the caller wants. | 165 // TODO(hubbe): Consider converting the audio to whatever the caller wants. |
| 166 if (params.sample_rate() != | 166 if (params.sample_rate() != |
| 167 cast_receiver_session_->audio_config_.rtp_timebase || | 167 cast_receiver_session_->audio_config_.rtp_timebase || |
| 168 params.channels() != cast_receiver_session_->audio_config_.channels) { | 168 params.channels() != cast_receiver_session_->audio_config_.channels) { |
| 169 callback->OnCaptureError(std::string()); | 169 callback->OnCaptureError(std::string()); |
| 170 return; | 170 return; |
| 171 } | 171 } |
| 172 audio_valve_ = new CastReceiverAudioValve(callback); | 172 audio_valve_ = new CastReceiverAudioValve(params, callback); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void CastReceiverSession::AudioCapturerSource::Start() { | 175 void CastReceiverSession::AudioCapturerSource::Start() { |
| 176 DCHECK(audio_valve_); | 176 DCHECK(audio_valve_); |
| 177 cast_receiver_session_->StartAudio(audio_valve_); | 177 cast_receiver_session_->StartAudio(audio_valve_); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void CastReceiverSession::AudioCapturerSource::Stop() { | 180 void CastReceiverSession::AudioCapturerSource::Stop() { |
| 181 audio_valve_->Stop(); | 181 audio_valve_->Stop(); |
| 182 audio_valve_ = nullptr; | 182 audio_valve_ = nullptr; |
| 183 } | 183 } |
| 184 | 184 |
| 185 void CastReceiverSession::AudioCapturerSource::SetVolume(double volume) { | 185 void CastReceiverSession::AudioCapturerSource::SetVolume(double volume) { |
| 186 // not supported | 186 // not supported |
| 187 } | 187 } |
| 188 | 188 |
| 189 void CastReceiverSession::AudioCapturerSource::SetAutomaticGainControl( | 189 void CastReceiverSession::AudioCapturerSource::SetAutomaticGainControl( |
| 190 bool enable) { | 190 bool enable) { |
| 191 // not supported | 191 // not supported |
| 192 } | 192 } |
| OLD | NEW |