OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 unsigned long maxChannelCount() const; | 52 unsigned long maxChannelCount() const; |
53 | 53 |
54 private: | 54 private: |
55 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels); | 55 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels); |
56 // As an audio source, we will never propagate silence. | 56 // As an audio source, we will never propagate silence. |
57 bool propagatesSilence() const override { return false; } | 57 bool propagatesSilence() const override { return false; } |
58 | 58 |
59 // This Persistent doesn't make a reference cycle. | 59 // This Persistent doesn't make a reference cycle. |
60 Persistent<MediaStream> m_stream; | 60 Persistent<MediaStream> m_stream; |
61 Persistent<MediaStreamSource> m_source; | 61 // Accessed by main thread and during audio thread processing. |
| 62 // |
| 63 // TODO: try to avoid such access during audio thread processing. |
| 64 CrossThreadPersistent<MediaStreamSource> m_source; |
62 | 65 |
63 // This synchronizes dynamic changes to the channel count with | 66 // This synchronizes dynamic changes to the channel count with |
64 // process() to manage the mix bus. | 67 // process() to manage the mix bus. |
65 mutable Mutex m_processLock; | 68 mutable Mutex m_processLock; |
66 | 69 |
67 // This internal mix bus is for up/down mixing the input to the actual | 70 // This internal mix bus is for up/down mixing the input to the actual |
68 // number of channels in the destination. | 71 // number of channels in the destination. |
69 RefPtr<AudioBus> m_mixBus; | 72 RefPtr<AudioBus> m_mixBus; |
70 }; | 73 }; |
71 | 74 |
(...skipping 10 matching lines...) Expand all Loading... |
82 | 85 |
83 MediaStream* stream() const; | 86 MediaStream* stream() const; |
84 | 87 |
85 private: | 88 private: |
86 MediaStreamAudioDestinationNode(BaseAudioContext&, size_t numberOfChannels); | 89 MediaStreamAudioDestinationNode(BaseAudioContext&, size_t numberOfChannels); |
87 }; | 90 }; |
88 | 91 |
89 } // namespace blink | 92 } // namespace blink |
90 | 93 |
91 #endif // MediaStreamAudioDestinationNode_h | 94 #endif // MediaStreamAudioDestinationNode_h |
OLD | NEW |