Don't recreate the source stream on seek when HTMLMediaElement is captured to a stream
Categories
(Core :: Audio/Video: Playback, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: pehrsons, Assigned: pehrsons)
References
(Regressed 1 open bug)
Details
Attachments
(13 files, 1 obsolete file)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1172394 - Always mark a MediaStreamAudioSourceNode attached to a live track as active. r?padenot
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Comment 3•10 years ago
|
||
Assignee | ||
Comment 4•10 years ago
|
||
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Comment 7•10 years ago
|
||
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
Comment 10•10 years ago
|
||
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
Comment 13•10 years ago
|
||
Assignee | ||
Comment 14•10 years ago
|
||
Comment 15•10 years ago
|
||
Assignee | ||
Comment 16•10 years ago
|
||
Comment 17•10 years ago
|
||
Assignee | ||
Comment 18•10 years ago
|
||
Assignee | ||
Comment 19•10 years ago
|
||
Comment 20•10 years ago
|
||
Comment 21•10 years ago
|
||
Assignee | ||
Comment 22•10 years ago
|
||
Updated•10 years ago
|
Updated•10 years ago
|
Assignee | ||
Comment 23•10 years ago
|
||
Comment 24•10 years ago
|
||
Assignee | ||
Comment 25•9 years ago
|
||
Updated•9 years ago
|
Assignee | ||
Updated•9 years ago
|
Updated•9 years ago
|
Updated•8 years ago
|
Comment 27•8 years ago
|
||
Assignee | ||
Comment 28•8 years ago
|
||
Assignee | ||
Comment 29•5 years ago
|
||
I think it's time to tackle this anew.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 30•5 years ago
|
||
Assignee | ||
Comment 31•5 years ago
|
||
HTMLMediaElement avoid creating new tracks in MetadataLoaded when it has already
created some, so there should be no side effect to this patch.
Depends on D52036
Assignee | ||
Comment 32•5 years ago
|
||
This makes us forget tracks at the right times. The spec also says no
removetrack events should be fired because of this, yet it seems to be something
other user agents do:
https://wpt.fyi/results/media-source/mediasource-avtracks.html
This is of low importance however, since MediaTracks are prefed off by default.
Depends on D52037
Assignee | ||
Comment 33•5 years ago
|
||
This reworks how media element captureStream works by removing the differences
between MediaStream and MediaDecoder capture. MediaDecoder capture will be
refactored so that ownership of MediaStreamTracks lies with the media element
instead of the OutputStreamManager. The internal MediaDecoder parts happen in a
later patch.
The new API for capturing a MediaDecoder involves a boolean on/off toggle, the
output tracks the decoder pipes data to, and the principal that data is tagged
with. If capturing is on but there are no output tracks, playback will not
happen, to ensure that no data gets accidentally skipped in the output tracks
while captured.
This also changes the logic for setting up MediaElementTrackSources in
HTMLMediaElement so it's triggered by the WatchManager and thus run in tail
dispatched runnables.
Depends on D52038
Assignee | ||
Comment 34•5 years ago
|
||
This patch removes the responsibility of js-facing MediaStreamTracks from the
MediaDecoder stack, and moves the machinery for setting up DecodedStream to
higher order functions like state mirroring and watchables.
OutputStreamManager is completely gone, since it was designed to manage
MediaStreamTracks across multiple output streams for a single decoder,
on main thread. HTMLMediaElement took over its task in the previous patch.
The MediaDecoderStateMachine now has three control points for capturing:
- mOutputCaptured, which, if true, will capture all decoded data into
mOutputTracks. If this is set, but mOutputTracks is empty, we are still
waiting for tracks, and DecodedStream will not play any data. When tracks are
set, a new DecodedStream is created that will play data through
SourceMediaTracks piped into mOutputTracks. - mOutputTracks, which is the set of tracks data is captured into, for
forwarding to all the output tracks the media element is managing. This set of
tracks is managed by the MediaDecoder owner, and must contain one audio track
if the decoder is decoding audio, and one video track if the decoder is
decoding video. It may be empty since output can be captured before metadata
is loaded, or playback has ended. - mOutputPrincipal, which is the principal of the decoded data. All data sent
into SourceMediaTracks is tagged with this principal.
Depends on D52040
Assignee | ||
Comment 35•5 years ago
|
||
This patches does several minor things:
- Moves SetSink (from setSinkid) to automatic coalescing of multiple calls
through a Canonical/Mirror setup instead of a manual atomic counter. - Simplifies the logic for when to update the sink in SetSink.
- Removes PlaybackParams as a general MediaSink property, as it only contains
audio params. - Makes PlaybackParams an internal AudioSink concept, that AudioSinkWrapper
knows about. - Ensures mMediaSink is only accessed on the decoder TaskQueue, to allow
accessing mirrored members when creating it.
Depends on D52042
Assignee | ||
Comment 36•5 years ago
|
||
Depends on D52043
Assignee | ||
Comment 37•5 years ago
|
||
Depends on D52044
Assignee | ||
Comment 38•5 years ago
|
||
Depends on D52045
Assignee | ||
Comment 39•5 years ago
|
||
Depends on D52046
Assignee | ||
Comment 40•5 years ago
|
||
Depends on D52047
Assignee | ||
Comment 41•5 years ago
|
||
Depends on D52048
Comment 42•5 years ago
|
||
Comment 43•5 years ago
|
||
Backed out for failures on browser_disabledForMediaStreamVideos.js (+ Bug 1546756 - Bug 1302379 - Bug 1500049)
backout: https://hg.mozilla.org/integration/autoland/rev/7272d77d4e808dcbbd1f4f50210786dd326b218a
- permafails on subsequent pushes too, but it's moving chunks
failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=276082854&repo=autoland&lineNumber=5211
[task 2019-11-13T22:24:00.091Z] 22:24:00 INFO - TEST-START | toolkit/components/pictureinpicture/tests/browser_disabledForMediaStreamVideos.js
[task 2019-11-13T22:25:30.112Z] 22:25:30 INFO - TEST-INFO | started process screenshot
[task 2019-11-13T22:25:30.393Z] 22:25:30 INFO - TEST-INFO | screenshot: exit 0
[task 2019-11-13T22:25:30.393Z] 22:25:30 INFO - Buffered messages logged at 22:24:00
[task 2019-11-13T22:25:30.393Z] 22:25:30 INFO - Entering test bound test_disabledForMediaStreamVideos
[task 2019-11-13T22:25:30.393Z] 22:25:30 INFO - Buffered messages finished
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/pictureinpicture/tests/browser_disabledForMediaStreamVideos.js | Test timed out -
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - GECKO(3016) | MEMORY STAT | vsize 19406245MB | vsizeMaxContiguous 64994388MB | residentFast 992MB
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - TEST-OK | toolkit/components/pictureinpicture/tests/browser_disabledForMediaStreamVideos.js | took 90127ms
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - Not taking screenshot here: see the one that was previously logged
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/pictureinpicture/tests/browser_disabledForMediaStreamVideos.js | Found a tab after previous test timed out: http://example.com/browser/toolkit/components/pictureinpicture/tests/test-page.html -
[task 2019-11-13T22:25:30.394Z] 22:25:30 INFO - checking window state
Assignee | ||
Comment 44•5 years ago
|
||
Thanks. I have a pernosco recording of this timeout at https://pernos.co/debug/u5SU1FR4G6Qb4PJeXE7UeA/index.html.
Assignee | ||
Comment 45•5 years ago
|
||
Ah, captureStream is busted for looping media elements. Even for seeking ones actually. Shortly after seeking back to the beginning, capture stops.
Track lifetimes are ok (existing dom/media tests), so a media element playing a stream from another media element that seeked still end as expected. But it loses the direct video listener between the SourceMediaTrack and the ForwardedInputTrack, so video stops flowing for the media element with the MediaStream. In this particular test case, we do a mozCaptureStream() typically in the second loop, so that video track will never see a first frame, and the media element doesn't resolve its play promises.
The culprit is here. It worked before, when we didn't support consecutively switching the inputs of a live ForwardedInputTrack.
Assignee | ||
Comment 46•5 years ago
|
||
This was not needed when inputs to a ForwardedInputTrack could not come and go,
but they can now. This keeps direct listeners for a ForwardedInputTrack around
until it ends, as that's the terminal state where we know we can no longer
process another input.
Depends on D52049
Comment 47•5 years ago
|
||
Comment 48•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5b466cf155f9
https://hg.mozilla.org/mozilla-central/rev/e20ee1ce7ce5
https://hg.mozilla.org/mozilla-central/rev/8e45c51fc6cf
https://hg.mozilla.org/mozilla-central/rev/9114318b6493
https://hg.mozilla.org/mozilla-central/rev/fdf5dd8ff807
https://hg.mozilla.org/mozilla-central/rev/b91bd828c657
https://hg.mozilla.org/mozilla-central/rev/bff56fd97a88
https://hg.mozilla.org/mozilla-central/rev/9d3f25494445
https://hg.mozilla.org/mozilla-central/rev/4f27806289e2
https://hg.mozilla.org/mozilla-central/rev/6bcd10fe43b9
https://hg.mozilla.org/mozilla-central/rev/2d4bb8556f08
https://hg.mozilla.org/mozilla-central/rev/ae3cd36f38f6
https://hg.mozilla.org/mozilla-central/rev/2516219862e8
Description
•