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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Updates based on reviewer comments. 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) 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 size_t& nonSilentFramesToProcess) { 52 size_t& nonSilentFramesToProcess) {
53 DCHECK(outputBus); 53 DCHECK(outputBus);
54 if (!outputBus) 54 if (!outputBus)
55 return; 55 return;
56 56
57 DCHECK_EQ(quantumFrameSize, 57 DCHECK_EQ(quantumFrameSize,
58 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); 58 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames));
59 if (quantumFrameSize != AudioUtilities::kRenderQuantumFrames) 59 if (quantumFrameSize != AudioUtilities::kRenderQuantumFrames)
60 return; 60 return;
61 61
62 double sampleRate = this->sampleRate(); 62 double sampleRate = context()->sampleRate();
63 63
64 // quantumStartFrame : Start frame of the current time quantum. 64 // quantumStartFrame : Start frame of the current time quantum.
65 // quantumEndFrame : End frame of the current time quantum. 65 // quantumEndFrame : End frame of the current time quantum.
66 // startFrame : Start frame for this source. 66 // startFrame : Start frame for this source.
67 // endFrame : End frame for this source. 67 // endFrame : End frame for this source.
68 size_t quantumStartFrame = context()->currentSampleFrame(); 68 size_t quantumStartFrame = context()->currentSampleFrame();
69 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize; 69 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize;
70 size_t startFrame = 70 size_t startFrame =
71 AudioUtilities::timeToSampleFrame(m_startTime, sampleRate); 71 AudioUtilities::timeToSampleFrame(m_startTime, sampleRate);
72 size_t endFrame = 72 size_t endFrame =
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // playback state if the context is closed. 274 // playback state if the context is closed.
275 if (context()->isContextClosed()) 275 if (context()->isContextClosed())
276 return false; 276 return false;
277 277
278 // If a node is scheduled or playing, do not collect the node prematurely 278 // If a node is scheduled or playing, do not collect the node prematurely
279 // even its reference is out of scope. Then fire onended event if assigned. 279 // even its reference is out of scope. Then fire onended event if assigned.
280 return audioScheduledSourceHandler().isPlayingOrScheduled(); 280 return audioScheduledSourceHandler().isPlayingOrScheduled();
281 } 281 }
282 282
283 } // namespace blink 283 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698