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

Side by Side Diff: media/audio/audio_input_device.cc

Issue 1302423006: Ensure that data is not overwritten in the audio input shared memory ring buffer that sits on the b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed log call expectations for Android in unit test. Rebase. Created 5 years, 3 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
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "media/audio/audio_input_device.h" 5 #include "media/audio/audio_input_device.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice. 135 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice.
136 // Interface changes need to be made; likely, after AudioInputDevice is merged 136 // Interface changes need to be made; likely, after AudioInputDevice is merged
137 // into AudioOutputDevice (http://crbug.com/179597). 137 // into AudioOutputDevice (http://crbug.com/179597).
138 if (stopping_hack_) 138 if (stopping_hack_)
139 return; 139 return;
140 140
141 DCHECK(audio_thread_.IsStopped()); 141 DCHECK(audio_thread_.IsStopped());
142 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback( 142 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback(
143 audio_parameters_, handle, length, total_segments, callback_)); 143 audio_parameters_, handle, length, total_segments, callback_));
144 audio_thread_.Start( 144 audio_thread_.Start(
145 audio_callback_.get(), socket_handle, "AudioInputDevice", false); 145 audio_callback_.get(), socket_handle, "AudioInputDevice", true);
146 146
147 state_ = RECORDING; 147 state_ = RECORDING;
148 ipc_->RecordStream(); 148 ipc_->RecordStream();
149 } 149 }
150 150
151 void AudioInputDevice::OnVolume(double volume) { 151 void AudioInputDevice::OnVolume(double volume) {
152 NOTIMPLEMENTED(); 152 NOTIMPLEMENTED();
153 } 153 }
154 154
155 void AudioInputDevice::OnStateChanged( 155 void AudioInputDevice::OnStateChanged(
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 audio_bus, 336 audio_bus,
337 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms 337 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms
338 buffer->params.volume, 338 buffer->params.volume,
339 buffer->params.key_pressed); 339 buffer->params.key_pressed);
340 340
341 if (++current_segment_id_ >= total_segments_) 341 if (++current_segment_id_ >= total_segments_)
342 current_segment_id_ = 0; 342 current_segment_id_ = 0;
343 } 343 }
344 344
345 } // namespace media 345 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698