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

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

Issue 2799993002: Setting convolver buffer needs to update number of output channels (Closed)
Patch Set: Address review comments Created 3 years, 8 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) 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 bool normalize() const { return m_normalize; } 58 bool normalize() const { return m_normalize; }
59 void setNormalize(bool normalize) { m_normalize = normalize; } 59 void setNormalize(bool normalize) { m_normalize = normalize; }
60 void setChannelCount(unsigned long, ExceptionState&) final; 60 void setChannelCount(unsigned long, ExceptionState&) final;
61 void setChannelCountMode(const String&, ExceptionState&) final; 61 void setChannelCountMode(const String&, ExceptionState&) final;
62 62
63 private: 63 private:
64 ConvolverHandler(AudioNode&, float sampleRate); 64 ConvolverHandler(AudioNode&, float sampleRate);
65 double tailTime() const override; 65 double tailTime() const override;
66 double latencyTime() const override; 66 double latencyTime() const override;
67 67
68 // Determine how many output channels to use from the number of
69 // input channels and the number of channels in the impulse response
70 // buffer.
71 unsigned computeNumberOfOutputChannels(unsigned inputChannels,
72 unsigned responseChannels) const;
73
68 std::unique_ptr<Reverb> m_reverb; 74 std::unique_ptr<Reverb> m_reverb;
69 // This Persistent doesn't make a reference cycle including the owner 75 // This Persistent doesn't make a reference cycle including the owner
70 // ConvolverNode. 76 // ConvolverNode.
71 // It is cross-thread, as it will be accessed by the audio and main threads. 77 // It is cross-thread, as it will be accessed by the audio and main threads.
72 CrossThreadPersistent<AudioBuffer> m_buffer; 78 CrossThreadPersistent<AudioBuffer> m_buffer;
73 79
74 // This synchronizes dynamic changes to the convolution impulse response with 80 // This synchronizes dynamic changes to the convolution impulse response with
75 // process(). 81 // process().
76 mutable Mutex m_processLock; 82 mutable Mutex m_processLock;
77 83
(...skipping 20 matching lines...) Expand all
98 private: 104 private:
99 ConvolverNode(BaseAudioContext&); 105 ConvolverNode(BaseAudioContext&);
100 ConvolverHandler& convolverHandler() const; 106 ConvolverHandler& convolverHandler() const;
101 107
102 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); 108 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime);
103 }; 109 };
104 110
105 } // namespace blink 111 } // namespace blink
106 112
107 #endif // ConvolverNode_h 113 #endif // ConvolverNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698