Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Add baseLatency and fix use of hardwareSampleRate. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 25 matching lines...) Expand all
36 #include "platform/audio/HRTFDatabaseLoader.h" 36 #include "platform/audio/HRTFDatabaseLoader.h"
37 #include "public/platform/Platform.h" 37 #include "public/platform/Platform.h"
38 #include "wtf/PtrUtil.h" 38 #include "wtf/PtrUtil.h"
39 #include <algorithm> 39 #include <algorithm>
40 40
41 namespace blink { 41 namespace blink {
42 42
43 OfflineAudioDestinationHandler::OfflineAudioDestinationHandler( 43 OfflineAudioDestinationHandler::OfflineAudioDestinationHandler(
44 AudioNode& node, 44 AudioNode& node,
45 AudioBuffer* renderTarget) 45 AudioBuffer* renderTarget)
46 : AudioDestinationHandler(node, renderTarget->sampleRate()), 46 : AudioDestinationHandler(node),
47 m_renderTarget(renderTarget), 47 m_renderTarget(renderTarget),
48 m_renderThread(wrapUnique( 48 m_renderThread(wrapUnique(
49 Platform::current()->createThread("offline audio renderer"))), 49 Platform::current()->createThread("offline audio renderer"))),
50 m_framesProcessed(0), 50 m_framesProcessed(0),
51 m_framesToProcess(0), 51 m_framesToProcess(0),
52 m_isRenderingStarted(false), 52 m_isRenderingStarted(false),
53 m_shouldSuspend(false) { 53 m_shouldSuspend(false) {
54 m_renderBus = AudioBus::create(renderTarget->numberOfChannels(), 54 m_renderBus = AudioBus::create(renderTarget->numberOfChannels(),
55 AudioUtilities::kRenderQuantumFrames); 55 AudioUtilities::kRenderQuantumFrames);
56 m_framesToProcess = m_renderTarget->length(); 56 m_framesToProcess = m_renderTarget->length();
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); 330 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget));
331 } 331 }
332 332
333 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create( 333 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(
334 BaseAudioContext* context, 334 BaseAudioContext* context,
335 AudioBuffer* renderTarget) { 335 AudioBuffer* renderTarget) {
336 return new OfflineAudioDestinationNode(*context, renderTarget); 336 return new OfflineAudioDestinationNode(*context, renderTarget);
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698