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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h

Issue 2582443004: ScriptProcessor buffer size should be consistent with callback size (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 double currentTime() const { 59 double currentTime() const {
60 return currentSampleFrame() / static_cast<double>(sampleRate()); 60 return currentSampleFrame() / static_cast<double>(sampleRate());
61 } 61 }
62 62
63 virtual unsigned long maxChannelCount() const { return 0; } 63 virtual unsigned long maxChannelCount() const { return 0; }
64 64
65 virtual void startRendering() = 0; 65 virtual void startRendering() = 0;
66 virtual void stopRendering() = 0; 66 virtual void stopRendering() = 0;
67 67
68 virtual size_t callbackBufferSize() const { return 0; }
hongchan 2016/12/20 20:35:13 The comment is needed here. We have many 'callback
Raymond Toy 2016/12/20 21:55:31 Done. And also made it pure virtual as we discuss
69
68 protected: 70 protected:
69 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for 71 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for
70 // local/live audio input. If there is local/live audio input, we call set() 72 // local/live audio input. If there is local/live audio input, we call set()
71 // with the audio input data every render quantum. 73 // with the audio input data every render quantum.
72 class LocalAudioInputProvider final : public AudioSourceProvider { 74 class LocalAudioInputProvider final : public AudioSourceProvider {
73 public: 75 public:
74 LocalAudioInputProvider() 76 LocalAudioInputProvider()
75 : m_sourceBus(AudioBus::create( 77 : m_sourceBus(AudioBus::create(
76 2, 78 2,
77 AudioUtilities::kRenderQuantumFrames)) // FIXME: handle 79 AudioUtilities::kRenderQuantumFrames)) // FIXME: handle
(...skipping 26 matching lines...) Expand all
104 LocalAudioInputProvider m_localAudioInputProvider; 106 LocalAudioInputProvider m_localAudioInputProvider;
105 }; 107 };
106 108
107 class AudioDestinationNode : public AudioNode { 109 class AudioDestinationNode : public AudioNode {
108 DEFINE_WRAPPERTYPEINFO(); 110 DEFINE_WRAPPERTYPEINFO();
109 111
110 public: 112 public:
111 AudioDestinationHandler& audioDestinationHandler() const; 113 AudioDestinationHandler& audioDestinationHandler() const;
112 114
113 unsigned long maxChannelCount() const; 115 unsigned long maxChannelCount() const;
116 size_t callbackBufferSize() const { return handler().callbackBufferSize(); }
hongchan 2016/12/20 20:35:12 Just curious: does this change dynamically? if not
Raymond Toy 2016/12/20 21:55:31 Don't think this can change dynamically. Might be
114 117
115 protected: 118 protected:
116 AudioDestinationNode(BaseAudioContext&); 119 AudioDestinationNode(BaseAudioContext&);
117 }; 120 };
118 121
119 } // namespace blink 122 } // namespace blink
120 123
121 #endif // AudioDestinationNode_h 124 #endif // AudioDestinationNode_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698