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

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

Issue 1317033006: Linux: Do not use a hard coded app name for PulseAudio output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_manager.cc ('k') | media/audio/pulse/pulse_util.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 "media/audio/pulse/pulse_output.h" 5 #include "media/audio/pulse/pulse_output.h"
6 6
7 #include <pulse/pulseaudio.h> 7 #include <pulse/pulseaudio.h>
8 8
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "media/audio/audio_manager_base.h" 10 #include "media/audio/audio_manager_base.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 PulseAudioOutputStream::~PulseAudioOutputStream() { 55 PulseAudioOutputStream::~PulseAudioOutputStream() {
56 // All internal structures should already have been freed in Close(), which 56 // All internal structures should already have been freed in Close(), which
57 // calls AudioManagerBase::ReleaseOutputStream() which deletes this object. 57 // calls AudioManagerBase::ReleaseOutputStream() which deletes this object.
58 DCHECK(!pa_stream_); 58 DCHECK(!pa_stream_);
59 DCHECK(!pa_context_); 59 DCHECK(!pa_context_);
60 DCHECK(!pa_mainloop_); 60 DCHECK(!pa_mainloop_);
61 } 61 }
62 62
63 bool PulseAudioOutputStream::Open() { 63 bool PulseAudioOutputStream::Open() {
64 DCHECK(thread_checker_.CalledOnValidThread()); 64 DCHECK(thread_checker_.CalledOnValidThread());
65 return pulse::CreateOutputStream(&pa_mainloop_, &pa_context_, &pa_stream_, 65 return pulse::CreateOutputStream(
66 params_, device_id_, &StreamNotifyCallback, 66 &pa_mainloop_, &pa_context_, &pa_stream_, params_, device_id_,
67 &StreamRequestCallback, this); 67 AudioManager::GetGlobalAppName(), &StreamNotifyCallback,
68 &StreamRequestCallback, this);
68 } 69 }
69 70
70 void PulseAudioOutputStream::Reset() { 71 void PulseAudioOutputStream::Reset() {
71 if (!pa_mainloop_) { 72 if (!pa_mainloop_) {
72 DCHECK(!pa_stream_); 73 DCHECK(!pa_stream_);
73 DCHECK(!pa_context_); 74 DCHECK(!pa_context_);
74 return; 75 return;
75 } 76 }
76 77
77 { 78 {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 volume_ = static_cast<float>(volume); 228 volume_ = static_cast<float>(volume);
228 } 229 }
229 230
230 void PulseAudioOutputStream::GetVolume(double* volume) { 231 void PulseAudioOutputStream::GetVolume(double* volume) {
231 DCHECK(thread_checker_.CalledOnValidThread()); 232 DCHECK(thread_checker_.CalledOnValidThread());
232 233
233 *volume = volume_; 234 *volume = volume_;
234 } 235 }
235 236
236 } // namespace media 237 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_manager.cc ('k') | media/audio/pulse/pulse_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698