| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // The audio stream implementation is made difficult because different methods | 5 // The audio stream implementation is made difficult because different methods |
| 6 // are available for calling depending on what state the stream is. Here is the | 6 // are available for calling depending on what state the stream is. Here is the |
| 7 // state transition table for the stream. | 7 // state transition table for the stream. |
| 8 // | 8 // |
| 9 // STATE_CREATED -> Open() -> STATE_OPENED | 9 // STATE_CREATED -> Open() -> STATE_OPENED |
| 10 // STATE_OPENED -> Start() -> STATE_STARTED | 10 // STATE_OPENED -> Start() -> STATE_STARTED |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // value would be. | 62 // value would be. |
| 63 static const unsigned int kTargetLatencyMicroseconds = 10000; | 63 static const unsigned int kTargetLatencyMicroseconds = 10000; |
| 64 | 64 |
| 65 // Minimal amount of time to sleep. If any future event is expected to | 65 // Minimal amount of time to sleep. If any future event is expected to |
| 66 // execute within this timeframe, treat it as if it should execute immediately. | 66 // execute within this timeframe, treat it as if it should execute immediately. |
| 67 // | 67 // |
| 68 // TODO(ajwong): Determine if there is a sensible minimum sleep resolution and | 68 // TODO(ajwong): Determine if there is a sensible minimum sleep resolution and |
| 69 // adjust accordingly. | 69 // adjust accordingly. |
| 70 static const int64 kMinSleepMilliseconds = 10L; | 70 static const int64 kMinSleepMilliseconds = 10L; |
| 71 | 71 |
| 72 const char* AlsaPCMOutputStream::kDefaultDevice = "plug:default"; | 72 const char* AlsaPCMOutputStream::kDefaultDevice = "default"; |
| 73 | 73 |
| 74 AlsaPCMOutputStream::AlsaPCMOutputStream(const std::string& device_name, | 74 AlsaPCMOutputStream::AlsaPCMOutputStream(const std::string& device_name, |
| 75 int min_buffer_ms, | 75 int min_buffer_ms, |
| 76 AudioManager::Format format, | 76 AudioManager::Format format, |
| 77 int channels, | 77 int channels, |
| 78 int sample_rate, | 78 int sample_rate, |
| 79 char bits_per_sample) | 79 char bits_per_sample) |
| 80 : state_(STATE_CREATED), | 80 : state_(STATE_CREATED), |
| 81 device_name_(device_name), | 81 device_name_(device_name), |
| 82 playback_handle_(NULL), | 82 playback_handle_(NULL), |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 NOTIMPLEMENTED(); | 512 NOTIMPLEMENTED(); |
| 513 } | 513 } |
| 514 | 514 |
| 515 void AlsaPCMOutputStream::GetVolume(double* left_level, double* right_level) { | 515 void AlsaPCMOutputStream::GetVolume(double* left_level, double* right_level) { |
| 516 NOTIMPLEMENTED(); | 516 NOTIMPLEMENTED(); |
| 517 } | 517 } |
| 518 | 518 |
| 519 size_t AlsaPCMOutputStream::GetNumBuffers() { | 519 size_t AlsaPCMOutputStream::GetNumBuffers() { |
| 520 return 0; | 520 return 0; |
| 521 } | 521 } |
| OLD | NEW |