Bug 1423253 - Remove DirectMediaStreamTrackListener::mMedia. r=padenot

It is unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D22924

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-03-22 11:44:54 +00:00
parent 94ec4e907a
commit 9768400e21
2 changed files with 7 additions and 12 deletions

View File

@ -19,13 +19,11 @@ namespace mozilla {
void DirectMediaStreamTrackListener::MirrorAndDisableSegment(
AudioSegment& aFrom, AudioSegment& aTo) {
aTo.Clear();
aTo.AppendNullData(aFrom.GetDuration());
}
void DirectMediaStreamTrackListener::MirrorAndDisableSegment(
VideoSegment& aFrom, VideoSegment& aTo, DisabledTrackMode aMode) {
aTo.Clear();
if (aMode == DisabledTrackMode::SILENCE_BLACK) {
for (VideoSegment::ChunkIterator it(aFrom); !it.IsEnded(); it.Next()) {
aTo.AppendFrame(do_AddRef(it->mFrame.GetImage()),
@ -50,19 +48,17 @@ void DirectMediaStreamTrackListener::
DisabledTrackMode mode = mDisabledBlackCount > 0
? DisabledTrackMode::SILENCE_BLACK
: DisabledTrackMode::SILENCE_FREEZE;
if (!mMedia) {
mMedia = aMedia.CreateEmptyClone();
}
UniquePtr<MediaSegment> media(aMedia.CreateEmptyClone());
if (aMedia.GetType() == MediaSegment::AUDIO) {
MirrorAndDisableSegment(static_cast<AudioSegment&>(aMedia),
static_cast<AudioSegment&>(*mMedia));
static_cast<AudioSegment&>(*media));
} else if (aMedia.GetType() == MediaSegment::VIDEO) {
MirrorAndDisableSegment(static_cast<VideoSegment&>(aMedia),
static_cast<VideoSegment&>(*mMedia), mode);
static_cast<VideoSegment&>(*media), mode);
} else {
MOZ_CRASH("Unsupported media type");
}
NotifyRealtimeTrackData(aGraph, aTrackOffset, *mMedia);
NotifyRealtimeTrackData(aGraph, aTrackOffset, *media);
}
void DirectMediaStreamTrackListener::IncreaseDisabled(DisabledTrackMode aMode) {

View File

@ -180,12 +180,11 @@ class DirectMediaStreamTrackListener : public MediaStreamTrackListener {
void DecreaseDisabled(DisabledTrackMode aMode);
// Matches the number of disabled streams to which this listener is attached.
// The number of streams are those between the stream the listener was added
// and the SourceMediaStream that is the input of the data.
// The number of streams are those between the stream where the listener was
// added and the SourceMediaStream that is the source of the data reaching
// this listener.
Atomic<int32_t> mDisabledFreezeCount;
Atomic<int32_t> mDisabledBlackCount;
nsAutoPtr<MediaSegment> mMedia;
};
} // namespace mozilla