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

384 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot 55b9625c87 Bug 1659244 - Allow processing planar audio in the AudibilityMonitor. r=pehrsons
This is essentially the same code as the interleaved version, but backwards,
since the memory layout is the opposite, we want to take advantage of memory
locality, and only touch audio samples once each.

The `ProcessAudioData` method has been renamed, because of the similarity
between the `AudioData` type and `ProcessAudioData`, since it can now process
`AudioBlock`s.

Differential Revision: https://phabricator.services.mozilla.com/D90431
2020-09-23 11:45:44 +00:00
Razvan Maries 655ae40b05 Backed out 7 changesets (bug 1659244) for DestinationNodeEngine related crashes. CLOSED TREE
Backed out changeset 50d7aabc075e (bug 1659244)
Backed out changeset da3af45b9195 (bug 1659244)
Backed out changeset 9e748be643e7 (bug 1659244)
Backed out changeset 47a5552dece7 (bug 1659244)
Backed out changeset 9c362f616f93 (bug 1659244)
Backed out changeset 4f1c72021ec9 (bug 1659244)
Backed out changeset 90f3b8edbd8b (bug 1659244)
2020-09-22 18:54:47 +03:00
Paul Adenot d1415f98f6 Bug 1659244 - Allow processing planar audio in the AudibilityMonitor. r=pehrsons
This is essentially the same code as the interleaved version, but backwards,
since the memory layout is the opposite, we want to take advantage of memory
locality, and only touch audio samples once each.

The `ProcessAudioData` method has been renamed, because of the similarity
between the `AudioData` type and `ProcessAudioData`, since it can now process
`AudioBlock`s.

Differential Revision: https://phabricator.services.mozilla.com/D90431
2020-09-21 17:40:45 +00:00
Paul Adenot f94544f988 Bug 1662805 - Make the silence duration before a tab is considered inaudible configurable. r=pehrsons
Depends on D89635

Differential Revision: https://phabricator.services.mozilla.com/D89636
2020-09-15 09:01:16 +00:00
Paul Adenot 2f461c2326 Bug 1662805 - Replace instantaneous audibility decisions for MediaStream and regular playback with the AudibilityMonitor. r=pehrsons
Depends on D89634

Differential Revision: https://phabricator.services.mozilla.com/D89635
2020-09-15 09:00:57 +00:00
Paul Adenot 1db6a3923f Bug 1662805 - Extract the sample-rate decision for an AudioSink to its own function, in the same way it is done for the channel count. r=pehrsons
Depends on D89633

Differential Revision: https://phabricator.services.mozilla.com/D89634
2020-09-15 09:00:33 +00:00
Cristina Coroiu d85babf17b Backed out 5 changesets (bug 1662805) for multiple failures, e.g. bc failures at dom/media/mediacontrol/tests/browser_media_control_non_eligible_media.js on a CLOSED TREE
Backed out changeset 820eb655de3d (bug 1662805)
Backed out changeset 23c90dd335b1 (bug 1662805)
Backed out changeset eff66444dc68 (bug 1662805)
Backed out changeset caeffea29d80 (bug 1662805)
Backed out changeset 2f8f9799d1f3 (bug 1662805)
2020-09-14 14:44:34 +03:00
Paul Adenot 3ca6ba96da Bug 1662805 - Make the silence duration before a tab is considered inaudible configurable. r=pehrsons
Depends on D89635

Differential Revision: https://phabricator.services.mozilla.com/D89636
2020-09-14 09:42:31 +00:00
Paul Adenot f07e869482 Bug 1662805 - Replace instantaneous audibility decisions for MediaStream and regular playback with the AudibilityMonitor. r=pehrsons
Depends on D89634

Differential Revision: https://phabricator.services.mozilla.com/D89635
2020-09-14 09:41:26 +00:00
Paul Adenot 86f7c4ac6f Bug 1662805 - Extract the sample-rate decision for an AudioSink to its own function, in the same way it is done for the channel count. r=pehrsons
Depends on D89633

Differential Revision: https://phabricator.services.mozilla.com/D89634
2020-09-14 09:40:54 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Gerald Squelart 013846f716 Bug 1659382 - Rename AudioSink.cpp's PROFILER_MARKER to PROFILER_AUDIO_MARKER - r=gregtatum
I want to use `PROFILER_MARKER` in the new C++ marker APIs, so I'm renaming this single (recent) use to something else.

