Граф коммитов

293 Коммитов

Автор SHA1 Сообщение Дата
Andreas Pehrson 1e4382f9fb Bug 1544650 - Always pre-create MediaStreamTracks for DecodedStream in MediaDecoder. r=padenot
This moves the responsibility for creating MediaStreamTracks from
DecodedStream::Start to MediaDecoder. This let's MediaDecoder create them as
soon as metadata is known. This gives the application guarantees on when tracks
can be expected to exist, and aligns with the spec that says they should be
created when metadata is known.

Differential Revision: https://phabricator.services.mozilla.com/D28473

--HG--
extra : moz-landing-system : lando
2019-04-23 16:46:30 +00:00
Andreas Pehrson 2cab1f445f Bug 1536766 - End a track only after the graph has reported reaching its end time in DecodedStream. r=jya,padenot
This gives us a guarantee that the first frame of a media file can be rendered
with a second media element and mozCaptureStream(), even if the file is very
very short.

With longer video-only files there were also cases where nothing ended up being
rendered. Probably because the MediaStreamGraph ended up switching from an
AudioCallbackDriver to a SystemClockDriver and this took enough time to put the
SourceMediaStream::EndTrack and the SourceMediaStream::AddTrackListener calls
for this video track to be processed in the same iteration. The listener would
then always lose to the ending track and update main thread state too late,
leading to its media element not rendering any frames and nasty intermittent
failures.

Differential Revision: https://phabricator.services.mozilla.com/D27270

--HG--
extra : moz-landing-system : lando
2019-04-24 10:56:16 +00:00
Andreas Pehrson 977b049e15 Bug 1536766 - Better handle overlapping video frames in DecodedStream::SendVideo. r=jya
A case where this wasn't working was bipbop-lateaudio.mp4, where the last frame
has duration 0 and starts and ends before the previous frame has ended. The
VideoSink still renders this frame at the end of playback, so this patch
brings DecodedStream closer to that behavior by rendering all frames with a
start time after the previous frame's start time. The track's duration is still
based on absolute times so things don't blow up.

Differential Revision: https://phabricator.services.mozilla.com/D27267

--HG--
extra : moz-landing-system : lando
2019-04-24 10:55:55 +00:00
Andreas Pehrson fc3f15c331 Bug 1536766 - Assert that time always goes forward in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27265

--HG--
extra : moz-landing-system : lando
2019-04-24 10:55:48 +00:00
Andreas Pehrson cc6262e7c7 Bug 1536766 - Fix a rounding error in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27262

--HG--
extra : moz-landing-system : lando
2019-04-24 10:55:37 +00:00
Andreas Pehrson ee433bc6ed Bug 1536766 - Send a black dummy frame out when a video track that contained no frames ends. r=jya
This is similar to what VideoSink does, and is required for us to end playback
on HAVE_CURRENT_DATA (a frame for currentTime must be available).

Differential Revision: https://phabricator.services.mozilla.com/D27261

--HG--
extra : moz-landing-system : lando
2019-04-24 10:55:35 +00:00
Andreas Pehrson 93d09c009d Bug 1536766 - Follow the video clock when audio ends early in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27260

--HG--
extra : moz-landing-system : lando
2019-04-24 10:53:52 +00:00
Ciure Andrei add7a3fb9e Backed out 14 changesets (bug 1536766) for causing RunWatchdog and mediaElementAudioSource wpt failures CLOSED TREE
Backed out changeset 72d37a08f281 (bug 1536766)
Backed out changeset 63fc85885060 (bug 1536766)
Backed out changeset addbb04415cb (bug 1536766)
Backed out changeset f2923dfcf33c (bug 1536766)
Backed out changeset 25f3a33ec51b (bug 1536766)
Backed out changeset 199efe6aec59 (bug 1536766)
Backed out changeset f9d1f1bfe2b1 (bug 1536766)
Backed out changeset 87616997f160 (bug 1536766)
Backed out changeset 36f99fa3c956 (bug 1536766)
Backed out changeset 000260ba28de (bug 1536766)
Backed out changeset 6386ed1b7d74 (bug 1536766)
Backed out changeset ab27d9f5902a (bug 1536766)
Backed out changeset 4f6d240c210d (bug 1536766)
Backed out changeset 3e0e3030314d (bug 1536766)
2019-04-19 05:55:57 +03:00
Andreas Pehrson 92cc59ab5b Bug 1536766 - End a track only after the graph has reported reaching its end time in DecodedStream. r=jya,padenot
This gives us a guarantee that the first frame of a media file can be rendered
with a second media element and mozCaptureStream(), even if the file is very
very short.

With longer video-only files there were also cases where nothing ended up being
rendered. Probably because the MediaStreamGraph ended up switching from an
AudioCallbackDriver to a SystemClockDriver and this took enough time to put the
SourceMediaStream::EndTrack and the SourceMediaStream::AddTrackListener calls
for this video track to be processed in the same iteration. The listener would
then always lose to the ending track and update main thread state too late,
leading to its media element not rendering any frames and nasty intermittent
failures.

Differential Revision: https://phabricator.services.mozilla.com/D27270

--HG--
extra : moz-landing-system : lando
2019-04-18 15:25:54 +00:00
Andreas Pehrson cdbaaceba1 Bug 1536766 - Better handle overlapping video frames in DecodedStream::SendVideo. r=jya
A case where this wasn't working was bipbop-lateaudio.mp4, where the last frame
has duration 0 and starts and ends before the previous frame has ended. The
VideoSink still renders this frame at the end of playback, so this patch
brings DecodedStream closer to that behavior by rendering all frames with a
start time after the previous frame's start time. The track's duration is still
based on absolute times so things don't blow up.

Differential Revision: https://phabricator.services.mozilla.com/D27267

--HG--
extra : moz-landing-system : lando
2019-04-18 15:24:12 +00:00
Andreas Pehrson a490889c8d Bug 1536766 - Assert that time always goes forward in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27265

--HG--
extra : moz-landing-system : lando
2019-04-18 15:23:57 +00:00
Andreas Pehrson 24bb7e9684 Bug 1536766 - Fix a rounding error in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27262

--HG--
extra : moz-landing-system : lando
2019-04-18 15:27:05 +00:00
Andreas Pehrson 4fd9a5752f Bug 1536766 - Send a black dummy frame out when a video track that contained no frames ends. r=jya
This is similar to what VideoSink does, and is required for us to end playback
on HAVE_CURRENT_DATA (a frame for currentTime must be available).

Differential Revision: https://phabricator.services.mozilla.com/D27261

--HG--
extra : moz-landing-system : lando
2019-04-18 15:23:28 +00:00
Andreas Pehrson 361b4b399b Bug 1536766 - Follow the video clock when audio ends early in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D27260

--HG--
extra : moz-landing-system : lando
2019-04-18 15:23:22 +00:00
Alastor Wu ff87bca9a9 Bug 1540746 - TimeUnitToFrames() should handle the case where the input TimeUnit is overflow. r=jya
If the input has been overflow, we don't need to calculate frames and will directly return invalid result to let caller handle the error.

Differential Revision: https://phabricator.services.mozilla.com/D27010

--HG--
extra : moz-landing-system : lando
2019-04-16 18:22:51 +00:00
arthur.iakab b573fad459 Backed out changeset 6ecaea77b9d5 (bug 1540746) for causing multiple build bustages on CheckedInt.h CLOSED TREE 2019-04-16 20:39:10 +03:00
Alastor Wu 87516ab507 Bug 1540746 - TimeUnitToFrames() should handle the case where the input TimeUnit is overflow. r=jya
If the input has been overflow, we don't need to calculate frames and will directly return invalid result to let caller handle the error.

Differential Revision: https://phabricator.services.mozilla.com/D27010

--HG--
extra : moz-landing-system : lando
2019-04-16 17:19:13 +00:00
Tarek Ziadé 7f4b636f4f Bug 1543032 - Extend metrics for dropped frames - r=padenot
This patch adds the number of dropped frames for each step of the process
(read/sink/compositor) and gives us more insight about where frames are
dropped, as opposed to the getVideoPlaybackQuality() API which gives the grand
total.

Differential Revision: https://phabricator.services.mozilla.com/D27488

