| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 size_t numberOfFrames, | 85 size_t numberOfFrames, |
| 86 double delay, | 86 double delay, |
| 87 double delayTimestamp, | 87 double delayTimestamp, |
| 88 size_t priorFramesSkipped) override; | 88 size_t priorFramesSkipped) override; |
| 89 | 89 |
| 90 // AudioSourceProvider | 90 // AudioSourceProvider |
| 91 void provideInput(AudioBus*, size_t framesToProcess) override; | 91 void provideInput(AudioBus*, size_t framesToProcess) override; |
| 92 | 92 |
| 93 static float hardwareSampleRate(); | 93 static float hardwareSampleRate(); |
| 94 | 94 |
| 95 size_t callbackBufferSize() const { return m_callbackBufferSize; } |
| 96 |
| 95 // maxChannelCount() returns the total number of output channels of the audio | 97 // maxChannelCount() returns the total number of output channels of the audio |
| 96 // hardware. A value of 0 indicates that the number of channels cannot be | 98 // hardware. A value of 0 indicates that the number of channels cannot be |
| 97 // configured and that only stereo (2-channel) destinations can be created. | 99 // configured and that only stereo (2-channel) destinations can be created. |
| 98 // The numberOfOutputChannels parameter of AudioDestination::create() is | 100 // The numberOfOutputChannels parameter of AudioDestination::create() is |
| 99 // allowed to be a value: 1 <= numberOfOutputChannels <= maxChannelCount(), | 101 // allowed to be a value: 1 <= numberOfOutputChannels <= maxChannelCount(), |
| 100 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2. | 102 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2. |
| 101 static unsigned long maxChannelCount(); | 103 static unsigned long maxChannelCount(); |
| 102 | 104 |
| 103 private: | 105 private: |
| 104 AudioIOCallback& m_callback; | 106 AudioIOCallback& m_callback; |
| 105 unsigned m_numberOfOutputChannels; | 107 unsigned m_numberOfOutputChannels; |
| 106 RefPtr<AudioBus> m_inputBus; | 108 RefPtr<AudioBus> m_inputBus; |
| 107 RefPtr<AudioBus> m_renderBus; | 109 RefPtr<AudioBus> m_renderBus; |
| 108 float m_sampleRate; | 110 float m_sampleRate; |
| 109 bool m_isPlaying; | 111 bool m_isPlaying; |
| 110 std::unique_ptr<WebAudioDevice> m_audioDevice; | 112 std::unique_ptr<WebAudioDevice> m_audioDevice; |
| 111 size_t m_callbackBufferSize; | 113 size_t m_callbackBufferSize; |
| 112 | 114 |
| 113 std::unique_ptr<AudioFIFO> m_inputFifo; | 115 std::unique_ptr<AudioFIFO> m_inputFifo; |
| 114 std::unique_ptr<AudioPullFIFO> m_fifo; | 116 std::unique_ptr<AudioPullFIFO> m_fifo; |
| 115 | 117 |
| 116 size_t m_framesElapsed; | 118 size_t m_framesElapsed; |
| 117 AudioIOPosition m_outputPosition; | 119 AudioIOPosition m_outputPosition; |
| 118 base::TimeTicks m_outputPositionReceivedTimestamp; | 120 base::TimeTicks m_outputPositionReceivedTimestamp; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace blink | 123 } // namespace blink |
| 122 | 124 |
| 123 #endif // AudioDestination_h | 125 #endif // AudioDestination_h |
| OLD | NEW |