NTSTATUS KeyboardFilterDevice::Read(KIrp I) { mCurrentStackLocation = I.NextStackLocation(); mNumOutstandingIrps++; return PassThrough(I, TRUE, NULL); }
// Called back on GraphDriver thread! // Note this can be called back after ::Shutdown() void MediaEngineWebRTCMicrophoneSource::NotifyInputData(MediaStreamGraph* aGraph, const AudioDataValue* aBuffer, size_t aFrames, TrackRate aRate, uint32_t aChannels) { // If some processing is necessary, packetize and insert in the WebRTC.org // code. Otherwise, directly insert the mic data in the MSG, bypassing all processing. if (PassThrough()) { InsertInGraph<AudioDataValue>(aBuffer, aFrames, aChannels); } else { PacketizeAndProcess(aGraph, aBuffer, aFrames, aRate, aChannels); } }
void MediaEngineWebRTCMicrophoneSource::Process(int channel, webrtc::ProcessingTypes type, sample *audio10ms, size_t length, int samplingFreq, bool isStereo) { MOZ_ASSERT(!PassThrough(), "This should be bypassed when in PassThrough mode."); // On initial capture, throw away all far-end data except the most recent sample // since it's already irrelevant and we want to keep avoid confusing the AEC far-end // input code with "old" audio. if (!mStarted) { mStarted = true; while (gFarendObserver->Size() > 1) { free(gFarendObserver->Pop()); // only call if size() > 0 } } while (gFarendObserver->Size() > 0) { FarEndAudioChunk *buffer = gFarendObserver->Pop(); // only call if size() > 0 if (buffer) { int length = buffer->mSamples; int res = mVoERender->ExternalPlayoutData(buffer->mData, gFarendObserver->PlayoutFrequency(), gFarendObserver->PlayoutChannels(), mPlayoutDelay, length); free(buffer); if (res == -1) { return; } } } MonitorAutoLock lock(mMonitor); if (mState != kStarted) return; MOZ_ASSERT(!isStereo); InsertInGraph<int16_t>(audio10ms, length, 1); return; }
int main() { int n = 100, i; int *x = malloc(n * sizeof(int)); int *y = malloc(n * sizeof(int)); for (i = 0; i < n; i++ ) x[i] = i; # pragma maxc func: PassThroughDF PassThrough(x, y, n); int failed = 0; for (i = 0; i < n; i++) { if (y[i] != i) { printf("Expected y[%d] = %d, got %d!", i, i, y[i]); failed = 1; } } return failed; }