Bug 1702646 - Fix TestAudioInputProcessing tests r=padenot

The AudioInputProcessing now needs to call ProcessInput to process the
given input data instead of processing them in NotifyInputData

Differential Revision: https://phabricator.services.mozilla.com/D116673
This commit is contained in:
Chun-Min Chang 2021-06-08 00:48:20 +00:00
Родитель c95e8979b6
Коммит d2f2ea20bb
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -74,6 +74,7 @@ TEST(TestAudioInputProcessing, UnaccountedPacketizerBuffering)
AudioInputProcessing::BufferInfo{
buffer.Elements(), nrFrames, channels, rate},
nextTime - nrFrames);
aip->ProcessInput(graph, nullptr);
aip->Pull(graph, processedTime, nextTime, segment.GetDuration(), &segment,
true, &ended);
EXPECT_EQ(aip->NumBufferedFrames(graph), 24U);
@ -93,6 +94,7 @@ TEST(TestAudioInputProcessing, UnaccountedPacketizerBuffering)
AudioInputProcessing::BufferInfo{
buffer.Elements(), nrFrames, channels, rate},
nextTime - (2 * nrFrames));
aip->ProcessInput(graph, nullptr);
aip->Pull(graph, processedTime, nextTime, segment.GetDuration(), &segment,
true, &ended);
EXPECT_EQ(aip->NumBufferedFrames(graph), 120U);

Просмотреть файл

@ -1083,7 +1083,7 @@ void AudioInputProcessing::ProcessInput(MediaTrackGraphImpl* aGraph,
MOZ_ASSERT(aGraph);
MOZ_ASSERT(aGraph->OnGraphThread());
if (mEnded || !mEnabled || !mLiveFramesAppended || !mInputData || !aSegment) {
if (mEnded || !mEnabled || !mLiveFramesAppended || !mInputData) {
return;
}
@ -1095,7 +1095,12 @@ void AudioInputProcessing::ProcessInput(MediaTrackGraphImpl* aGraph,
// code. Otherwise, directly insert the mic data in the MTG, bypassing all
// processing.
if (PassThrough(aGraph)) {
mSegment.AppendSegment(aSegment, mPrincipal);
if (aSegment) {
mSegment.AppendSegment(aSegment, mPrincipal);
} else {
InsertInGraph(aGraph, inputInfo.mBuffer, inputInfo.mFrames,
inputInfo.mChannels);
}
} else {
MOZ_ASSERT(aGraph->GraphRate() == inputInfo.mRate);
PacketizeAndProcess(aGraph, inputInfo.mBuffer, inputInfo.mFrames,