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

Side by Side Diff: remoting/host/audio_capturer_linux.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/audio_capturer_linux.h ('k') | remoting/host/branding.h » ('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 "remoting/host/audio_capturer_linux.h" 5 #include "remoting/host/audio_capturer_linux.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "remoting/proto/audio.pb.h" 10 #include "remoting/proto/audio.pb.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 namespace { 14 namespace {
15 15
16 // PulseAudio's module-pipe-sink must be configured to use the following 16 // PulseAudio's module-pipe-sink must be configured to use the following
17 // parameters for the sink we read from. 17 // parameters for the sink we read from.
18 const AudioPacket_SamplingRate kSamplingRate = AudioPacket::SAMPLING_RATE_48000; 18 const AudioPacket_SamplingRate kSamplingRate = AudioPacket::SAMPLING_RATE_48000;
19 19
20 base::LazyInstance<scoped_refptr<AudioPipeReader> >::Leaky 20 base::LazyInstance<scoped_refptr<AudioPipeReader> >::Leaky
21 g_pulseaudio_pipe_sink_reader = LAZY_INSTANCE_INITIALIZER; 21 g_pulseaudio_pipe_sink_reader = LAZY_INSTANCE_INITIALIZER;
22 22
23 } // namespace 23 } // namespace
24 24
25 // TODO(wez): Remove this and have the DesktopEnvironmentFactory own the 25 // TODO(wez): Remove this and have the DesktopEnvironmentFactory own the
26 // AudioPipeReader rather than having it process-global. 26 // AudioPipeReader rather than having it process-global.
27 // See crbug.com/161373 and crbug.com/104544. 27 // See crbug.com/161373 and crbug.com/104544.
28 void AudioCapturerLinux::InitializePipeReader( 28 void AudioCapturerLinux::InitializePipeReader(
29 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 29 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
30 const FilePath& pipe_name) { 30 const base::FilePath& pipe_name) {
31 scoped_refptr<AudioPipeReader> pipe_reader; 31 scoped_refptr<AudioPipeReader> pipe_reader;
32 if (!pipe_name.empty()) 32 if (!pipe_name.empty())
33 pipe_reader = AudioPipeReader::Create(task_runner, pipe_name); 33 pipe_reader = AudioPipeReader::Create(task_runner, pipe_name);
34 g_pulseaudio_pipe_sink_reader.Get() = pipe_reader; 34 g_pulseaudio_pipe_sink_reader.Get() = pipe_reader;
35 } 35 }
36 36
37 AudioCapturerLinux::AudioCapturerLinux( 37 AudioCapturerLinux::AudioCapturerLinux(
38 scoped_refptr<AudioPipeReader> pipe_reader) 38 scoped_refptr<AudioPipeReader> pipe_reader)
39 : pipe_reader_(pipe_reader), 39 : pipe_reader_(pipe_reader),
40 silence_detector_(0) { 40 silence_detector_(0) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 scoped_ptr<AudioCapturer> AudioCapturer::Create() { 85 scoped_ptr<AudioCapturer> AudioCapturer::Create() {
86 scoped_refptr<AudioPipeReader> reader = 86 scoped_refptr<AudioPipeReader> reader =
87 g_pulseaudio_pipe_sink_reader.Get(); 87 g_pulseaudio_pipe_sink_reader.Get();
88 if (!reader) 88 if (!reader)
89 return scoped_ptr<AudioCapturer>(); 89 return scoped_ptr<AudioCapturer>();
90 return scoped_ptr<AudioCapturer>(new AudioCapturerLinux(reader)); 90 return scoped_ptr<AudioCapturer>(new AudioCapturerLinux(reader));
91 } 91 }
92 92
93 } // namespace remoting 93 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/audio_capturer_linux.h ('k') | remoting/host/branding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698