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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Fixes to WebAudioDeviceImpl unit test. Created 3 years, 10 months 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) 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 double& startFrameOffset) { 54 double& startFrameOffset) {
55 DCHECK(outputBus); 55 DCHECK(outputBus);
56 if (!outputBus) 56 if (!outputBus)
57 return; 57 return;
58 58
59 DCHECK_EQ(quantumFrameSize, 59 DCHECK_EQ(quantumFrameSize,
60 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); 60 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames));
61 if (quantumFrameSize != AudioUtilities::kRenderQuantumFrames) 61 if (quantumFrameSize != AudioUtilities::kRenderQuantumFrames)
62 return; 62 return;
63 63
64 double sampleRate = this->sampleRate(); 64 double sampleRate = context()->sampleRate();
65 65
66 // quantumStartFrame : Start frame of the current time quantum. 66 // quantumStartFrame : Start frame of the current time quantum.
67 // quantumEndFrame : End frame of the current time quantum. 67 // quantumEndFrame : End frame of the current time quantum.
68 // startFrame : Start frame for this source. 68 // startFrame : Start frame for this source.
69 // endFrame : End frame for this source. 69 // endFrame : End frame for this source.
70 size_t quantumStartFrame = context()->currentSampleFrame(); 70 size_t quantumStartFrame = context()->currentSampleFrame();
71 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize; 71 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize;
72 size_t startFrame = 72 size_t startFrame =
73 AudioUtilities::timeToSampleFrame(m_startTime, sampleRate); 73 AudioUtilities::timeToSampleFrame(m_startTime, sampleRate);
74 size_t endFrame = 74 size_t endFrame =
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // playback state if the context is closed. 280 // playback state if the context is closed.
281 if (context()->isContextClosed()) 281 if (context()->isContextClosed())
282 return false; 282 return false;
283 283
284 // If a node is scheduled or playing, do not collect the node prematurely 284 // If a node is scheduled or playing, do not collect the node prematurely
285 // even its reference is out of scope. Then fire onended event if assigned. 285 // even its reference is out of scope. Then fire onended event if assigned.
286 return audioScheduledSourceHandler().isPlayingOrScheduled(); 286 return audioScheduledSourceHandler().isPlayingOrScheduled();
287 } 287 }
288 288
289 } // namespace blink 289 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698