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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // Need to check if the context actually alive. Otherwise the subsequent | 246 // Need to check if the context actually alive. Otherwise the subsequent |
247 // steps will fail. If the context is not alive somehow, return immediately | 247 // steps will fail. If the context is not alive somehow, return immediately |
248 // and do nothing. | 248 // and do nothing. |
249 // | 249 // |
250 // TODO(hongchan): because the context can go away while rendering, so this | 250 // TODO(hongchan): because the context can go away while rendering, so this |
251 // check cannot guarantee the safe execution of the following steps. | 251 // check cannot guarantee the safe execution of the following steps. |
252 ASSERT(context()); | 252 ASSERT(context()); |
253 if (!context()) | 253 if (!context()) |
254 return false; | 254 return false; |
255 | 255 |
256 context()->deferredTaskHandler().setAudioThread(currentThread()); | 256 context()->deferredTaskHandler().setAudioThreadToCurrentThread(); |
257 | 257 |
258 // If the destination node is not initialized, pass the silence to the final | 258 // If the destination node is not initialized, pass the silence to the final |
259 // audio destination (one step before the FIFO). This check is for the case | 259 // audio destination (one step before the FIFO). This check is for the case |
260 // where the destination is in the middle of tearing down process. | 260 // where the destination is in the middle of tearing down process. |
261 if (!isInitialized()) { | 261 if (!isInitialized()) { |
262 destinationBus->zero(); | 262 destinationBus->zero(); |
263 return false; | 263 return false; |
264 } | 264 } |
265 | 265 |
266 // Take care pre-render tasks at the beginning of each render quantum. Then | 266 // Take care pre-render tasks at the beginning of each render quantum. Then |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 { | 311 { |
312 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 312 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
313 } | 313 } |
314 | 314 |
315 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) | 315 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) |
316 { | 316 { |
317 return new OfflineAudioDestinationNode(*context, renderTarget); | 317 return new OfflineAudioDestinationNode(*context, renderTarget); |
318 } | 318 } |
319 | 319 |
320 } // namespace blink | 320 } // namespace blink |
OLD | NEW |