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 26 matching lines...) Expand all Loading... |
37 #include "platform/audio/HRTFDatabaseLoader.h" | 37 #include "platform/audio/HRTFDatabaseLoader.h" |
38 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
39 #include "wtf/PtrUtil.h" | 39 #include "wtf/PtrUtil.h" |
40 #include <algorithm> | 40 #include <algorithm> |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 OfflineAudioDestinationHandler::OfflineAudioDestinationHandler( | 44 OfflineAudioDestinationHandler::OfflineAudioDestinationHandler( |
45 AudioNode& node, | 45 AudioNode& node, |
46 AudioBuffer* renderTarget) | 46 AudioBuffer* renderTarget) |
47 : AudioDestinationHandler(node, renderTarget->sampleRate()), | 47 : AudioDestinationHandler(node), |
48 m_renderTarget(renderTarget), | 48 m_renderTarget(renderTarget), |
49 m_renderThread(WTF::wrapUnique( | 49 m_renderThread(WTF::wrapUnique( |
50 Platform::current()->createThread("offline audio renderer"))), | 50 Platform::current()->createThread("offline audio renderer"))), |
51 m_framesProcessed(0), | 51 m_framesProcessed(0), |
52 m_framesToProcess(0), | 52 m_framesToProcess(0), |
53 m_isRenderingStarted(false), | 53 m_isRenderingStarted(false), |
54 m_shouldSuspend(false) { | 54 m_shouldSuspend(false) { |
55 m_renderBus = AudioBus::create(renderTarget->numberOfChannels(), | 55 m_renderBus = AudioBus::create(renderTarget->numberOfChannels(), |
56 AudioUtilities::kRenderQuantumFrames); | 56 AudioUtilities::kRenderQuantumFrames); |
57 m_framesToProcess = m_renderTarget->length(); | 57 m_framesToProcess = m_renderTarget->length(); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 336 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
337 } | 337 } |
338 | 338 |
339 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create( | 339 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create( |
340 BaseAudioContext* context, | 340 BaseAudioContext* context, |
341 AudioBuffer* renderTarget) { | 341 AudioBuffer* renderTarget) { |
342 return new OfflineAudioDestinationNode(*context, renderTarget); | 342 return new OfflineAudioDestinationNode(*context, renderTarget); |
343 } | 343 } |
344 | 344 |
345 } // namespace blink | 345 } // namespace blink |
OLD | NEW |