mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1170958 - Remove ProcessedMediaStream::ForwardTrackEnabled. r=roc,jesup
TrackUnionStream guarantees that TrackIDs are maintained if no tracks have claimed them before. In the gUM case, we have a SourceMediaStream which we wholly own (the DOMMediaStream's Input stream), piped into a TrackUnionStream which no-one external is able to add tracks to (the DOMMediaStream's Owned stream) - addTrack()ed tracks are added to the DOMMediaStream's Playback stream. The MediaStreamTracks being enabled/disable refer to a TrackID in the DOMMediaStream's Owned stream. Alas, we don't need to forward a track's enabled state, we can just do it on the source. --HG-- extra : commitid : Kvj9RrN9MgP
This commit is contained in:
parent
f02743d4ff
commit
b4ff8db67c
@ -800,17 +800,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// let us intervene for direct listeners when someone does track.enabled = false
|
||||
virtual void SetTrackEnabled(TrackID aTrackID, bool aEnabled) override
|
||||
{
|
||||
// We encapsulate the SourceMediaStream and TrackUnion into one entity, so
|
||||
// we can handle the disabling at the SourceMediaStream
|
||||
|
||||
// We need to find the input track ID for output ID aTrackID, so we let the TrackUnion
|
||||
// forward the request to the source and translate the ID
|
||||
GetInputStream()->AsProcessedStream()->ForwardTrackEnabled(aTrackID, aEnabled);
|
||||
}
|
||||
|
||||
virtual DOMLocalMediaStream* AsDOMLocalMediaStream() override
|
||||
{
|
||||
return this;
|
||||
|
@ -1115,11 +1115,6 @@ public:
|
||||
virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) = 0;
|
||||
void SetAutofinishImpl(bool aAutofinish) { mAutofinish = aAutofinish; }
|
||||
|
||||
/**
|
||||
* Forward SetTrackEnabled() to the input MediaStream(s) and translate the ID
|
||||
*/
|
||||
virtual void ForwardTrackEnabled(TrackID aOutputID, bool aEnabled) {};
|
||||
|
||||
// Only valid after MediaStreamGraphImpl::UpdateStreamOrder() has run.
|
||||
// A DelayNode is considered to break a cycle and so this will not return
|
||||
// true for echo loops, only for muted cycles.
|
||||
|
@ -149,18 +149,6 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
|
||||
}
|
||||
}
|
||||
|
||||
// Forward SetTrackEnabled(output_track_id, enabled) to the Source MediaStream,
|
||||
// translating the output track ID into the correct ID in the source.
|
||||
void TrackUnionStream::ForwardTrackEnabled(TrackID aOutputID, bool aEnabled)
|
||||
{
|
||||
for (int32_t i = mTrackMap.Length() - 1; i >= 0; --i) {
|
||||
if (mTrackMap[i].mOutputTrackID == aOutputID) {
|
||||
mTrackMap[i].mInputPort->GetSource()->
|
||||
SetTrackEnabled(mTrackMap[i].mInputTrackID, aEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t TrackUnionStream::AddTrack(MediaInputPort* aPort, StreamBuffer::Track* aTrack,
|
||||
GraphTime aFrom)
|
||||
{
|
||||
|
@ -21,10 +21,6 @@ public:
|
||||
virtual void RemoveInput(MediaInputPort* aPort) override;
|
||||
virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
|
||||
|
||||
// Forward SetTrackEnabled(output_track_id, enabled) to the Source MediaStream,
|
||||
// translating the output track ID into the correct ID in the source.
|
||||
virtual void ForwardTrackEnabled(TrackID aOutputID, bool aEnabled) override;
|
||||
|
||||
protected:
|
||||
// Only non-ended tracks are allowed to persist in this map.
|
||||
struct TrackMapEntry {
|
||||
|
Loading…
Reference in New Issue
Block a user