Differential Revision: https://phabricator.services.mozilla.com/D87240
2020-08-24 08:39:26 +00:00
Alex Chronopoulos 4c1d0136c9 Bug 1584959 - Avoid calling the converter if the conversion is not possible. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D56736
2020-06-18 15:50:03 +00:00
alwu 889760fd05 Bug 1641154 - fix macro error. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D77115
2020-05-27 17:49:56 +00:00
alwu e55212e5f4 Bug 1612557 - part5 : use `MediaSampleMarkerPayload` in VideoSink. r=jolin
This patch will do :
- use `MediaSampleMarkerPayload` to replace `VideoFrameMarkerPayload`

The advantage of doing so :
- after finishing a support for `MediaSampleMarkerPayload` in profiler front-end side, we can show the sample's start and end time when hovering on the marker icon.

Differential Revision: https://phabricator.services.mozilla.com/D75469
2020-05-15 23:51:14 +00:00
alwu fd606724bc Bug 1612557 - part4 : use `Media` category for markers r=bryce,gerald,canaltinova
This patch will do :
- add `Media` markers in related codes
- implement `MediaSampleMarkerPayload` to record the media sample

The advantage of doing so :
- using markers can help us know what happens on the media by a glance without expanding the call stack
- adding sample markers allows us compare the speed of decoding sample in `MediaDecoderStataMachine` and rendering sample in `VideoSink`

Differential Revision: https://phabricator.services.mozilla.com/D74174
2020-05-16 19:58:25 +00:00
alwu 8dda6be6ef Bug 1612557 - part1 : create a profiling category `Media`. r=bryce,gerald
This patch will do :
- create a profiling category `Media`
- add  `Media` profiling labels in related codes

The advantage of doing so :
- allow us to easily see what operations are related to media playback from the profiled report

More details :
According to the description in the `ProfilingCategory.h`, `topmost profiler label frame in the label stack determines the category pair of that stack`. Therefore, most labels I added are the first task would run on the thread, in order to ensure all its following tasks can be marked as the media playback label as well.

Differential Revision: https://phabricator.services.mozilla.com/D74171
2020-05-12 17:35:19 +00:00
Simon Giesecke f7f5462a4b Bug 1626570 - Improve handling of copying arrays in dom/media/. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D73627
2020-05-05 11:38:10 +00:00
alwu 7e16a99879 Bug 1627818 - part1 : allow DecodedStream to notify audible state change. r=padenot
`AudioSink` provides a way to let us know if the media data is audible, and we should do the same thing for the `DecodedStream`, in order to update the correct audible state.

Differential Revision: https://phabricator.services.mozilla.com/D70259
2020-04-17 18:10:22 +00:00
Andreas Farre f2fa2e633c Bug 1620594 - Part 5: Use GetMainThreadSerialEventTarget instead of SystemGroup::EventTargetFor. r=nika
This patch also tries to remove the event target entirely if it would
default to the main thread on a null event target.

Depends on D67634

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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:07 +00:00
Gerald Squelart bc32add109 Bug 1622179 - Replace direct dependencies on BlocksRingBuffer with ProfileBufferEntryWriter's where possible - r=canaltinova
This removes most dependencies on BlocksRingBuffer, to ease the transition to
the upcoming Fission-friendly profile buffer, including:
- Length type,
- SumBytes(),
- Gecko extensions of serialization.

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

--HG--
rename : tools/profiler/public/BlocksRingBufferGeckoExtensions.h => tools/profiler/public/ProfileBufferEntrySerializationGeckoExtensions.h
extra : moz-landing-system : lando
2020-03-16 20:32:35 +00:00
Gerald Squelart 9e0576b94c Bug 1620515 - Replace BlocksRingBuffer::EntryReader/Writer with ProfileBufferEntryReader/Writer - r=canaltinova
The new ProfileBufferEntryReader/Writer are now used everywhere, including in
the profilers and tests.
The old EntryReader/Writer have been removed.

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

--HG--
extra : moz-landing-system : lando
2020-03-11 21:59:19 +00:00
Simon Giesecke 88ead5d627 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/media. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D65178

--HG--
extra : moz-landing-system : lando
2020-03-04 15:39:20 +00:00
Alex Chronopoulos 1d184960b3 Bug 1571513 - Setup PrincipalHandle and Playing listener of a DecodedStream in the start. r=alwu
`mPrincipalHandle` and `mPlaying` listeners were being connected in the ctor of a DecodedStream. However, this is not necessary because their attributes will only be modified after the sink start. In addition to that, it was causing problems if a sink was replaced before being started or stopped (and shutdown). This is a valid scenario, though, that we need to support.

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

--HG--
extra : moz-landing-system : lando
2020-02-24 17:46:31 +00:00
Andreas Pehrson 9c1206334a Bug 1198168 - Since we're now checking the end time of the last chunk, make it inclusive. r=padenot
Bug 1600063 changed the chunk-dropping logic from dropping when we had *started*
playing a chunk, to when we had *finished* playing a chunk -- i.e., started
playing the next chunk.

But when a chunk is the very last chunk in the media resource, we cannot start
playing the next chunk, because there is no next chunk. Making this check
inclusive seems reasonable.

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

--HG--
extra : moz-landing-system : lando
2019-12-17 15:51:49 +00:00
Jon Bauman f57c5ad7ab Bug 1443511 - Apply HTMLMediaElement volume to currently playing audio segments. r=pehrsons
Rather than applying the volume change to the DecodedStream, which won't be
played until the buffer catches up, instead apply the volume to the segments
as they are consumed by the MediaTrackGraph.

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

--HG--
extra : moz-landing-system : lando
2019-12-12 23:41:13 +00:00
Andreas Pehrson 465815e45e Bug 1600063 - Add some logging for DecodedStream. r=padenot
Depends on D55981

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

--HG--
extra : moz-landing-system : lando
2019-12-10 17:19:58 +00:00
Andreas Pehrson b44898260c Bug 1600063 - Clear future data when the DecodedStream mediasink stops playing. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D55981

--HG--
extra : moz-landing-system : lando
2019-12-10 17:22:18 +00:00
alwu 1d93afb4e6 Bug 1593843 - part2 : fix build problem under unified build. r=bryce
As we added new files, which affects the build bundle created by unified build. Therefore, add missing scope definition and included header to pass the build.

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

--HG--
extra : moz-landing-system : lando
2019-11-25 11:00:12 +00:00
Noemi Erli 23395b20e2 Backed out 13 changesets (bug 1593843) for bustages in Logging.h CLOSED TREE
Backed out changeset b6e3fa6363bd (bug 1593843)
Backed out changeset 3db512256b0d (bug 1593843)
Backed out changeset f67081ea84ee (bug 1593843)
Backed out changeset ad02bb934459 (bug 1593843)
Backed out changeset 1a79176d3f7b (bug 1593843)
Backed out changeset 486c8562b816 (bug 1593843)
Backed out changeset 0d4313c436c5 (bug 1593843)
Backed out changeset 0c7e831d11bf (bug 1593843)
Backed out changeset 02ac8c39f46d (bug 1593843)
Backed out changeset 80895462dddf (bug 1593843)
Backed out changeset 4ab855869725 (bug 1593843)
Backed out changeset 5a24fc933cd6 (bug 1593843)
Backed out changeset f1c50ee60a78 (bug 1593843)
2019-11-23 05:18:17 +02:00
alwu 4abf12bb60 Bug 1593843 - part2 : fix build problem under unified build. r=bryce
As we added new files, which affects the build bundle created by unified build. Therefore, add missing scope definition and included header to pass the build.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 09:17:35 +00:00
Andreas Pehrson 78c9444d74 Bug 1536156 - Make VideoFrameContainer::ClearFutureFrames keep the current frame instead of the first frame. r=padenot
Depends on D54117

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

--HG--
extra : moz-landing-system : lando
2019-11-22 15:48:06 +00:00
Andreas Pehrson 0e8f3eae51 Bug 1536156 - Clear future frames when VideoSink is finished. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D54117

--HG--
extra : moz-landing-system : lando
2019-11-22 15:02:27 +00:00
Andreas Pehrson f80cfacedb Bug 1536156 - Simplify setting the current frame in the secondary video container. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D53733

--HG--
extra : moz-landing-system : lando
2019-11-22 12:52:48 +00:00
Andreas Pehrson e19d00c349 Bug 1536156 - Remove unused MediaSink::ClearSecondaryVideoContainer. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D53731

--HG--
extra : moz-landing-system : lando
2019-11-22 12:52:47 +00:00
Daniel Varga af05b317ec Backed out 7 changesets (bug 1597216, bug 1596777, bug 1536156) for reftest failures at reftest/bipbop_300_215kbps.mp4.lastframe.htm. On a CLOSED TREE
Backed out changeset a3fa99d936f3 (bug 1536156)
Backed out changeset 29dd64930421 (bug 1536156)
Backed out changeset 77c16444e714 (bug 1536156)
Backed out changeset d540f1802ff6 (bug 1536156)
Backed out changeset 8283eed414d2 (bug 1536156)
Backed out changeset 01d2c84810f0 (bug 1597216)
Backed out changeset e0184916cf37 (bug 1596777)
2019-11-22 01:58:42 +02:00
Andreas Pehrson 391dbe5d1b Bug 1536156 - Clear future frames when VideoSink is finished. r=padenot
Depends on D53832

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

