OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI nputChannels, channelCount(), hardwareSampleRate); | 87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI nputChannels, channelCount(), hardwareSampleRate); |
88 } | 88 } |
89 | 89 |
90 void DefaultAudioDestinationNode::startRendering() | 90 void DefaultAudioDestinationNode::startRendering() |
91 { | 91 { |
92 ASSERT(isInitialized()); | 92 ASSERT(isInitialized()); |
93 if (isInitialized()) | 93 if (isInitialized()) |
94 m_destination->start(); | 94 m_destination->start(); |
95 } | 95 } |
96 | 96 |
97 void DefaultAudioDestinationNode::stop() | |
98 { | |
99 ASSERT(isInitialized()); | |
100 if (isInitialized()) | |
101 m_destination->stop(); | |
102 } | |
haraken
2014/10/15 15:36:26
Can we add an ASSERT to verify that start() and st
Raymond Toy
2014/10/15 19:50:50
Added a check that destination is playing when cal
| |
103 | |
97 unsigned long DefaultAudioDestinationNode::maxChannelCount() const | 104 unsigned long DefaultAudioDestinationNode::maxChannelCount() const |
98 { | 105 { |
99 return AudioDestination::maxChannelCount(); | 106 return AudioDestination::maxChannelCount(); |
100 } | 107 } |
101 | 108 |
102 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionState& exceptionState) | 109 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionState& exceptionState) |
103 { | 110 { |
104 // The channelCount for the input to this node controls the actual number of channels we | 111 // The channelCount for the input to this node controls the actual number of channels we |
105 // send to the audio hardware. It can only be set depending on the maximum n umber of | 112 // send to the audio hardware. It can only be set depending on the maximum n umber of |
106 // channels supported by the hardware. | 113 // channels supported by the hardware. |
(...skipping 14 matching lines...) Expand all Loading... | |
121 // Re-create destination. | 128 // Re-create destination. |
122 m_destination->stop(); | 129 m_destination->stop(); |
123 createDestination(); | 130 createDestination(); |
124 m_destination->start(); | 131 m_destination->start(); |
125 } | 132 } |
126 } | 133 } |
127 | 134 |
128 } // namespace blink | 135 } // namespace blink |
129 | 136 |
130 #endif // ENABLE(WEB_AUDIO) | 137 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |