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

496 Коммитов

Автор SHA1 Сообщение Дата
Lee Salzman a664a6d305 Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 07:48:53 +00:00
Paul Adenot b37e1d497b Bug 1754495 - Don't use the audio clock to determine if an AudioStream is low on decoded audio. r=alwu
The old technique was slightly misleading. It was counting the audio already
sent to the device, in the decoded audio duration. But in fact, there's nothing
that can be done about this, the audio is going to be played regardless of what
happens. If the audio latency is high enough, this would return a number that's
high, but not a lot of audio would be sitting in Firefox's buffer, ready to
service the audio callbacks.

It's best to only consider the decoded audio (processed + unprocessed) here,
since the goal of this is to determine whether more audio needs to be decoded.
It also saves a `cubeb_stream_get_position` IPC call if using AudioIPC (soon to
be all platforms).

Differential Revision: https://phabricator.services.mozilla.com/D138318
2022-02-14 16:42:25 +00:00
Paul Adenot aa56e84f57 Bug 1754006 - Add profiler markers in push/pop operations on the AudioSink ring buffer. r=alwu
Depends on D138028

Differential Revision: https://phabricator.services.mozilla.com/D138048
2022-02-11 16:58:52 +00:00
Paul Adenot 0630b647a3 Bug 1754006 - Increase the processed media queue size and threshold in AudioSink. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D138028
2022-02-11 16:58:51 +00:00
Narcis Beleuzu 0541c7f30f Backed out 2 changesets (bug 1754006) for mda failures on test_bug1113600.html CLOSED TREE
Backed out changeset f22af4b15704 (bug 1754006)
Backed out changeset 078521a5c82b (bug 1754006)
2022-02-08 21:14:53 +02:00
Paul Adenot b679353753 Bug 1754006 - Add profiler markers in push/pop operations on the AudioSink ring buffer. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D138048
2022-02-08 16:07:44 +00:00
Paul Adenot 7a98b07c0b Bug 1754006 - Increase the processed media queue size and threshold in AudioSink. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D138028
2022-02-08 16:07:43 +00:00
Paul Adenot 2fb2f00a62 Bug 1752345 - Reset SPSC queue thread ids when the underlying audio callback thread changes. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D137668
2022-02-03 15:18:14 +00:00
Paul Adenot df795cf097 Bug 1752345 - Communicate the audio frames to the audio thread with a wait-free queue. r=alwu,media-playback-reviewers
The queue directly contains the audio frames, not packets. We'll be able to tune
its size later. `AudioSink::PopFrames` pull from the queue, and is called in the
audio callback. The decoded frame refill logic is adjusted to be simpler.

Signaling the event to refill still takes a lock, that's going to be fixed later.

Ended(), the second member of the interface, is switched to using an atomic.

After this patch, the audio callback doesn't need to take the AudioStream lock.

Differential Revision: https://phabricator.services.mozilla.com/D137303
2022-02-03 15:18:13 +00:00
Paul Adenot 05e420b119 Bug 1752345 - Make AudioStream::mOutChannel const. r=alwu,media-playback-reviewers
This makes it clear that it's safe to access it from any thread.

Differential Revision: https://phabricator.services.mozilla.com/D137183
2022-02-03 15:18:13 +00:00
Paul Adenot b980ff2250 Bug 1630569 - Change the limit at which audio is muted with high or low playback rates, and make it and other parameters configurable via prefs. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D135066
2022-01-05 18:11:58 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Gerald Squelart 5399574d8b Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Cristian Tuns 1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart 7fa084ae7c Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00
Gerald Squelart df50ece611 Bug 1735697 - Remove profiler_can_accept_markers(), use profiler_thread_is_being_profiled() instead - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D128577
2021-10-18 23:11:30 +00:00
Paul Adenot cd9af3411c Bug 1724997 - Add tracing markers for more MediaTrackGraph events. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D122739
2021-08-26 09:15:40 +00:00
Andi-Bogdan Postelnicu 75ed803f7c Bug 1725145 - fixes for linking in the hybrid build env. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D122344
2021-08-22 10:21:56 +00:00
Florian Quèze ca7bbcc752 Bug 1720374 - Remove MOZ_GECKO_PROFILER ifdefs that are not useful, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119810
2021-07-15 22:04:23 +00:00
alwu 1ecb5dfaf2 Bug 1517199 - part5 : handle the playback rate change on video track and add crash test. r=padenot
When we adjust the playback rate on the audio track, the audio clock time would be no longer align with the graph time.

Eg. playback rate=2, when the graph time passes 10s, the audio clock time actually already goes forward 20s.

After audio track ended, the video track would start to drive the clock time but the video clock time is align with the graph time, which means it would be smaller than the audio clock in that situation.

Therefore, we have to ignore the video clock time in that case. In addition, this patch also address the duration change on video frames based on the playback rate.

Differential Revision: https://phabricator.services.mozilla.com/D115035
2021-06-02 16:39:02 +00:00
alwu b9d1fb014e Bug 1517199 - part4 : add gtest. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D114922
2021-06-02 16:39:02 +00:00
alwu b1e6b39bc3 Bug 1517199 - part3 : add more logs. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D114921
2021-06-02 16:39:02 +00:00
alwu f18229c7fc Bug 1517199 - part1 : time stretching samples in AudioDecoderInputTrack. r=padenot
By using the soundtouch library, this patch implements the time stretching on the samples in AudioDecoderInputTrack when its playback rate is not 1.0f, in order to support changing playback rate on the captured media stream.

As the time stretcher has to be initialized by a fixed channel count, we would perform a realtime up-mix/down-mix for those audio chunks which have different channel count thant AudioDecoderInputTrack's initial channel count.

Differential Revision: https://phabricator.services.mozilla.com/D114560
2021-06-02 16:39:01 +00:00
alwu 88ff5a6b27 Bug 1712598 - part1 : fill silence if detecting a gap in audio. r=padenot
If there is a gap bewteen the audio that is going to be appended next and the amount of frames that we've appended, then we need to fill silence data in order to keep A/V sync correct.

We did that for the DecodedStream [1] before, but that got removed during the refactoring.

[1] https://searchfox.org/mozilla-central/rev/36181d2c169bafd5e13c534851c8b25d1567cfc3/dom/media/mediasink/DecodedStream.cpp#660-667

Differential Revision: https://phabricator.services.mozilla.com/D115857
2021-05-28 19:11:19 +00:00
alwu 07724ed21f Bug 1712595 - ensure AudioSink won't discard frames that are not played yet. r=padenot
When we switch to the DecodedStream from AudioSink. AudioSink would store some frames in its own media queue before those audio frames get played. After AudioSink got shutdown, it doesn't push those frames back to the original audio queue.

Therefore, when DecodedStream starts, it try to retrieve audio data from the audio queue, but it doesn't know that there is already a gap between "the audio DecodedStream is going to play" and "the audio that AudioSink had played".

Differential Revision: https://phabricator.services.mozilla.com/D115749
2021-05-28 19:11:18 +00:00
alwu 749abc0457 Bug 1709899 - batch all data together when appending data to 'AudioDecoderInputTrack' to further ensure the free spaces in SPSC queue. r=padenot.
Differential Revision: https://phabricator.services.mozilla.com/D114559
2021-05-10 22:18:26 +00:00
alwu f73f4cee55 Bug 1709130 - part1 : extend the SPSC queue's capacity for AudioDecoderInputTrack. r=padenot
In the initial implementation, we only used 20 capacity for SPSC queue and added some mechanisms (batched data to save the free space of SPSC queue/clean SPSC queue in each graph iteration) to prevent it from being full.

But that seems not working in some extreme cases where decoding is too fast and the graph thread can't catch up the speef of processing the input. So extend the queue size to 40 that should allow SPSC to work without being full again.

Differential Revision: https://phabricator.services.mozilla.com/D114150
2021-05-05 16:50:33 +00:00
alwu 35f3dc0dc8 Bug 1708700 - only access 'mData' when it's not null. r=padenot
Depends on D114015

Differential Revision: https://phabricator.services.mozilla.com/D114018
2021-05-03 16:30:45 +00:00
alwu b59c5d9bff Bug 1708536 - prevent accessing null 'mData'. r=padenot
Depends on D113823

Differential Revision: https://phabricator.services.mozilla.com/D113855
2021-04-30 12:38:06 +00:00
alwu 8059f71c85 Bug 1708433 - add 'unused' for the result used for assertion. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D113823
2021-04-30 12:38:05 +00:00
alwu 8c05db26df Bug 1708454 - add missing include header. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D113822
2021-04-30 12:38:05 +00:00
alwu e9feafd386 Bug 1695265 - part3 : add gtest for 'AudioDecoderInputTrack'. r=pehrsons,padenot
Differential Revision: https://phabricator.services.mozilla.com/D110503
2021-04-29 01:37:21 +00:00
alwu 2a0a994112 Bug 1695265 - part2 : use `AudioDecoderInputTrack` for audio in `DecodedStream`. r=pehrsons
Change the audio track from `SourceMediaTrack` to `AudioDecoderInputTrack`, which allows us to use a pull-based stream track in DecodedStream.

Also a pre-requirement before we start implementing supporting playback rate change on a track captured from the media element.

Differential Revision: https://phabricator.services.mozilla.com/D106042
2021-04-29 01:37:20 +00:00
alwu 36181d2c16 Bug 1695265 - part1 : implement AudioDecoderInputTrack. r=pehrsons
This patch implements a new track `AudioDecoderInputTrack` which inherits from `ProcessedMediaTrack` and is a pull-based media stream track.

This track would be used for receiving audio decoded data and will support changing playback rate in the future (not yet, will be done in Bug 1517199).

Differential Revision: https://phabricator.services.mozilla.com/D106040
2021-04-29 01:37:20 +00:00
Brindusan Cristian 2c692937aa Backed out 3 changesets (bug 1695265) for causing crashtest assertion failures. CLOSED TREE
Backed out changeset 7d2f645a1dc4 (bug 1695265)
Backed out changeset 35cb5f5e17b7 (bug 1695265)
Backed out changeset 52861f76787f (bug 1695265)
2021-04-28 22:29:29 +03:00
alwu d056a883d6 Bug 1695265 - part3 : add gtest for 'AudioDecoderInputTrack'. r=pehrsons,padenot
Differential Revision: https://phabricator.services.mozilla.com/D110503
2021-04-28 16:50:50 +00:00
alwu ae294b8a9e Bug 1695265 - part2 : use `AudioDecoderInputTrack` for audio in `DecodedStream`. r=pehrsons
Change the audio track from `SourceMediaTrack` to `AudioDecoderInputTrack`, which allows us to use a pull-based stream track in DecodedStream.

Also a pre-requirement before we start implementing supporting playback rate change on a track captured from the media element.

Differential Revision: https://phabricator.services.mozilla.com/D106042
2021-04-28 16:50:49 +00:00
alwu 43009c717f Bug 1695265 - part1 : implement AudioDecoderInputTrack. r=pehrsons
This patch implements a new track `AudioDecoderInputTrack` which inherits from `ProcessedMediaTrack` and is a pull-based media stream track.

This track would be used for receiving audio decoded data and will support changing playback rate in the future (not yet, will be done in Bug 1517199).

Differential Revision: https://phabricator.services.mozilla.com/D106040
2021-04-28 16:50:49 +00:00
alwu 18962da886 Bug 1706747 - make AudioSink's start time exactly same as the start time of AudioSinkWrapper. r=bryce.
AudioSink's`mStartTime` [1] represents the time when the MediaSink starts.

Currently that is initialized by calling `GetMediaTime()` [2], but we should better let the time explicitly equal to the start time of the media sink [3] (they're currently equal, but not easy to notice that by just looking the code).

So we should let AudioSinkWrapper to pass the start time to AudioSink in order to make the invariant clearer, which is that AudioSinkWrapper and AudioSink should be guaranteed having the same start time.

[1] https://searchfox.org/mozilla-central/rev/08013752b4638f01d41d2a38ca7bd741bc572c86/dom/media/mediasink/AudioSink.h#93
[2] https://searchfox.org/mozilla-central/rev/08013752b4638f01d41d2a38ca7bd741bc572c86/dom/media/MediaDecoderStateMachine.cpp#2831
[3] https://searchfox.org/mozilla-central/rev/08013752b4638f01d41d2a38ca7bd741bc572c86/dom/media/MediaDecoderStateMachine.cpp#3388

Differential Revision: https://phabricator.services.mozilla.com/D113016
2021-04-26 18:44:30 +00:00
Brendan Early 11d4046786 Bug 1120222 - Set AudioSink name to title of MediaElement's parent r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D93462
2021-04-19 15:17:26 +00:00
alwu 73ec85076f Bug 1699772 - add profiler markers and labels in 'DecodedStream'. r=pehrsons,gerald
Differential Revision: https://phabricator.services.mozilla.com/D109099
2021-04-07 06:15:22 +00:00
Simon Giesecke a598a0c7c5 Bug 1679522 - Use <> style for including windows system headers. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98895
2021-03-25 10:19:44 +00:00
Gerald Squelart 2416d881e2 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
Bryce Seager van Dyk c2d4dcad38 Bug 1673525 - Don't try and process audio with no frames in DecodedStream. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D100400
2021-01-11 20:24:03 +00:00
Andreas Pehrson 1df5aff0c0 Bug 1601799 - Use a SharedDummyTrack for graph access in DecodedStream. r=karlt
When enabling our MediaTrack implementation (which we don't plan to by default,
NB) and disabling all audio tracks and unselecting all video tracks while having
an active captureStream leads to having no output tracks in DecodedStream.

In this case, DecodedStream doesn't know which graph to use for creating the
intermediary tracks it feeds data to. We don't want to resort to the default
graph either, since two graphs on different clocks could then race each other.

With this patch we plumb down a SharedDummyTrack from the media element where
the captureStream was triggered, through MediaDecoder, to DecodedStream. The
SharedDummyTrack guarantees to keep the graph alive, and holds the graph used
for the output tracks.

Differential Revision: https://phabricator.services.mozilla.com/D99822
2021-01-05 07:43:34 +00:00
Andreas Pehrson a37786a190 Bug 1601799 - Allow running DecodedStream without output tracks. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D99821
2021-01-04 14:35:09 +00:00
Oleg Skoromnik 7f10fee971 Bug 1684655 - Remove unused parameters left after Bug 1443511. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D100625
2021-01-04 12:25:16 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Gerald Squelart c3d6e979a5 Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-18 21:49:52 +00:00
Razvan Maries b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
Gerald Squelart 6462c5154d Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-17 22:19:06 +00:00
Mihai Alexandru Michis c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00
Gerald Squelart 4075cd5ed6 Bug 1675409 - Migrated MediaSampleMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96043
2020-11-17 11:33:48 +00:00
alwu f798106d65 Bug 1676551 - part1 : handle rejected promise when fail to start the audio sink. r=padenot
In the change from bug1674597, AudioSinkWrapper only handles the promise when we succeed opening AudioSink. However, it forgots to handle the promise when fail to start AudioSink.

Differential Revision: https://phabricator.services.mozilla.com/D96738
2020-11-13 16:10:15 +00:00
alwu 256a71d377 Bug 1674597 - part2 : refactor `AudioSinkWrapper::Start` in order to remove unnecessary indentation. r=padenot
Having an early return in an inner if section isn't a good thing, re-arrange them in order to move it out.

Differential Revision: https://phabricator.services.mozilla.com/D96469
2020-11-10 18:53:47 +00:00
alwu fed2b07c52 Bug 1674597 - part1 : let audio stream to manage the ended promise for playback. r=padenot
Audio stream is the class which really know about whether the audio playback is completed or not. So it makes more sense to let it return and manage the promise for playback end, not audio sink.

Differential Revision: https://phabricator.services.mozilla.com/D96468
2020-11-10 19:05:10 +00:00
Andi-Bogdan Postelnicu 69d369ec4f Bug 1626555 - Add `dom/media/mediasink` to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D95023
2020-10-28 17:26:04 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
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