--HG--
extra : moz-landing-system : lando
2019-11-21 12:41:06 +00:00
Andreas Pehrson 6dcf422797 Bug 1536156 - Simplify setting the current frame in the secondary video container. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D53733

--HG--
extra : moz-landing-system : lando
2019-11-20 21:51:48 +00:00
Andreas Pehrson 4537fe005f Bug 1536156 - Remove unused MediaSink::ClearSecondaryVideoContainer. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D53731

--HG--
extra : moz-landing-system : lando
2019-11-20 21:51:48 +00:00
Andreas Pehrson 1ff3c4e4b9 Bug 1585570 - Only create promises if we decide to create DecodedStreamData. r=padenot
Prior to this patch, promises were always created. Since bug 1172394, creating
DecodedStreamData is conditional on whether the appropriate output tracks are
available. If promises are created and output tracks are *not* available, the
promises would never be resolved or rejected, and would assert on destruction.

This patch makes it so promises are only created if we create DecodedStreamData,
hence only when output tracks are available and the promises are guaranteed to
be resolved or rejected at some point.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 13:56:38 +00:00
Andreas Pehrson dbaeed36a9 Bug 1172394 - Simplify MediaSink somewhat. r=padenot
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.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 22:40:05 +00:00
Andreas Pehrson 7800d98a51 Bug 1172394 - Refactor how DecodedStream is set up. r=padenot
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.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 22:40:07 +00:00
Andreas Pehrson 8537128686 Bug 1172394 - Perform some forgotten Stream -> Track renaming in DecodedStream. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D52036

--HG--
extra : moz-landing-system : lando
2019-11-13 22:39:48 +00:00
Csoregi Natalia 6ba30843e8 Backed out 15 changesets (bug 1500049, bug 1172394, bug 1546756, bug 1302379) for failures on browser_disabledForMediaStreamVideos.js. CLOSED TREE
Backed out changeset 355f090421a6 (bug 1500049)
Backed out changeset 306341d0b586 (bug 1302379)
Backed out changeset 3ff0d72d23a2 (bug 1546756)
Backed out changeset a4f256e68cef (bug 1172394)
Backed out changeset d0aa43657e8c (bug 1172394)
Backed out changeset edff95b6f724 (bug 1172394)
Backed out changeset 94bd21d9b396 (bug 1172394)
Backed out changeset 7e7baa73e1ef (bug 1172394)
Backed out changeset c3bd415507e8 (bug 1172394)
Backed out changeset 1c45b135318d (bug 1172394)
Backed out changeset c57c41e8c39e (bug 1172394)
Backed out changeset a796541fe5ef (bug 1172394)
Backed out changeset 89ad0b553b0f (bug 1172394)
Backed out changeset 744fb77a5833 (bug 1172394)
Backed out changeset afb4b226ff04 (bug 1172394)
2019-11-14 00:32:51 +02:00
Andreas Pehrson 82611c9705 Bug 1172394 - Simplify MediaSink somewhat. r=padenot
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.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 08:55:54 +00:00
Andreas Pehrson 53d52cde4e Bug 1172394 - Refactor how DecodedStream is set up. r=padenot
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.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 08:55:39 +00:00
Andreas Pehrson baa9f1296f Bug 1172394 - Perform some forgotten Stream -> Track renaming in DecodedStream. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D52036

--HG--
extra : moz-landing-system : lando
2019-11-13 08:47:48 +00:00
Jim Porter 9354dfda4a Bug 1557447 - Profiler support for IPC information; r=nika,smaug
This adds the ability to add profile markers for both the sender and recipient
sides of IPC messages. These can then be correlated with one another in the
profile visualization. For the UI component of this patch, see
<https://github.com/firefox-devtools/profiler/pull/2172>.

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

--HG--
extra : moz-landing-system : lando
2019-10-21 20:51:07 +00:00
Daniel Varga 8fdca46bc7 Backed out changeset 2923afce519a (bug 1557447) for browser chrome failure at tools/profiler/tests/browser/browser_test_feature_preferencereads.js. On a CLOSED TREE 2019-10-18 07:54:09 +03:00
Jim Porter 80bfcd6e57 Bug 1557447 - Profiler support for IPC information; r=nika
This adds the ability to add profile markers for both the sender and recipient
sides of IPC messages. These can then be correlated with one another in the
profile visualization. For the UI component of this patch, see
<https://github.com/firefox-devtools/profiler/pull/2172>.

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

--HG--
extra : moz-landing-system : lando
2019-10-18 02:56:02 +00:00