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

Side by Side Diff: chrome/renderer/media/cast_receiver_session.cc

Issue 1714593003: Introduce media::AudioPushFifo and a couple of use cases (and clean-ups). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win compile issue. 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698