Other modules than MediaTrackLists may want to receive updates on a
DOMMediaStream's track set. This moves the MediaTrackListListener out of
the MediaTrackList class into DOMMediaStream as a general interface.
The logic for adding MediaTracks to the MediaTrackList when
MediaStreamTracks are added or removed from a DOMMediaStream is moved to
HTMLMediaElement as this fits the model better - HTMLMediaElement is the
owner of the MediaTrackLists.
--HG--
extra : commitid : FxucwRqUZUo
When play()ing a media element after it has ended, MediaDecoder will
again call MetadataLoaded(). When capturing the media to a
DOMMediaStream, that will attempt to create new MediaStreamTracks in the
stream with the original TrackIDs. That won't work, since the original
tracks with the same TrackIDs have already ended.
We solve it by only explicitly creating MediaStreamTracks in the stream
in captureStream(), and only if they're already known. Otherwise the
tracks will be created asynchronously when available in the underlying
stream.
--HG--
extra : commitid : Kvj9RrN9MgP
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
A DOMMediaStream's owned stream is piped from the input stream which is
under the control of the DOMMediaStream's owner/producer (like
captureStream or gUM). When producers like these create new tracks after
the stream has already been created (the initial set should be available
to JS synchronously), it is nice if the DOMMediaStream picks them up
automatically and create the corresponding MediaStreamTracks.
The OwnedStreamListener added here does just that; creates an owned
MediaStreamTrack when a track appeared in the stream that didn't already
have a MediaStreamTrack.
It also moves the logic for ended tracks from the PlaybackStreamListener
to the OwnedStreamListener as we previously would see a track end in the
playbak stream after removeTrack() and that would be interpreted as the
track ending at the source.
--HG--
extra : commitid : Kvj9RrN9MgP
Simplifies the structure of MediaManager somewhat. Possible since
MediaManager owns both the SourceMediaStream and the DOMMediaStream.
--HG--
extra : commitid : Kvj9RrN9MgP
This lets us separate tracks by ownership like so:
* Input - Owned by the producer of the DOMMediaStream (gUM etc.)
* Owned - Contains Input tracks (per above) or tracks cloned tracks
if this DOMMediaStream is a clone.
* Playback - Contains Owned tracks plus tracks addTrack()ed to this
DOMMediaStream minus tracks removeTrack()ed from this
DOMMediaStream.
--HG--
extra : commitid : Kvj9RrN9MgP
This allows for tracking the input track of an added track (for
ProcessedMediaStream tracks; SourceMediaStream tracks don't have input
tracks) directly in the NotifyQueuedTrackChanges handler, which will be
necessary for locking MediaInputPorts to specific tracks.
--HG--
extra : commitid : Kvj9RrN9MgP
Some users with many tabs have reported extremely long GC pauses
triggered by the CC forcing the GC to finish. Increasing the limit may
cause memory to be somewhat higher for these users, but that is better
than 30 second pauses.
gfxIntSize is just a typedef of gfx::IntSize, so this is very mechanical. The
only tricky part is deciding for each occurrence whether to replace it with
IntSize, gfx::IntSize or mozilla::gfx::IntSize; in all cases I went with the
shortest one that worked given the existing "using namespace" declarations.
--HG--
extra : rebase_source : 67fd15f87222b16defa70ef795c6d77dfacf1c36