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

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

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Do any necesssary re-configuration to the output's number of chan nels. 77 // Do any necesssary re-configuration to the output's number of chan nels.
78 output(0).setNumberOfChannels(numberOfChannels); 78 output(0).setNumberOfChannels(numberOfChannels);
79 } 79 }
80 } 80 }
81 } 81 }
82 82
83 void MediaStreamAudioSourceHandler::process(size_t numberOfFrames) 83 void MediaStreamAudioSourceHandler::process(size_t numberOfFrames)
84 { 84 {
85 AudioBus* outputBus = output(0).bus(); 85 AudioBus* outputBus = output(0).bus();
86 86
87 if (!audioSourceProvider()) { 87 if (!getAudioSourceProvider()) {
88 outputBus->zero(); 88 outputBus->zero();
89 return; 89 return;
90 } 90 }
91 91
92 if (!mediaStream() || m_sourceNumberOfChannels != outputBus->numberOfChannel s()) { 92 if (!getMediaStream() || m_sourceNumberOfChannels != outputBus->numberOfChan nels()) {
93 outputBus->zero(); 93 outputBus->zero();
94 return; 94 return;
95 } 95 }
96 96
97 // Use a tryLock() to avoid contention in the real-time audio thread. 97 // Use a tryLock() to avoid contention in the real-time audio thread.
98 // If we fail to acquire the lock then the MediaStream must be in the middle of 98 // If we fail to acquire the lock then the MediaStream must be in the middle of
99 // a format change, so we output silence in this case. 99 // a format change, so we output silence in this case.
100 MutexTryLocker tryLocker(m_processLock); 100 MutexTryLocker tryLocker(m_processLock);
101 if (tryLocker.locked()) { 101 if (tryLocker.locked()) {
102 audioSourceProvider()->provideInput(outputBus, numberOfFrames); 102 getAudioSourceProvider()->provideInput(outputBus, numberOfFrames);
103 } else { 103 } else {
104 // We failed to acquire the lock. 104 // We failed to acquire the lock.
105 outputBus->zero(); 105 outputBus->zero();
106 } 106 }
107 } 107 }
108 108
109 // ---------------------------------------------------------------- 109 // ----------------------------------------------------------------
110 110
111 MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(AbstractAudioContext& con text, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSo urceProvider> audioSourceProvider) 111 MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(AbstractAudioContext& con text, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSo urceProvider> audioSourceProvider)
112 : AudioSourceNode(context) 112 : AudioSourceNode(context)
(...skipping 10 matching lines...) Expand all
123 { 123 {
124 AudioSourceProviderClient::trace(visitor); 124 AudioSourceProviderClient::trace(visitor);
125 AudioSourceNode::trace(visitor); 125 AudioSourceNode::trace(visitor);
126 } 126 }
127 127
128 MediaStreamAudioSourceHandler& MediaStreamAudioSourceNode::mediaStreamAudioSourc eHandler() const 128 MediaStreamAudioSourceHandler& MediaStreamAudioSourceNode::mediaStreamAudioSourc eHandler() const
129 { 129 {
130 return static_cast<MediaStreamAudioSourceHandler&>(handler()); 130 return static_cast<MediaStreamAudioSourceHandler&>(handler());
131 } 131 }
132 132
133 MediaStream* MediaStreamAudioSourceNode::mediaStream() const 133 MediaStream* MediaStreamAudioSourceNode::getMediaStream() const
134 { 134 {
135 return mediaStreamAudioSourceHandler().mediaStream(); 135 return mediaStreamAudioSourceHandler().getMediaStream();
136 } 136 }
137 137
138 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source SampleRate) 138 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source SampleRate)
139 { 139 {
140 mediaStreamAudioSourceHandler().setFormat(numberOfChannels, sourceSampleRate ); 140 mediaStreamAudioSourceHandler().setFormat(numberOfChannels, sourceSampleRate );
141 } 141 }
142 142
143 } // namespace blink 143 } // namespace blink
144 144
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698