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

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

Issue 9805001: Move media/audio files into media namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « media/audio/pulse/pulse_output.h ('k') | media/audio/simple_sources.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "media/audio/audio_parameters.h" 9 #include "media/audio/audio_parameters.h"
10 #include "media/audio/audio_util.h" 10 #include "media/audio/audio_util.h"
11 #if defined(OS_LINUX) 11 #if defined(OS_LINUX)
12 #include "media/audio/linux/audio_manager_linux.h" 12 #include "media/audio/linux/audio_manager_linux.h"
13 #elif defined(OS_OPENBSD) 13 #elif defined(OS_OPENBSD)
14 #include "media/audio/openbsd/audio_manager_openbsd.h" 14 #include "media/audio/openbsd/audio_manager_openbsd.h"
15 #endif 15 #endif
16 #include "media/base/data_buffer.h" 16 #include "media/base/data_buffer.h"
17 #include "media/base/seekable_buffer.h" 17 #include "media/base/seekable_buffer.h"
18 18
19 namespace media {
20
19 static pa_sample_format_t BitsToPASampleFormat(int bits_per_sample) { 21 static pa_sample_format_t BitsToPASampleFormat(int bits_per_sample) {
20 switch (bits_per_sample) { 22 switch (bits_per_sample) {
21 // Unsupported sample formats shown for reference. I am assuming we want 23 // Unsupported sample formats shown for reference. I am assuming we want
22 // signed and little endian because that is what we gave to ALSA. 24 // signed and little endian because that is what we gave to ALSA.
23 case 8: 25 case 8:
24 return PA_SAMPLE_U8; 26 return PA_SAMPLE_U8;
25 // Also 8-bits: PA_SAMPLE_ALAW and PA_SAMPLE_ULAW 27 // Also 8-bits: PA_SAMPLE_ALAW and PA_SAMPLE_ULAW
26 case 16: 28 case 16:
27 return PA_SAMPLE_S16LE; 29 return PA_SAMPLE_S16LE;
28 // Also 16-bits: PA_SAMPLE_S16BE (big endian). 30 // Also 16-bits: PA_SAMPLE_S16BE (big endian).
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 *volume = volume_; 421 *volume = volume_;
420 } 422 }
421 423
422 uint32 PulseAudioOutputStream::RunDataCallback( 424 uint32 PulseAudioOutputStream::RunDataCallback(
423 uint8* dest, uint32 max_size, AudioBuffersState buffers_state) { 425 uint8* dest, uint32 max_size, AudioBuffersState buffers_state) {
424 if (source_callback_) 426 if (source_callback_)
425 return source_callback_->OnMoreData(this, dest, max_size, buffers_state); 427 return source_callback_->OnMoreData(this, dest, max_size, buffers_state);
426 428
427 return 0; 429 return 0;
428 } 430 }
431
432 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/pulse/pulse_output.h ('k') | media/audio/simple_sources.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698