Media Recorder - RequestData does not provide data each time when ondataavailable is fired
Categories
(Core :: Audio/Video: Recording, defect, P2)
Tracking
()
People
(Reporter: sachinhambar, Assigned: pehrsons)
References
(Regression)
Details
(Keywords: regression)
Attachments
(23 files)
(deleted),
application/x-zip-compressed
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
Bug 1464268 - Rename MediaEncoder::Stop to DisconnectTracks to better reflect what it does. r?bryce!
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
This no longer waits for the encoders to initialize. We "fire" start when
data has reached the encoders instead. The spec is a bit vague on this:
Start recording all tracks in tracks using the recorder’s current
configuration and gather the data into a Blob blob. Queue a task, using the
DOM manipulation task source, to run the following steps:
(...)
4. Fire an event named start at recorder.
We follow this in the sense of having started "gathering the data into a Blob".
The data is just not there yet, but we know it is coming.
Assignee | ||
Comment 13•4 years ago
|
||
This would help control its lifetime, needed as it will receive an lref member
in a future patch.
Assignee | ||
Comment 14•4 years ago
|
||
Assignee | ||
Comment 15•4 years ago
|
||
Assignee | ||
Comment 16•4 years ago
|
||
Prior to this patch, DataAvailable notifications went from each encoder, up to
MediaRecorder::Session, which decided whether to pull data from the encoders for
writing to a container.
Now, data is encoded by the encoders automatically as it reaches them and gets
added to MediaQueues. The Muxer is notified immediately through the MediaQueues
and muxes data into its ContainerWriter continuously.
MediaRecorder::Session still has to manually pull data from ContainerWriter.
Note that this breaks VP8TrackEncoder's frame-dropping policy, because calls
to encode data are no longer coalesced. This gets fixed in a later patch in the
stack.
Assignee | ||
Comment 17•4 years ago
|
||
The frame-skipping logic in VP8TrackEncoder works when it gets to encode more
than one frame in a single Encode(). Coalescing the AdvanceCurrentTime like this
will allow for that because if VP8TrackEncoder lags behind, an
AdvanceCurrentTime runnable will take long enough to run (and allow the next
AdvanceCurrentTime dispatch) that multiple frames will be appended in the
meantime.
Assignee | ||
Comment 18•4 years ago
|
||
Assignee | ||
Comment 19•4 years ago
|
||
This ensures that DoSessionEndTask will stop the MediaEncoder first, or cancel
it if data is to be discarded. We also wait for all the data still buffered to
be encoded, muxed and extracted into the blob before proceeding with
"dataavailable".
Assignee | ||
Comment 20•4 years ago
|
||
Assignee | ||
Comment 21•4 years ago
|
||
Assignee | ||
Comment 22•4 years ago
|
||
Assignee | ||
Comment 23•4 years ago
|
||
Assignee | ||
Comment 24•4 years ago
|
||
This allows doing internal work synchronously in these callbacks, such as
transferring metadata to the muxer. All callbacks must behave the same to
handle them in the order they were called.
Assignee | ||
Comment 25•4 years ago
|
||
This will let MediaEncoder extract blobs when a certain duration of
encoded data has been gathered into the blob, in a future patch.
Assignee | ||
Comment 26•4 years ago
|
||
Assignee | ||
Comment 27•4 years ago
|
||
This brings back dataavailable events that are based on the timeslice interval
to MediaRecorder.
Prior to this stack we used wall-clock time to decide whether to fire
dataavailable events. The spec says "once a minimum of timeslice
milliseconds of data have been collected", meaning the old behavior was wrong
as no guarantee could be given to how much data had been collected, and
especially muxed, for a given duration of wall-clock time.
With this patch the responsibility of triggering dataavailable events lies with
MediaEncoder, which also knows the timeslice. This means it can issue blobs
precisely when they contain enough data to fill the timeslice.
Buffering in the ContainerWriter is a problem that can result in, in the worst
case, empty blobs, as the logic is based on the input to the muxer where
timestamps are still known.
Assignee | ||
Comment 28•4 years ago
|
||
Without this we get an unexpected empty blob in test_mediarecorder_onerror_pause.html.
Assignee | ||
Comment 29•4 years ago
|
||
The refactoring has led to the VP8TrackEncoder being cleaned up later on
shutdown. This is fine but is not guaranteed to happen before threads are shut
down (MediaEncoder is ref counted!).
Gfx doesn't like it when a resource is cleaned up this late, so this patch
adds a guarantee that mMuteFrame gets cleaned up before thread shutdown.
Assignee | ||
Comment 30•4 years ago
|
||
Assignee | ||
Comment 31•4 years ago
|
||
Assignee | ||
Comment 32•4 years ago
|
||
Assignee | ||
Comment 33•4 years ago
|
||
Comment 34•4 years ago
|
||
Comment 35•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d1768aade7f3
https://hg.mozilla.org/mozilla-central/rev/48815139e52e
https://hg.mozilla.org/mozilla-central/rev/41d12b06c732
https://hg.mozilla.org/mozilla-central/rev/22ec0122e2b0
https://hg.mozilla.org/mozilla-central/rev/4a187d94c6a2
https://hg.mozilla.org/mozilla-central/rev/e5b53ed048f4
https://hg.mozilla.org/mozilla-central/rev/bb840d443ce5
https://hg.mozilla.org/mozilla-central/rev/e43d3445f0d4
https://hg.mozilla.org/mozilla-central/rev/87a8cf23da93
https://hg.mozilla.org/mozilla-central/rev/7ef0811b3e59
https://hg.mozilla.org/mozilla-central/rev/267b361271e2
https://hg.mozilla.org/mozilla-central/rev/d459b05e1959
https://hg.mozilla.org/mozilla-central/rev/334c6165b8a0
https://hg.mozilla.org/mozilla-central/rev/28563731435b
https://hg.mozilla.org/mozilla-central/rev/7ef85a640ab2
https://hg.mozilla.org/mozilla-central/rev/bb3690c52cb9
https://hg.mozilla.org/mozilla-central/rev/4bf128c1bebc
https://hg.mozilla.org/mozilla-central/rev/a6e0db017654
https://hg.mozilla.org/mozilla-central/rev/7464b3036653
https://hg.mozilla.org/mozilla-central/rev/8a26c0496e18
https://hg.mozilla.org/mozilla-central/rev/925b22cbd3b6
https://hg.mozilla.org/mozilla-central/rev/e210b5200da9
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Description
•