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

Side by Side Diff: content/renderer/media/webrtc_local_audio_renderer.cc

Issue 21183002: Adding key press detection in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/media/webrtc_local_audio_renderer.h" 5 #include "content/renderer/media/webrtc_local_audio_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 return audio_bus->frames(); 46 return audio_bus->frames();
47 } 47 }
48 48
49 void WebRtcLocalAudioRenderer::OnRenderError() { 49 void WebRtcLocalAudioRenderer::OnRenderError() {
50 NOTIMPLEMENTED(); 50 NOTIMPLEMENTED();
51 } 51 }
52 52
53 // content::WebRtcAudioCapturerSink implementation 53 // content::WebRtcAudioCapturerSink implementation
54 int WebRtcLocalAudioRenderer::CaptureData(const std::vector<int>& channels, 54 int WebRtcLocalAudioRenderer::CaptureData(const std::vector<int>& channels,
55 const int16* audio_data, 55 const int16* audio_data,
56 int sample_rate, 56 int sample_rate,
57 int number_of_channels, 57 int number_of_channels,
58 int number_of_frames, 58 int number_of_frames,
59 int audio_delay_milliseconds, 59 int audio_delay_milliseconds,
60 int current_volume, 60 int current_volume,
61 bool need_audio_processing) { 61 bool need_audio_processing,
62 bool key_pressed) {
62 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData"); 63 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData");
63 base::AutoLock auto_lock(thread_lock_); 64 base::AutoLock auto_lock(thread_lock_);
64 65
65 if (!playing_) 66 if (!playing_)
66 return 0; 67 return 0;
67 68
68 // Push captured audio to FIFO so it can be read by a local sink. 69 // Push captured audio to FIFO so it can be read by a local sink.
69 if (loopback_fifo_) { 70 if (loopback_fifo_) {
70 if (loopback_fifo_->frames() + number_of_frames <= 71 if (loopback_fifo_->frames() + number_of_frames <=
71 loopback_fifo_->max_frames()) { 72 loopback_fifo_->max_frames()) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!sink_.get()) 240 if (!sink_.get())
240 return base::TimeDelta(); 241 return base::TimeDelta();
241 return total_render_time(); 242 return total_render_time();
242 } 243 }
243 244
244 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { 245 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const {
245 return true; 246 return true;
246 } 247 }
247 248
248 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_local_audio_renderer.h ('k') | content/renderer/media/webrtc_local_audio_track.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698