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

99 Коммитов

Автор SHA1 Сообщение Дата
Cristian Tuns 8cf35d7033 Backed out 12 changesets (bug 1743834, bug 1765554) for causing reftest failures CLOSED TREE
Backed out changeset e4045f9906cf (bug 1765554)
Backed out changeset e2e3a95faccd (bug 1743834)
Backed out changeset 06a4c7ba1807 (bug 1743834)
Backed out changeset 322ac397ad9c (bug 1743834)
Backed out changeset f1aaa967ed6d (bug 1743834)
Backed out changeset 3728fcbd5753 (bug 1743834)
Backed out changeset 4d427e0ca400 (bug 1743834)
Backed out changeset 3000680ad5f4 (bug 1743834)
Backed out changeset 048e93d0a274 (bug 1743834)
Backed out changeset 32210507c793 (bug 1743834)
Backed out changeset b15369c023af (bug 1743834)
Backed out changeset b03a509cbe7e (bug 1743834)
2022-04-20 13:30:30 -04:00
Paul Adenot 92868004aa Bug 1743834 - Wait for the audio callbacks to start being called before using the audio clock. r=alwu,media-playback-reviewers
Because we're generally using high latency on the cubeb stream used by
AudioStream instance, it can take some time for the callbacks to start being
called, and the for the audio clock (cubeb_stream_get_position(...)) to advance.

This waits for the first callback to be called before using the clock of the
audio stream, and the system clock keeps being in use until then.

Differential Revision: https://phabricator.services.mozilla.com/D136235
2022-04-20 12:07:10 +00:00
Paul Adenot c06f4b14cf Bug 1743834 - Create and manage the lifetime of the AudioStream EndedPromise in AudioSinkWrapper. r=alwu,media-playback-reviewers
We're going to shutdown the AudioStream in a subsequent patch, when audio is
muted. This will allow resolving it at the right time when the media ends while
muted.

This also extracts a method to start an AudioSink, because it's going to be
started in multiple locations in a future patch.

Differential Revision: https://phabricator.services.mozilla.com/D136233
2022-04-20 12:07:09 +00:00
Randell Jesup b7a9cfb40a Bug 1747178: dom/media Audio thread-safety cleanup r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D134469
2022-03-30 18:04:32 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Marian-Vasile Laza cf29e94922 Merge autoland to mozilla-central. a=merge 2022-02-04 05:37:08 +02: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 1b5b86443f Bug 1752345 - Make playback rate / preserve pitch change wait-free. r=alwu
This changes things so that the time stretcher is only ever touched on the
audio thread. Changes to the playback rate and preserves pitch attribute now
also go through an SPSC queue (but in the other direction).

Locking is made more granular, only around the audio queue now.

Differential Revision: https://phabricator.services.mozilla.com/D137182
2022-02-03 15:18:12 +00:00
Paul Adenot d882853fe6 Bug 1752345 - Remove the prefill quirk in AudioStream.cpp. r=alwu,kinetik
It's doing annoying cross-thread accesses that require the lock, and it's not
needed anyways these days.

Differential Revision: https://phabricator.services.mozilla.com/D137181
2022-02-03 15:18:12 +00:00
Paul Adenot 1b19f8ca22 Bug 1752345 - Make getting the clock for an AudioStream wait-free on macOS. r=alwu
This has two parts:
1. Getting the clock is wait-free in cubeb-coreaudio-rs, so we can remove the
lock. This is only on macOS, the lock is still taken on other platforms.
2. The frame history part now uses an SPSCQueue, that sends the callback history
information to the non-realtime thread, that lazily computes the clock the next
time the clock time is requested.

Differential Revision: https://phabricator.services.mozilla.com/D137180
2022-02-03 15:18:12 +00:00
Gerald Squelart e7e9ae90ae Bug 1721110 - profiler_current_thread_id() now returns ProfilerThreadId - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D120225
2021-07-21 04:16:59 +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
Sylvestre Ledru b4f9be25d4 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D105158
2021-02-15 08:49:20 +00:00
Matthew Gregan 3a6e3014e5 Bug 1689516 - Remove AudioNotification{Sender, Receiver}. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D103430
2021-02-03 20:37:09 +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
Paul Adenot fc302cd8b4 Bug 1647717 - Fix audio thread registration to the profiler in AudioStream.cpp. r=achronop
More or less the same as GraphDriver.cpp but simpler because there is only one
return statement.

