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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Port-specific device identification information for live/local input stre
ams can be passed in the inputDeviceId. | 58 // Port-specific device identification information for live/local input stre
ams can be passed in the inputDeviceId. |
59 static std::unique_ptr<AudioDestination> create(AudioIOCallback&, const Stri
ng& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChanne
ls, float sampleRate, const PassRefPtr<SecurityOrigin>&); | 59 static std::unique_ptr<AudioDestination> create(AudioIOCallback&, const Stri
ng& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChanne
ls, float sampleRate, const PassRefPtr<SecurityOrigin>&); |
60 | 60 |
61 virtual void start(); | 61 virtual void start(); |
62 virtual void stop(); | 62 virtual void stop(); |
63 bool isPlaying() { return m_isPlaying; } | 63 bool isPlaying() { return m_isPlaying; } |
64 | 64 |
65 float sampleRate() const { return m_sampleRate; } | 65 float sampleRate() const { return m_sampleRate; } |
66 | 66 |
67 // WebAudioDevice::RenderCallback | 67 // WebAudioDevice::RenderCallback |
68 void render(const WebVector<float*>& sourceData, const WebVector<float*>& au
dioData, size_t numberOfFrames) override; | 68 void render(const WebVector<float*>& sourceData, const WebVector<float*>& au
dioData, size_t numberOfFrames, const WebAudioTimestamp&) override; |
69 | 69 |
70 // AudioSourceProvider | 70 // AudioSourceProvider |
71 void provideInput(AudioBus*, size_t framesToProcess) override; | 71 void provideInput(AudioBus*, size_t framesToProcess) override; |
72 | 72 |
73 static float hardwareSampleRate(); | 73 static float hardwareSampleRate(); |
74 | 74 |
75 // maxChannelCount() returns the total number of output channels of the audi
o hardware. | 75 // maxChannelCount() returns the total number of output channels of the audi
o hardware. |
76 // A value of 0 indicates that the number of channels cannot be configured a
nd | 76 // A value of 0 indicates that the number of channels cannot be configured a
nd |
77 // that only stereo (2-channel) destinations can be created. | 77 // that only stereo (2-channel) destinations can be created. |
78 // The numberOfOutputChannels parameter of AudioDestination::create() is all
owed to | 78 // The numberOfOutputChannels parameter of AudioDestination::create() is all
owed to |
79 // be a value: 1 <= numberOfOutputChannels <= maxChannelCount(), | 79 // be a value: 1 <= numberOfOutputChannels <= maxChannelCount(), |
80 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2. | 80 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2. |
81 static unsigned long maxChannelCount(); | 81 static unsigned long maxChannelCount(); |
82 | 82 |
83 private: | 83 private: |
84 AudioIOCallback& m_callback; | 84 AudioIOCallback& m_callback; |
85 unsigned m_numberOfOutputChannels; | 85 unsigned m_numberOfOutputChannels; |
86 RefPtr<AudioBus> m_inputBus; | 86 RefPtr<AudioBus> m_inputBus; |
87 RefPtr<AudioBus> m_renderBus; | 87 RefPtr<AudioBus> m_renderBus; |
88 float m_sampleRate; | 88 float m_sampleRate; |
89 bool m_isPlaying; | 89 bool m_isPlaying; |
90 std::unique_ptr<WebAudioDevice> m_audioDevice; | 90 std::unique_ptr<WebAudioDevice> m_audioDevice; |
91 size_t m_callbackBufferSize; | 91 size_t m_callbackBufferSize; |
92 | 92 |
93 std::unique_ptr<AudioFIFO> m_inputFifo; | 93 std::unique_ptr<AudioFIFO> m_inputFifo; |
94 std::unique_ptr<AudioPullFIFO> m_fifo; | 94 std::unique_ptr<AudioPullFIFO> m_fifo; |
| 95 WebAudioTimestamp m_outputTimestamp; |
95 }; | 96 }; |
96 | 97 |
97 } // namespace blink | 98 } // namespace blink |
98 | 99 |
99 #endif // AudioDestination_h | 100 #endif // AudioDestination_h |
OLD | NEW |