Bug 1408294 - Make the SourceMediaStream used with AudioCapture produce silence. r=padenot

This SourceMediaStream is an existing hack to fit AudioCapture into
MediaManager's gUM flow. With the invariant that NotifyPull must produce data
we need to produce silence here.

Best of all would be if this SourceMediaStream was not needed at all, but let's
look at that another time.

MozReview-Commit-ID: J3EeIut1fgy

--HG--
extra : rebase_source : 8b84d8cf0f8d359d3b1c054146b28d494ed12053
This commit is contained in:
Andreas Pehrson 2017-12-05 14:37:11 +01:00
Родитель ee75d2b969
Коммит 5ca6b2a31c
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -114,7 +114,17 @@ public:
TrackID aID,
StreamTime aDesiredTime,
const PrincipalHandle& aPrincipalHandle) override
{}
{
// The AudioCapture setup code in MediaManager creates a dummy
// SourceMediaStream that is not actually exposed to content.
// We append null data here just to keep the MediaStreamGraph happy.
StreamTime delta = aDesiredTime - aSource->GetEndOfAppendedData(aID);
if (delta > 0) {
AudioSegment segment;
segment.AppendNullData(delta);
aSource->AppendToTrack(aID, &segment);
}
}
dom::MediaSourceEnum GetMediaSource() const override
{
return dom::MediaSourceEnum::AudioCapture;