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

Side by Side Diff: media/audio/pulse/audio_manager_pulse.cc

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Control through AudioManager. Compiles on Linux, works with PulseAudio. Created 3 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pulse/audio_manager_pulse.h" 5 #include "media/audio/pulse/audio_manager_pulse.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 static const int kDefaultInputBufferSize = 1024; 44 static const int kDefaultInputBufferSize = 1024;
45 45
46 #if defined(DLOPEN_PULSEAUDIO) 46 #if defined(DLOPEN_PULSEAUDIO)
47 static const base::FilePath::CharType kPulseLib[] = 47 static const base::FilePath::CharType kPulseLib[] =
48 FILE_PATH_LITERAL("libpulse.so.0"); 48 FILE_PATH_LITERAL("libpulse.so.0");
49 #endif 49 #endif
50 50
51 AudioManagerPulse::AudioManagerPulse( 51 AudioManagerPulse::AudioManagerPulse(
52 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 52 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
53 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 53 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
54 AudioLogFactory* audio_log_factory) 54 AudioLogFactory* audio_log_factory,
55 CreateAudioFileWriterCallback create_audio_file_writer_callback)
55 : AudioManagerBase(std::move(task_runner), 56 : AudioManagerBase(std::move(task_runner),
56 std::move(worker_task_runner), 57 std::move(worker_task_runner),
57 audio_log_factory), 58 audio_log_factory,
59 std::move(create_audio_file_writer_callback)),
58 input_mainloop_(NULL), 60 input_mainloop_(NULL),
59 input_context_(NULL), 61 input_context_(NULL),
60 devices_(NULL), 62 devices_(NULL),
61 native_input_sample_rate_(0), 63 native_input_sample_rate_(0),
62 native_channel_count_(0) { 64 native_channel_count_(0) {
63 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 65 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
64 } 66 }
65 67
66 AudioManagerPulse::~AudioManagerPulse() { 68 AudioManagerPulse::~AudioManagerPulse() {
67 Shutdown(); 69 Shutdown();
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 const pa_server_info* info, 351 const pa_server_info* info,
350 void* user_data) { 352 void* user_data) {
351 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); 353 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data);
352 354
353 manager->native_input_sample_rate_ = info->sample_spec.rate; 355 manager->native_input_sample_rate_ = info->sample_spec.rate;
354 manager->native_channel_count_ = info->sample_spec.channels; 356 manager->native_channel_count_ = info->sample_spec.channels;
355 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); 357 pa_threaded_mainloop_signal(manager->input_mainloop_, 0);
356 } 358 }
357 359
358 } // namespace media 360 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698