Differential Revision: https://phabricator.services.mozilla.com/D80857
2020-06-24 12:45:36 +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
Eric Rahm 6ea4ed1c80 Bug 1322095 - Part 2: Remove nsAutoPtr from dom/media. r=jya
This converts `nsAutoPtr` usage in dom/media to `UniquePtr`. Beyond just a
search and replace we also needed to update assignment and access of the
`UniquePtr`s. This falls into a few categories:
  - Assignment from a newly constructed object switches to `MakeUnique`
  - Assignment from a raw ptr switches to `UniquePtr::reset`
  - Handing out a raw ptr now requires `UniquePtr::get`
  - Uses `UniquePtr::release` rather than `nsAutoPtr::forget`
  - A few spots are updated to return a `UniquePtr` rather than a raw ptr

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

--HG--
extra : moz-landing-system : lando
2020-02-21 22:44:00 +00:00
Chun-Min Chang d8efd75a41 Bug 1588233 - P2: Set ST_NO_EXCEPTION_HANDLING before using SoundTouch. r=glandium
The coming updated libsoundtouch will use ST_THROW_RT_ERROR in several
places built without setting ST_NO_EXCEPTION_HANDLING.
ST_NO_EXCEPTION_HANDLING is only set in libsoundtouch/src/moz.build. To
avoid using `throw`, we should `#define` ST_NO_EXCEPTION_HANDLING before
`#include` soundtouch headers.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 00:48:24 +00:00
Matthew Gregan 27dee3a2b8 Bug 1544997 - Propogate cubeb stream error to AudioSink to handle loss of audio device. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D47745

--HG--
extra : moz-landing-system : lando
2019-10-01 12:14:44 +00:00
Paul Adenot 4be4624d57 Bug 1552530 - Make the wav dumper in AudioStream.cpp reusable. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D31648

--HG--
extra : moz-landing-system : lando
2019-05-21 10:10:04 +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
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
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
Sylvestre Ledru 804b8b8883 Bug 1204606 - Reformat of dom/media r=jya
# skip-blame

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

--HG--
extra : moz-landing-system : lando
2018-11-19 13:25:37 +00:00
Alex Chronopoulos 2c94f04194 Bug 934425 - Set device info in MediaSink and switch sink device. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D5871

--HG--
extra : moz-landing-system : lando
2018-10-12 08:44:35 +00:00
Jean-Yves Avenard 4680798728 Bug 1432779 - P7. Use typedef rather than actual type. r=padenot
this improve readability.

MozReview-Commit-ID: IYfrLMZ5djX
2018-03-24 10:57:59 +01:00
Jean-Yves Avenard 87fa7068d5 Bug 1432779 - P4. Remove the concept of preferred layout. r=padenot,r=kamidphish
Channel layout is derived by the content being played. The concept of preferred layout is meaningless. Either we have a layout defined, or we don't. There's no in-between.

So we remove it.

MozReview-Commit-ID: CSCAInNmzMS
2018-03-24 10:57:59 +01:00
Matthew Gregan 2bf67b1eb5 Bug 1403043 - Avoid reentering libcubeb from data_callback. r=jwwang
AudioStream::DataCallback uses cubeb_get_backend_id to work around a bug in
libcubeb's winmm backend, but calling libcubeb APIs from within libcubeb
callbacks is not safe.  Move the query to AudioStream::Init and check a simple
bool from within the callback instead.
2017-09-29 17:19:47 +13:00
Chun-Min Chang b7f3746bab Bug 1392930 - part 2: Make AudioStream inherit from DeviceChangeListener; r=jwwang
--HG--
extra : rebase_source : 384f30c0fe923609b1c1f0822179f0165d987d4a
2017-08-29 18:08:46 +08:00
Matthew Gregan f4d992a821 Bug 1388229 - Remove B2G-only audio stream type handling. r=kamidphish 2017-08-10 13:00:07 +12:00
Chun-Min Chang bfe0bce52c Bug 1361336 - part1: A new API for AudioStream that it can reset stream to the default device; r=kinetik
MozReview-Commit-ID: ErUYXK9fUvE

