| OLD | NEW |
| 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 "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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 default: | 41 default: |
| 42 return PA_SAMPLE_INVALID; | 42 return PA_SAMPLE_INVALID; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 static pa_channel_position ChromiumToPAChannelPosition(Channels channel) { | 46 static pa_channel_position ChromiumToPAChannelPosition(Channels channel) { |
| 47 switch (channel) { | 47 switch (channel) { |
| 48 // PulseAudio does not differentiate between left/right and | 48 // PulseAudio does not differentiate between left/right and |
| 49 // stereo-left/stereo-right, both translate to front-left/front-right. | 49 // stereo-left/stereo-right, both translate to front-left/front-right. |
| 50 case LEFT: | 50 case LEFT: |
| 51 case STEREO_LEFT: | |
| 52 return PA_CHANNEL_POSITION_FRONT_LEFT; | 51 return PA_CHANNEL_POSITION_FRONT_LEFT; |
| 53 case RIGHT: | 52 case RIGHT: |
| 54 case STEREO_RIGHT: | |
| 55 return PA_CHANNEL_POSITION_FRONT_RIGHT; | 53 return PA_CHANNEL_POSITION_FRONT_RIGHT; |
| 56 case CENTER: | 54 case CENTER: |
| 57 return PA_CHANNEL_POSITION_FRONT_CENTER; | 55 return PA_CHANNEL_POSITION_FRONT_CENTER; |
| 58 case LFE: | 56 case LFE: |
| 59 return PA_CHANNEL_POSITION_LFE; | 57 return PA_CHANNEL_POSITION_LFE; |
| 60 case BACK_LEFT: | 58 case BACK_LEFT: |
| 61 return PA_CHANNEL_POSITION_REAR_LEFT; | 59 return PA_CHANNEL_POSITION_REAR_LEFT; |
| 62 case BACK_RIGHT: | 60 case BACK_RIGHT: |
| 63 return PA_CHANNEL_POSITION_REAR_RIGHT; | 61 return PA_CHANNEL_POSITION_REAR_RIGHT; |
| 64 case LEFT_OF_CENTER: | 62 case LEFT_OF_CENTER: |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 427 |
| 430 int PulseAudioOutputStream::RunDataCallback( | 428 int PulseAudioOutputStream::RunDataCallback( |
| 431 AudioBus* audio_bus, AudioBuffersState buffers_state) { | 429 AudioBus* audio_bus, AudioBuffersState buffers_state) { |
| 432 if (source_callback_) | 430 if (source_callback_) |
| 433 return source_callback_->OnMoreData(audio_bus, buffers_state); | 431 return source_callback_->OnMoreData(audio_bus, buffers_state); |
| 434 | 432 |
| 435 return 0; | 433 return 0; |
| 436 } | 434 } |
| 437 | 435 |
| 438 } // namespace media | 436 } // namespace media |
| OLD | NEW |