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

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

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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 "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 // Restart the timer to ensure that we check the flag again in 500 // Restart the timer to ensure that we check the flag again in
501 // |kTimerResetIntervalSeconds|. 501 // |kTimerResetIntervalSeconds|.
502 no_data_timer_->Start( 502 no_data_timer_->Start(
503 FROM_HERE, base::TimeDelta::FromSeconds(kTimerResetIntervalSeconds), 503 FROM_HERE, base::TimeDelta::FromSeconds(kTimerResetIntervalSeconds),
504 base::Bind(&AudioInputController::DoCheckForNoData, 504 base::Bind(&AudioInputController::DoCheckForNoData,
505 base::Unretained(this))); 505 base::Unretained(this)));
506 } 506 }
507 507
508 void AudioInputController::OnData(AudioInputStream* stream, 508 void AudioInputController::OnData(AudioInputStream* stream,
509 const AudioBus* source, 509 const AudioBus* source,
510 uint32 hardware_delay_bytes, 510 uint32_t hardware_delay_bytes,
511 double volume) { 511 double volume) {
512 // |input_writer_| should only be accessed on the audio thread, but as a means 512 // |input_writer_| should only be accessed on the audio thread, but as a means
513 // to avoid copying data and posting on the audio thread, we just check for 513 // to avoid copying data and posting on the audio thread, we just check for
514 // non-null here. 514 // non-null here.
515 if (input_writer_) { 515 if (input_writer_) {
516 scoped_ptr<AudioBus> source_copy = 516 scoped_ptr<AudioBus> source_copy =
517 AudioBus::Create(source->channels(), source->frames()); 517 AudioBus::Create(source->channels(), source->frames());
518 source->CopyTo(source_copy.get()); 518 source->CopyTo(source_copy.get());
519 task_runner_->PostTask( 519 task_runner_->PostTask(
520 FROM_HERE, 520 FROM_HERE,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 } 727 }
728 728
729 void AudioInputController::WriteInputDataForDebugging( 729 void AudioInputController::WriteInputDataForDebugging(
730 scoped_ptr<AudioBus> data) { 730 scoped_ptr<AudioBus> data) {
731 DCHECK(task_runner_->BelongsToCurrentThread()); 731 DCHECK(task_runner_->BelongsToCurrentThread());
732 if (input_writer_) 732 if (input_writer_)
733 input_writer_->Write(data.Pass()); 733 input_writer_->Write(data.Pass());
734 } 734 }
735 735
736 } // namespace media 736 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698