--HG--
extra : moz-landing-system : lando
2019-04-16 11:50:38 +00:00
Alastor Wu 68a7ddd191 Bug 1534993 - ensure AudioSink always returning valid position. r=jya
It's possible to overflow when we do the position calculation, we should only store the position which won't cause the integer overflow when adding it to start time.

Differential Revision: https://phabricator.services.mozilla.com/D25340

--HG--
extra : moz-landing-system : lando
2019-04-11 03:38:52 +00:00
Sylvestre Ledru 03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Andreas Pehrson ae7831e5ad Bug 1423253 - Handle MediaDecoder pauses when future frames are already buffered. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D23588

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:51 +00:00
Andreas Pehrson 9c4c12b285 Bug 1423253 - Put DecodedStreamData::mEOSVideoCompensation on the stack. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D23587

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:40 +00:00
Andreas Pehrson e57962eea8 Bug 1423253 - Remove durations from VideoSegment::AppendFrame. r=padenot
VideoSegments still have durations, and they are still needed by the
MediaStreamGraph as it shuffles MediaSegments around.
They do not have a say in the wall-clock duration of video frames however.
Removing this should prevent any producers starting to add video chunks with
durations in the future.

Differential Revision: https://phabricator.services.mozilla.com/D22914

--HG--
extra : moz-landing-system : lando
2019-03-22 11:43:40 +00:00
Andreas Pehrson e0b244ec9e Bug 1506093 - Remove StreamTracksStartTimeStamp. r=padenot
DecodedStream has been basing video timestamps on something called
StreamTracksStartTimeStamp in MediaStreams, which call through all the way
down to the GraphDriver.

This removes the entire timestamp mechanism, except for a bit of legit
usage internally in the SystemClockDriver. Video timestamps are instead
based on the audio clock through GetPosition(), the same way the VideoSink
operates.

Differential Revision: https://phabricator.services.mozilla.com/D22896

--HG--
extra : moz-landing-system : lando
2019-03-22 11:41:46 +00:00
John Lin 758616336e Bug 1533901 - Add profiler markers for VideoSink. r=padenot
Add profiler marker to show when VideoSink sends frames to compositor
and when it discards frames that are outdated according to current
audio position.

Differential Revision: https://phabricator.services.mozilla.com/D22792

--HG--
extra : moz-landing-system : lando
2019-03-20 11:00:06 +00:00
Mike Conley 10393bbf48 Bug 1533099 - Show the most recently decoded image when creating a visual clone of a video that isn't playing. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D22422

--HG--
extra : moz-landing-system : lando
2019-03-18 14:37:24 +00:00
Alex Chronopoulos 59234c63dd Bug 1533612 - Change to unsigned int to avoid integer overflow. r=jya
mProcessedQueueLength is int32_t (wrapped around an Atomic) but it is updated from the method FramesToUsecs() which returns int64_t (wrapped around a CheckedInt) thus it is changed to unsigned int to avoid integer overflow.

Differential Revision: https://phabricator.services.mozilla.com/D22949

--HG--
extra : moz-landing-system : lando
2019-03-14 04:11:39 +00:00
Will Hawkins bfb578d1e9 Bug 1525320: Add config prefs that let us tell media and animated images to paint only the first frame r=jya
Differential Revision: https://phabricator.services.mozilla.com/D21613

--HG--
extra : moz-landing-system : lando
2019-03-13 02:48:38 +00:00
Mike Conley 38db7d8e61 Bug 1521964 - Allow VideoSink to have a secondary VideoFrameContainer assigned to it. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D20022

--HG--
extra : moz-landing-system : lando
2019-03-01 22:36:33 +00:00
Chris Pearce 883206cfcc Bug 1529738 - Add profiler markers for video frames dropped due to slow video decode. r=jya,mstange
Differential Revision: https://phabricator.services.mozilla.com/D20760

--HG--
extra : moz-landing-system : lando
2019-02-28 20:10:17 +00:00
Jean-Yves Avenard 4377bd3b8b Bug 1524890 - P11. Remove duration from AudioData construction parameter. r=bryce
It can be determined from the size of the buffer and the number of audio frames. Additionally, it ensures that the duration of the frame is always exactly what the AudioData contains.

