Chromium Code Reviews| 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 virtual void trace(Visitor*) override; | 99 virtual void trace(Visitor*) override; |
| 100 | 100 |
| 101 bool isInitialized() const { return m_isInitialized; } | 101 bool isInitialized() const { return m_isInitialized; } |
| 102 bool isOfflineContext() { return m_isOfflineContext; } | 102 bool isOfflineContext() { return m_isOfflineContext; } |
| 103 | 103 |
| 104 // Document notification | 104 // Document notification |
| 105 virtual void stop() override final; | 105 virtual void stop() override final; |
| 106 virtual bool hasPendingActivity() const override; | 106 virtual bool hasPendingActivity() const override; |
| 107 | 107 |
| 108 AudioDestinationNode* destination() { return m_destinationNode.get(); } | 108 AudioDestinationNode* destination() { return m_destinationNode.get(); } |
| 109 // currentSampleFrame() returns the current sample frame. It should only be called from the | |
| 110 // audio thread. | |
| 109 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF rame(); } | 111 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF rame(); } |
| 112 // sampleFrame() is like currentSampleFrame() but must be called from the ma in thread to get the | |
| 113 // sample frame. It might be slightly behind curentSampleFrame() due to lock ing. | |
| 114 size_t sampleFrame() const; | |
|
hongchan
2014/12/03 18:50:47
Just a thought - can't this be shadowCurrentSample
Raymond Toy
2014/12/03 19:04:44
I'm terrible at names. m_shadowCurrentSampleFrame
hongchan
2014/12/03 19:13:29
I agree that it is too much.
How about using the
Raymond Toy
2014/12/03 19:34:21
Sounds good.
| |
| 110 double currentTime() const { return m_destinationNode->currentTime(); } | 115 double currentTime() const { return m_destinationNode->currentTime(); } |
| 111 float sampleRate() const { return m_destinationNode->sampleRate(); } | 116 float sampleRate() const { return m_destinationNode->sampleRate(); } |
| 112 String state() const; | 117 String state() const; |
| 113 | 118 |
| 114 AudioBuffer* createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState&); | 119 AudioBuffer* createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState&); |
| 115 | 120 |
| 116 // Asynchronous audio file data decoding. | 121 // Asynchronous audio file data decoding. |
| 117 void decodeAudioData(DOMArrayBuffer*, AudioBufferCallback*, AudioBufferCallb ack*, ExceptionState&); | 122 void decodeAudioData(DOMArrayBuffer*, AudioBufferCallback*, AudioBufferCallb ack*, ExceptionState&); |
| 118 | 123 |
| 119 AudioListener* listener() { return m_listener.get(); } | 124 AudioListener* listener() { return m_listener.get(); } |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 AudioContextState m_contextState; | 394 AudioContextState m_contextState; |
| 390 void setContextState(AudioContextState); | 395 void setContextState(AudioContextState); |
| 391 | 396 |
| 392 AsyncAudioDecoder m_audioDecoder; | 397 AsyncAudioDecoder m_audioDecoder; |
| 393 | 398 |
| 394 // Collection of nodes where the channel count mode has changed. We want the channel count mode | 399 // Collection of nodes where the channel count mode has changed. We want the channel count mode |
| 395 // to change in the pre- or post-rendering phase so as not to disturb the ru nning audio thread. | 400 // to change in the pre- or post-rendering phase so as not to disturb the ru nning audio thread. |
| 396 GC_PLUGIN_IGNORE("http://crbug.com/404527") | 401 GC_PLUGIN_IGNORE("http://crbug.com/404527") |
| 397 HashSet<AudioNode*> m_deferredCountModeChange; | 402 HashSet<AudioNode*> m_deferredCountModeChange; |
| 398 | 403 |
| 404 // Follows the destinations currentSampleFrame, but might be slightly behind due to locking. | |
| 405 size_t m_shadowCurrentSampleFrame; | |
| 406 | |
| 399 // This is considering 32 is large enough for multiple channels audio. | 407 // This is considering 32 is large enough for multiple channels audio. |
| 400 // It is somewhat arbitrary and could be increased if necessary. | 408 // It is somewhat arbitrary and could be increased if necessary. |
| 401 enum { MaxNumberOfChannels = 32 }; | 409 enum { MaxNumberOfChannels = 32 }; |
| 402 }; | 410 }; |
| 403 | 411 |
| 404 } // namespace blink | 412 } // namespace blink |
| 405 | 413 |
| 406 #endif // AudioContext_h | 414 #endif // AudioContext_h |
| OLD | NEW |