--HG--
extra : rebase_source : ced74fba605b6892674a58611d7eb33616c81ce6
2017-07-12 14:51:07 +08:00
Chun-Min Chang 9efca17a07 Bug 1321502 - part 2: Use preferred layout for initializing cubeb when audio queue is empty; r=jya
MozReview-Commit-ID: BDEb8IxuJRn

--HG--
extra : rebase_source : a3bc1ea315c6a00d479a1b7da3eb14d89f458b2d
2017-02-04 08:22:15 +08:00
Chun-Min Chang 561671475d Bug 1321502 - part 1: Enable multi-channel support in Gecko on Windows; r=jya
MozReview-Commit-ID: KURUk3EffOu

--HG--
extra : rebase_source : a0ce3fb8691f45a33995a3ce1ba895c254a35c8c
2017-01-26 17:35:31 +08:00
Matthew Gregan f0efb94bfd Bug 1303083 - Make CubebUtils::PreferredSampleRate handle InitPreferredSampleRate failures. r=padenot 2016-09-18 16:32:22 +12:00
Matthew Gregan 0ebace12e5 Bug 1302348 - Report cubeb context init failures via telemetry. r=padenot 2016-09-16 12:54:24 +12:00
JW Wang ed7bec1506 Bug 1277198. Part 3 - remove AudioStream::mInRate/mOutRate. r=kinetik.
MozReview-Commit-ID: KTiyzO8VEZh

--HG--
extra : rebase_source : 49589d5bd8ea1b2575caaf608569c64fab307c5b
2016-06-01 18:00:15 +08:00
JW Wang 510020f774 Bug 1277198. Part 2 - fix OpenDumpFile(). r=kinetik.
MozReview-Commit-ID: IWzvlWnhuFe

--HG--
extra : rebase_source : 39c105ad766947ebe350b8b2afc2685bb00339dc
2016-06-01 17:54:37 +08:00
JW Wang 51c02cde54 Bug 1277198. Part 1 - add AudioClock::GetInputRate/GetOutputRate. r=kinetik.
MozReview-Commit-ID: HsaiSq83MtD

--HG--
extra : rebase_source : d578e00f15300fbcf1cc41fb5242868a4b31b57d
2016-06-01 17:38:47 +08:00
JW Wang d292fa5e3a Bug 1277776 - Use SaferMultDiv in AudioClock::GetPositionInFrames(). r=jya.
MozReview-Commit-ID: 711czooNf55

--HG--
extra : rebase_source : cf2ba4ab351775be5ab08a820de9d4a1ac356dac
2016-06-06 11:13:34 +08:00
JW Wang 59371c367d Bug 1277188. Part 5 - rename AudioClock::SetPlaybackRateUnlocked(). r=kinetik.
MozReview-Commit-ID: C7m8xeMAJES

--HG--
extra : rebase_source : 2a94db443d9696e9f4b1ee5caa4915df69e745af
2016-06-01 16:45:32 +08:00
JW Wang e84f041b19 Bug 1277188. Part 4 - remove AudioClock::mAudioStream. r=kinetik.
MozReview-Commit-ID: KjrfgHIg8z4

--HG--
extra : rebase_source : 8208e3ead2d8dfbe02fb899e5fb376651715be61
2016-06-01 16:36:10 +08:00
JW Wang 2a587ee2df Bug 1277188. Part 3 - remove AudioClock::GetPositionUnlocked(). r=kinetik.
MozReview-Commit-ID: 9g3wqI63OsR

--HG--
extra : rebase_source : 216e0a7e9909572ad828c262063e348df462a5ef
2016-06-01 16:30:54 +08:00
JW Wang 0b95bcdd11 Bug 1277188. Part 2 - fix AudioStream::GetPositionInFrames(). r=kinetik.
MozReview-Commit-ID: 3NhoRCPu8fU

--HG--
extra : rebase_source : d3b177d25a86f03ac65c5231dc389e66cbb5aba5
2016-06-01 16:18:56 +08:00