| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 void CastReceiverSession::AudioCapturerSource::Initialize( | 171 void CastReceiverSession::AudioCapturerSource::Initialize( |
| 172 const media::AudioParameters& params, | 172 const media::AudioParameters& params, |
| 173 CaptureCallback* callback, | 173 CaptureCallback* callback, |
| 174 int session_id) { | 174 int session_id) { |
| 175 // TODO(hubbe): Consider converting the audio to whatever the caller wants. | 175 // TODO(hubbe): Consider converting the audio to whatever the caller wants. |
| 176 if (params.sample_rate() != | 176 if (params.sample_rate() != |
| 177 cast_receiver_session_->audio_config_.rtp_timebase || | 177 cast_receiver_session_->audio_config_.rtp_timebase || |
| 178 params.channels() != cast_receiver_session_->audio_config_.channels) { | 178 params.channels() != cast_receiver_session_->audio_config_.channels) { |
| 179 callback->OnCaptureError(); | 179 callback->OnCaptureError(std::string()); |
| 180 return; | 180 return; |
| 181 } | 181 } |
| 182 audio_valve_ = new CastReceiverAudioValve(callback); | 182 audio_valve_ = new CastReceiverAudioValve(callback); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void CastReceiverSession::AudioCapturerSource::Start() { | 185 void CastReceiverSession::AudioCapturerSource::Start() { |
| 186 DCHECK(audio_valve_); | 186 DCHECK(audio_valve_); |
| 187 cast_receiver_session_->StartAudio(audio_valve_); | 187 cast_receiver_session_->StartAudio(audio_valve_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void CastReceiverSession::AudioCapturerSource::Stop() { | 190 void CastReceiverSession::AudioCapturerSource::Stop() { |
| 191 audio_valve_->Stop(); | 191 audio_valve_->Stop(); |
| 192 audio_valve_ = nullptr; | 192 audio_valve_ = nullptr; |
| 193 } | 193 } |
| 194 | 194 |
| 195 void CastReceiverSession::AudioCapturerSource::SetVolume(double volume) { | 195 void CastReceiverSession::AudioCapturerSource::SetVolume(double volume) { |
| 196 // not supported | 196 // not supported |
| 197 } | 197 } |
| 198 | 198 |
| 199 void CastReceiverSession::AudioCapturerSource::SetAutomaticGainControl( | 199 void CastReceiverSession::AudioCapturerSource::SetAutomaticGainControl( |
| 200 bool enable) { | 200 bool enable) { |
| 201 // not supported | 201 // not supported |
| 202 } | 202 } |
| OLD | NEW |