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

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

Issue 2389253002: reflow comments in modules/{webaudio,vr} (Closed)
Patch Set: . Created 4 years, 2 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, Intel Corporation. All rights reserved. 2 * Copyright (C) 2012, Intel Corporation. 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 22 matching lines...) Expand all
33 AudioBasicInspectorHandler::AudioBasicInspectorHandler( 33 AudioBasicInspectorHandler::AudioBasicInspectorHandler(
34 NodeType nodeType, 34 NodeType nodeType,
35 AudioNode& node, 35 AudioNode& node,
36 float sampleRate, 36 float sampleRate,
37 unsigned outputChannelCount) 37 unsigned outputChannelCount)
38 : AudioHandler(nodeType, node, sampleRate), m_needAutomaticPull(false) { 38 : AudioHandler(nodeType, node, sampleRate), m_needAutomaticPull(false) {
39 addInput(); 39 addInput();
40 addOutput(outputChannelCount); 40 addOutput(outputChannelCount);
41 } 41 }
42 42
43 // We override pullInputs() as an optimization allowing this node to take advant age of in-place processing, 43 // We override pullInputs() as an optimization allowing this node to take
44 // where the input is simply passed through unprocessed to the output. 44 // advantage of in-place processing, where the input is simply passed through
45 // unprocessed to the output.
45 // Note: this only applies if the input and output channel counts match. 46 // Note: this only applies if the input and output channel counts match.
46 void AudioBasicInspectorHandler::pullInputs(size_t framesToProcess) { 47 void AudioBasicInspectorHandler::pullInputs(size_t framesToProcess) {
47 // Render input stream - try to render directly into output bus for pass-throu gh processing where process() doesn't need to do anything... 48 // Render input stream - try to render directly into output bus for
49 // pass-through processing where process() doesn't need to do anything...
48 input(0).pull(output(0).bus(), framesToProcess); 50 input(0).pull(output(0).bus(), framesToProcess);
49 } 51 }
50 52
51 AudioNode* AudioBasicInspectorNode::connect(AudioNode* destination, 53 AudioNode* AudioBasicInspectorNode::connect(AudioNode* destination,
52 unsigned outputIndex, 54 unsigned outputIndex,
53 unsigned inputIndex, 55 unsigned inputIndex,
54 ExceptionState& exceptionState) { 56 ExceptionState& exceptionState) {
55 DCHECK(isMainThread()); 57 DCHECK(isMainThread());
56 58
57 BaseAudioContext::AutoLocker locker(context()); 59 BaseAudioContext::AutoLocker locker(context());
(...skipping 19 matching lines...) Expand all
77 DCHECK(context()->isAudioThread()); 79 DCHECK(context()->isAudioThread());
78 ASSERT(context()->isGraphOwner()); 80 ASSERT(context()->isGraphOwner());
79 81
80 DCHECK_EQ(input, &this->input(0)); 82 DCHECK_EQ(input, &this->input(0));
81 if (input != &this->input(0)) 83 if (input != &this->input(0))
82 return; 84 return;
83 85
84 unsigned numberOfChannels = input->numberOfChannels(); 86 unsigned numberOfChannels = input->numberOfChannels();
85 87
86 if (numberOfChannels != output(0).numberOfChannels()) { 88 if (numberOfChannels != output(0).numberOfChannels()) {
87 // This will propagate the channel count to any nodes connected further down stream in the graph. 89 // This will propagate the channel count to any nodes connected further
90 // downstream in the graph.
88 output(0).setNumberOfChannels(numberOfChannels); 91 output(0).setNumberOfChannels(numberOfChannels);
89 } 92 }
90 93
91 AudioHandler::checkNumberOfChannelsForInput(input); 94 AudioHandler::checkNumberOfChannelsForInput(input);
92 95
93 updatePullStatus(); 96 updatePullStatus();
94 } 97 }
95 98
96 void AudioBasicInspectorHandler::updatePullStatus() { 99 void AudioBasicInspectorHandler::updatePullStatus() {
97 ASSERT(context()->isGraphOwner()); 100 ASSERT(context()->isGraphOwner());
98 101
99 if (output(0).isConnected()) { 102 if (output(0).isConnected()) {
100 // When an AudioBasicInspectorNode is connected to a downstream node, it wil l get pulled by the 103 // When an AudioBasicInspectorNode is connected to a downstream node, it
101 // downstream node, thus remove it from the context's automatic pull list. 104 // will get pulled by the downstream node, thus remove it from the context's
105 // automatic pull list.
102 if (m_needAutomaticPull) { 106 if (m_needAutomaticPull) {
103 context()->deferredTaskHandler().removeAutomaticPullNode(this); 107 context()->deferredTaskHandler().removeAutomaticPullNode(this);
104 m_needAutomaticPull = false; 108 m_needAutomaticPull = false;
105 } 109 }
106 } else { 110 } else {
107 unsigned numberOfInputConnections = input(0).numberOfRenderingConnections(); 111 unsigned numberOfInputConnections = input(0).numberOfRenderingConnections();
108 if (numberOfInputConnections && !m_needAutomaticPull) { 112 if (numberOfInputConnections && !m_needAutomaticPull) {
109 // When an AudioBasicInspectorNode is not connected to any downstream node while still connected from 113 // When an AudioBasicInspectorNode is not connected to any downstream node
110 // upstream node(s), add it to the context's automatic pull list. 114 // while still connected from upstream node(s), add it to the context's
115 // automatic pull list.
111 context()->deferredTaskHandler().addAutomaticPullNode(this); 116 context()->deferredTaskHandler().addAutomaticPullNode(this);
112 m_needAutomaticPull = true; 117 m_needAutomaticPull = true;
113 } else if (!numberOfInputConnections && m_needAutomaticPull) { 118 } else if (!numberOfInputConnections && m_needAutomaticPull) {
114 // The AudioBasicInspectorNode is connected to nothing, remove it from the context's automatic pull list. 119 // The AudioBasicInspectorNode is connected to nothing, remove it from the
120 // context's automatic pull list.
115 context()->deferredTaskHandler().removeAutomaticPullNode(this); 121 context()->deferredTaskHandler().removeAutomaticPullNode(this);
116 m_needAutomaticPull = false; 122 m_needAutomaticPull = false;
117 } 123 }
118 } 124 }
119 } 125 }
120 126
121 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698