Differential Revision: https://phabricator.services.mozilla.com/D20170

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:47 +00:00
Jean-Yves Avenard ca21a59533 Bug 1524890 - P10. Add AudioData::SetTrimWindow. r=bryce
Don't re-create a new trimmed AudioData when we want to remove some content. This remove the need for some copies.

Differential Revision: https://phabricator.services.mozilla.com/D20168

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:32 +00:00
Jean-Yves Avenard 7f3801ebd7 Bug 1524890 - P8. Rely on buffer length to calculate the number of frames. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D20166

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:00 +00:00
Jean-Yves Avenard 3cf8c6d0df Bug 1524890 - P7. No longer access AudioData::mFrames directly. r=bryce
This will allow to remove mFrames member and calculate from the size of the content, which will dynamically change depending on a cropping filter.

Differential Revision: https://phabricator.services.mozilla.com/D20165

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:47 +00:00
Jean-Yves Avenard 1f5dfb6d37 Bug 1524890 - P4. Use Span<> with AudioBufferCursor. r=bryce
And we add some strong assertions that we never read passed the end of the buffer.

Differential Revision: https://phabricator.services.mozilla.com/D20162

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:05 +00:00
Jean-Yves Avenard afe04d2952 Bug 1524890 - P3. Add AudioData::Data method that returns a Span. r=bryce
So that we never access the underlying buffer directly.

Differential Revision: https://phabricator.services.mozilla.com/D20161

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:04 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Noemi Erli 3c06305cb1 Backed out changeset 849f81f21979 (bug 1515549) per achronop's request a=backout 2019-01-11 22:04:58 +02:00
Alex Chronopoulos 96cd8b2f6a Bug 1515549 - Avoid resetting volume in every AudioSink restart in case volume has changed outside firefox. r=jya
Avoid resetting volume in every AudioSink restart to stop unexpected volume change during play/pause and seek. Volume changes could occur if the volume has been modified outside firefox (for example pavucontrol in Linux).

Differential Revision: https://phabricator.services.mozilla.com/D15210

--HG--
extra : moz-landing-system : lando
2019-01-10 11:24:29 +00:00
Andreas Pehrson cb8996408e Bug 1512958 - Properly clean up produced tracks in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D14584

--HG--
extra : source : 74101900e7d484cc9ddcba2cd867ca172b961ea0
2018-12-21 16:23:57 +00:00
Coroiu Cristina 0215638358 Backed out 2 changesets (bug 1512958) for frequently failing mda at /dom/media/MediaDecoderStateMachine.cpp a=backout
Backed out changeset 74101900e7d4 (bug 1512958)
Backed out changeset 1d4816ef6e01 (bug 1512958)
2018-12-22 06:14:56 +02:00
Andreas Pehrson 8567b073f3 Bug 1512958 - Properly clean up produced tracks in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D14584

--HG--
extra : moz-landing-system : lando
2018-12-21 16:23:57 +00:00
Andreas Pehrson 88cb071d63 Bug 1513638 - Rename DispatchToMainThreadAfterStreamStateUpdate to DispatchToMainThreadStableState. r=jya,karlt
Differential Revision: https://phabricator.services.mozilla.com/D14421

--HG--
extra : moz-landing-system : lando
2018-12-19 04:34:10 +00:00
Jean-Yves Avenard cf0ff88211 Bug 1512456 - P1. Don't use GenericPromise with MediaSink. r=alwu
The VideoSink shares the AudioSink's own EndedPromise to notify its user that it has ended. As such, the MozPromise used must be non-exclusive.
Using the GenericPromise for such purpose only hid that requirement.

We also remove the MediaSink from the media namespace, and clarify the naming of some arguments and class members to accurately describe what they do.

Differential Revision: https://phabricator.services.mozilla.com/D14024

--HG--
extra : moz-landing-system : lando
2018-12-11 10:44:51 +00:00
Andreas Pehrson 3410ec9f28 Bug 1509548 - Clean up what appears to be wip-leftover gunk in DecodedStream. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D12926

--HG--
extra : moz-landing-system : lando
2018-11-29 17:37:21 +00:00
Andreas Pehrson a02fa011f0 Bug 1509548 - Remove the concept of a known tracks time from MediaStreamGraph. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D12923

--HG--
extra : moz-landing-system : lando
2018-11-29 17:37:06 +00:00