This could confuse listeners, since non-direct listeners would see more
data than their direct counterparts.
MozReview-Commit-ID: FC5rukQtrKL
--HG--
extra : rebase_source : e60ad42fe84867c5737d44629a1a5ca60398906c
There was a race where ending the track before removing the direct listener here,
allowed the source to append more data (notifying the direct listener)
after the consumer had been notified of the ending track.
MozReview-Commit-ID: E08UeMNQhGx
--HG--
extra : rebase_source : 740c4fde40b9e19974922cd893618032c683493d
The patch is generated from following command:
rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,
MozReview-Commit-ID: AtLcWApZfES
--HG--
rename : mfbt/unused.h => mfbt/Unused.h
Now everything is ready. We can make NotifyQueuedTrackChanges only triggered by TRACK_EVENT_CREATED and TRACK_EVENT_ENDED without breaking anything. Also we make TrackUnionStream no longer copying data in video case.
MozReview-Commit-ID: IgLx1mpBWB3
--HG--
extra : transplant_source : %21M%C5%07%B9%CB%16%96%D6gN%C0g%0A%E8%7D%A0%AB%98%26
Now everything is ready. We can make NotifyQueuedTrackChanges only triggered by TRACK_EVENT_CREATED and TRACK_EVENT_ENDED without breaking anything. Also we make TrackUnionStream no longer copying data in video case.
MozReview-Commit-ID: IgLx1mpBWB3
--HG--
extra : amend_source : 2c57e72a84dee45f673d7d02eaa8c973ca9f634a
Now everything is ready. We can make NotifyQueuedTrackChanges only triggered by TRACK_EVENT_CREATED and TRACK_EVENT_ENDED without breaking anything. Also we make TrackUnionStream no longer copying data in video case.
MozReview-Commit-ID: IgLx1mpBWB3
--HG--
extra : transplant_source : %9Fk%8F%20%FE%12%FC%DF%A0%C6%02%AC%D2%3C%EE%08%26%E3%9E%27
This can reduce the include header dependency. MediaStreamVideoSink will inherit from DirectMediaStreamTrackListener. But we can't use forward declaration on MediaStreamListener because the usage of nsTArray<RefPtr<MediaStreamVideoSink>>.
MozReview-Commit-ID: 328s4Kw9NvW
--HG--
extra : transplant_source : %D2%18%E3%3B%0C%D8%F04%F3%EB%EB%A0%A7%8B%B1%A9%AB%97rY
Rename those two function to better name alignment with AddDirectListener and AddDirectTrackListener.
MozReview-Commit-ID: 6QY08oyih1X
--HG--
extra : transplant_source : %5C%1C%23%AC%D7%0D%97%24%CB%ED%8E%D5%60/%5E%07%F2%85Z%DA
This means that when a MediaStreamListener is added to a stream, we'll call
NotifyQueuedTrackChanges with TRACK_EVENT_CREATE for all tracks that already
exist.
Likewise, we'll call NotifyQueuedTrackChanges with TRACK_EVENT_ENDED for all
tracks that exist and have ended.
This fixes potential race conditions where a track was created and/or ended
before the listener was asynchronously added.
MozReview-Commit-ID: G3juhfiZMtg
--HG--
extra : rebase_source : d2ca7cb24ce154c4aa342bb477aee455c9cfef92
extra : intermediate-source : 80443106b2636d8de3c3de44f2706e99d70c06ae
extra : source : 70e8c5a785a9866e6205b54bd1c45faaf834717d
This lets us notify about a created TrackUnionStream track (and since it was
created, we can notify when it ends), even though it has been blocked from main
thread.
MozReview-Commit-ID: HyopzISBfbb
--HG--
extra : rebase_source : a18be6b0fcb194c016ae06c62eb5cebbf86eb8d5
extra : intermediate-source : 38e3e48c8dd011a0503f1241c7b21a630738c6c0
extra : source : 690904309e169aa74f95163f0d796493ef882972
Rename those two function to better name alignment with AddDirectListener and AddDirectTrackListener.
MozReview-Commit-ID: 6QY08oyih1X
--HG--
extra : rebase_source : e0f2ac5de75d54a870f5a99f08505e40aa0696d9
This means that when a MediaStreamListener is added to a stream, we'll call
NotifyQueuedTrackChanges with TRACK_EVENT_CREATE for all tracks that already
exist.
Likewise, we'll call NotifyQueuedTrackChanges with TRACK_EVENT_ENDED for all
tracks that exist and have ended.
This fixes potential race conditions where a track was created and/or ended
before the listener was asynchronously added.
MozReview-Commit-ID: G3juhfiZMtg
--HG--
extra : rebase_source : 4f7b9c116e7d25cfc4c3894551173925613c6c14
extra : intermediate-source : 45bfebd36a99baef6bee50e52ac9c78965a7f1c2
extra : source : 70e8c5a785a9866e6205b54bd1c45faaf834717d
This lets us notify about a created TrackUnionStream track (and since it was
created, we can notify when it ends), even though it has been blocked from main
thread.
MozReview-Commit-ID: HyopzISBfbb
--HG--
extra : rebase_source : a3d676257473bba08190b8e2b24d027c42306621
extra : intermediate-source : 5454dcaa31ff8eb060b6f1531a376dcbc24ffb4d
extra : source : 690904309e169aa74f95163f0d796493ef882972
This means that when a MediaStreamListener is added to a stream, we'll call
NotifyQueuedTrackChanges with TRACK_EVENT_CREATE for all tracks that already
exist.
Likewise, we'll call NotifyQueuedTrackChanges with TRACK_EVENT_ENDED for all
tracks that exist and have ended.
This fixes potential race conditions where a track was created and/or ended
before the listener was asynchronously added.
MozReview-Commit-ID: G3juhfiZMtg
--HG--
extra : rebase_source : 6f4fe68b888b6dd0d9ee370b6a390ff17da5f1de
extra : source : 70e8c5a785a9866e6205b54bd1c45faaf834717d
This lets us notify about a created TrackUnionStream track (and since it was
created, we can notify when it ends), even though it has been blocked from main
thread.
MozReview-Commit-ID: HyopzISBfbb
--HG--
extra : rebase_source : 55d6dd5d6a34a0b499b45e0b72f900fc37cff1bf
extra : source : 690904309e169aa74f95163f0d796493ef882972
Rename StreamBuffer to StreamTracks. We still need a place to keep the track information in every MediaStream, even the StreamBuffer::Track::mSegment is empty.
--HG--
rename : dom/media/StreamBuffer.cpp => StreamTracks.cpp
rename : dom/media/StreamBuffer.h => StreamTracks.h
This lets us know the track's TrackID in the destination stream before
the input port has been processed.
For sanity we only allow mapping to a destination TrackID if the
destination stream does not have any TRACK_ANY input ports already
assigned to it as that can cause intermittent TrackID collisions.
MozReview-Commit-ID: ClFyQl0nYFC
--HG--
extra : rebase_source : 25fa0f34cb4fa9293a572bff03fe005c33be0195
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 : GPSNwBVyD4j
extra : rebase_source : 4388211be87ebe8a3839ea031b5c504d642806ab
Locking to specific tracks lets us dynamically remove and add single
tracks to a ProcessedMediaStream.
--HG--
extra : commitid : GPSNwBVyD4j
extra : rebase_source : 0b1b79077f95bbefc8c71de551c5e3483a7d6ac0