Bug 1259788 - Add a new disabled mode for MSG tracks. r=jesup

MozReview-Commit-ID: 1dMTR4Wmcd8
This commit is contained in:
Andreas Pehrson
2016-08-15 14:19:42 +02:00
parent 0ea44a1cbd
commit 2d5667b427
9 changed files with 115 additions and 44 deletions

View File

@@ -2425,7 +2425,8 @@ HTMLMediaElement::SetCapturedOutputStreamsEnabled(bool aEnabled) {
}
TrackID id = pair.second()->GetDestinationTrackId();
outputSource->SetTrackEnabled(id, aEnabled);
outputSource->SetTrackEnabled(id, aEnabled ? DisabledTrackMode::ENABLED
: DisabledTrackMode::SILENCE_FREEZE);
LOG(LogLevel::Debug,
("%s track %d for captured MediaStream %p",
@@ -2498,7 +2499,8 @@ HTMLMediaElement::AddCaptureMediaTrackToOutputStream(MediaTrack* aTrack,
// Track is muted initially, so we don't leak data if it's added while paused
// and an MSG iteration passes before the mute comes into effect.
processedOutputSource->SetTrackEnabled(destinationTrackID, false);
processedOutputSource->SetTrackEnabled(destinationTrackID,
DisabledTrackMode::SILENCE_FREEZE);
RefPtr<MediaInputPort> port =
inputTrack->ForwardTrackContentsTo(processedOutputSource,
destinationTrackID);
@@ -2507,7 +2509,8 @@ HTMLMediaElement::AddCaptureMediaTrackToOutputStream(MediaTrack* aTrack,
aOutputStream.mTrackPorts.AppendElement(Move(p));
if (mSrcStreamIsPlaying) {
processedOutputSource->SetTrackEnabled(destinationTrackID, true);
processedOutputSource->SetTrackEnabled(destinationTrackID,
DisabledTrackMode::ENABLED);
}
LOG(LogLevel::Debug,