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

Side by Side Diff: media/audio/mac/audio_manager_mac.cc

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Reworked callbacks and interfaces. Created 3 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 (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/mac/audio_manager_mac.h" 5 #include "media/audio/mac/audio_manager_mac.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 base::TimeTicks earliest_start_time_; 354 base::TimeTicks earliest_start_time_;
355 base::ThreadChecker thread_checker_; 355 base::ThreadChecker thread_checker_;
356 size_t num_resume_notifications_; 356 size_t num_resume_notifications_;
357 357
358 DISALLOW_COPY_AND_ASSIGN(AudioPowerObserver); 358 DISALLOW_COPY_AND_ASSIGN(AudioPowerObserver);
359 }; 359 };
360 360
361 AudioManagerMac::AudioManagerMac( 361 AudioManagerMac::AudioManagerMac(
362 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 362 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
363 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 363 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
364 AudioLogFactory* audio_log_factory) 364 AudioLogFactory* audio_log_factory,
365 CreateAudioFileWriterCallback create_audio_file_writer_callback)
365 : AudioManagerBase(std::move(task_runner), 366 : AudioManagerBase(std::move(task_runner),
366 std::move(worker_task_runner), 367 std::move(worker_task_runner),
367 audio_log_factory), 368 audio_log_factory,
369 std::move(create_audio_file_writer_callback)),
368 current_sample_rate_(0), 370 current_sample_rate_(0),
369 current_output_device_(kAudioDeviceUnknown), 371 current_output_device_(kAudioDeviceUnknown),
370 in_shutdown_(false) { 372 in_shutdown_(false) {
371 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 373 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
372 374
373 // Task must be posted last to avoid races from handing out "this" to the 375 // Task must be posted last to avoid races from handing out "this" to the
374 // audio thread. Always PostTask even if we're on the right thread since 376 // audio thread. Always PostTask even if we're on the right thread since
375 // AudioManager creation is on the startup path and this may be slow. 377 // AudioManager creation is on the startup path and this may be slow.
376 GetTaskRunner()->PostTask( 378 GetTaskRunner()->PostTask(
377 FROM_HERE, base::Bind(&AudioManagerMac::InitializeOnAudioThread, 379 FROM_HERE, base::Bind(&AudioManagerMac::InitializeOnAudioThread,
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 low_latency_input_streams_.remove(static_cast<AUAudioInputStream*>(stream)); 1079 low_latency_input_streams_.remove(static_cast<AUAudioInputStream*>(stream));
1078 else 1080 else
1079 basic_input_streams_.erase(stream_it); 1081 basic_input_streams_.erase(stream_it);
1080 1082
1081 AudioManagerBase::ReleaseInputStream(stream); 1083 AudioManagerBase::ReleaseInputStream(stream);
1082 } 1084 }
1083 1085
1084 ScopedAudioManagerPtr CreateAudioManager( 1086 ScopedAudioManagerPtr CreateAudioManager(
1085 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 1087 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
1086 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 1088 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
1087 AudioLogFactory* audio_log_factory) { 1089 AudioLogFactory* audio_log_factory,
1088 return ScopedAudioManagerPtr( 1090 CreateAudioFileWriterCallback create_audio_file_writer_callback) {
1089 new AudioManagerMac(std::move(task_runner), std::move(worker_task_runner), 1091 return ScopedAudioManagerPtr(new AudioManagerMac(
1090 audio_log_factory)); 1092 std::move(task_runner), std::move(worker_task_runner), audio_log_factory,
1093 std::move(create_audio_file_writer_callback)));
1091 } 1094 }
1092 1095
1093 } // namespace media 1096 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698