Commit graph

1473 commits

Author SHA1 Message Date
Jens Stutte
129df77e82 Bug 1834326 - Have different error messages for QuotaExceededError in media APIs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D178683
2023-05-24 07:51:42 +00:00
Cosmin Sabou
5fd965f028 Backed out 80 changesets (bug 1821362, bug 1703812, bug 1817997) for causing media crashes as in Bug 1833890. a=backout
Backed out changeset f2113c9b661f (bug 1817997)
Backed out changeset f1ecfbba7ed2 (bug 1703812)
Backed out changeset 011cece33b0d (bug 1817997)
Backed out changeset 4b42659090f3 (bug 1817997)
Backed out changeset 2d92f903dd66 (bug 1817997)
Backed out changeset 0ef13d357ee3 (bug 1817997)
Backed out changeset 7353f869efd2 (bug 1703812)
Backed out changeset 14b061d0f595 (bug 1817997)
Backed out changeset d29bc29397c8 (bug 1703812)
Backed out changeset 54c3294f0839 (bug 1817997)
Backed out changeset b9f2e1155bd7 (bug 1817997)
Backed out changeset d5d5d390dcbf (bug 1817997)
Backed out changeset 8fca27bd0f6b (bug 1817997)
Backed out changeset 670c599a3b99 (bug 1817997)
Backed out changeset deea3077f762 (bug 1817997)
Backed out changeset 25ecea0f3d49 (bug 1817997)
Backed out changeset 35ab3ed5e3fc (bug 1817997)
Backed out changeset f516a428ba32 (bug 1817997)
Backed out changeset e589b4d30995 (bug 1817997)
Backed out changeset d096b9cc905d (bug 1817997)
Backed out changeset 2952a6fa06e5 (bug 1817997)
Backed out changeset c1ac4c31ad9a (bug 1817997)
Backed out changeset 04c60cd83c5f (bug 1821362)
Backed out changeset 6dd80575e551 (bug 1821362)
Backed out changeset b86b569ecd46 (bug 1817997)
Backed out changeset 412e0a9ec4e8 (bug 1817997)
Backed out changeset 8e0dcf163138 (bug 1817997)
Backed out changeset 7af506896930 (bug 1817997)
Backed out changeset 29f7cd2b341c (bug 1817997)
Backed out changeset 7f64e65d9497 (bug 1817997)
Backed out changeset 89c241451a32 (bug 1817997)
Backed out changeset 66e4a26e1ebe (bug 1817997)
Backed out changeset ea1aebd4e245 (bug 1817997)
Backed out changeset 2d88a5915db9 (bug 1817997)
Backed out changeset 697ec1928f9c (bug 1817997)
Backed out changeset 41c0bd1133c5 (bug 1817997)
Backed out changeset b20cc750c020 (bug 1817997)
Backed out changeset dc5fd84a3a4c (bug 1703812)
Backed out changeset efa6d130d4eb (bug 1703812)
Backed out changeset 20d9b7cf0ddc (bug 1703812)
Backed out changeset e77c61e8fad2 (bug 1703812)
Backed out changeset 582d5c680e5a (bug 1703812)
Backed out changeset 96c9aacc6811 (bug 1703812)
Backed out changeset 56ec4a57a6a6 (bug 1703812)
Backed out changeset 8f96c8811675 (bug 1703812)
Backed out changeset a79a2f1b2b51 (bug 1703812)
Backed out changeset 07eb8b2c5b9f (bug 1703812)
Backed out changeset bae2b2fb9759 (bug 1703812)
Backed out changeset 38b0416538f3 (bug 1703812)
Backed out changeset b27b54c95cf2 (bug 1703812)
Backed out changeset cab00065d83d (bug 1703812)
Backed out changeset ab44727b2e1a (bug 1703812)
Backed out changeset b7fdcb494670 (bug 1703812)
Backed out changeset 73db43d49c6d (bug 1703812)
Backed out changeset ce754dbfb862 (bug 1703812)
Backed out changeset d694726a3ee6 (bug 1703812)
Backed out changeset 6acede55acbb (bug 1703812)
Backed out changeset 86e7d4784a20 (bug 1703812)
Backed out changeset 6b2e055d9314 (bug 1703812)
Backed out changeset b08695e5728a (bug 1703812)
Backed out changeset 3b8a0081fd10 (bug 1703812)
Backed out changeset 3a163596f982 (bug 1703812)
Backed out changeset 5be1d4b282ab (bug 1703812)
Backed out changeset 1ce012d7509e (bug 1703812)
Backed out changeset ee2fab5881c7 (bug 1703812)
Backed out changeset 62941a522893 (bug 1703812)
Backed out changeset d4f11dc33eed (bug 1703812)
Backed out changeset 781bb4c3cc02 (bug 1703812)
Backed out changeset f070e0de0566 (bug 1703812)
Backed out changeset 9f65c67ba2a6 (bug 1703812)
Backed out changeset 1e76eecb85e2 (bug 1703812)
Backed out changeset 953432408a83 (bug 1703812)
Backed out changeset fd1dc92d3911 (bug 1703812)
Backed out changeset 34d56948c6b6 (bug 1703812)
Backed out changeset 2ba7ca61ecc3 (bug 1703812)
Backed out changeset 545253c469e6 (bug 1703812)
Backed out changeset fb4a61ab1300 (bug 1703812)
Backed out changeset bf07b3cfd3d5 (bug 1703812)
Backed out changeset eaff51e7754b (bug 1703812)
Backed out changeset f5c485c41d13 (bug 1703812)
2023-05-19 14:49:57 +03:00
Paul Adenot
38c29f1a6a Bug 1817997 - Write a version of GetSeekableTimeRanges that uses double and not TimeUnit. r=alwu
When playing a MediaSource, `seekable` should return `[0, duration]`, and duration
can be a double of any precision.

Differential Revision: https://phabricator.services.mozilla.com/D176042
2023-05-17 15:47:07 +00:00
Paul Adenot
903f061f6f Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-17 15:47:07 +00:00
Paul Adenot
a5dda50bd8 Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-17 15:47:06 +00:00
Paul Adenot
0b4a1e2149 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-17 15:47:05 +00:00
Paul Adenot
256aab271f Bug 1817997 - Update HTMLMediaElement to use the new TimeUnit. r=alwu
Similarly to other commits, it's necessary to sometimes reduce the precision of
returned time values, to ensure there's no change to returned numbers.

Differential Revision: https://phabricator.services.mozilla.com/D173313
2023-05-17 15:47:05 +00:00
Karl Tomlinson
8fa3446be3 Bug 1832479 reflow video elements with natural size from metadata r=pehrsons
The spec is inconsistent [1] about whether this size from metadata should be
used, but having predictable behavior in Firefox is better than having the
size change unexpectedly because something unrelated triggers a reflow and
this change makes Firefox consistent with Chrome.

[1] https://github.com/whatwg/html/issues/9279

Differential Revision: https://phabricator.services.mozilla.com/D177984
2023-05-17 01:36:59 +00:00
Karl Tomlinson
fb0873a1d5 Bug 1832479 use types for decoder owner Invalidate() boolean parameters r=pehrsons
for safety and readability.

Differential Revision: https://phabricator.services.mozilla.com/D177983
2023-05-16 21:30:29 +00:00
Emilio Cobos Álvarez
51758cfc9b Bug 1829189 - Make OnAttrSetButNotChanged and AfterSetAttr infallible. r=smaug
Same rg + sed shenanigans as the first patch.

There were two that could fail, both due to OOM:

 * HTMLInputElement::AfterSetAttr: If we fail (only in the type=range
   case) we end up with an old value without it being clamped by
   min/max/step.

 * HTMLBodyElement::AfterSetAttr: If we fail we won't peek up the
   DocShell's frame margins and styling could be incorrect.

That seems better than having to deal with broken states after we've
already set the attribute.

Depends on D176069

Differential Revision: https://phabricator.services.mozilla.com/D176070
2023-04-21 08:56:27 +00:00
Emilio Cobos Álvarez
641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Andreas Pehrson
6524982237 Bug 1807215 - Make the intrinsic size arg in MediaDecoderOwner::Invalidate a const ref. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D174083
2023-04-03 08:36:39 +00:00
Andi-Bogdan Postelnicu
10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
alwu
772b7e4585 Bug 1820723 - do not create wakelock if XPCOM has started shutdown. r=media-playback-reviewers,jolin
Differential Revision: https://phabricator.services.mozilla.com/D172031
2023-03-09 18:08:43 +00:00
Tom Schuster
16d1d2ed89 Bug 1813584 - Use fine grained RFP for CubebUtils::PreferredSampleRate. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D168523
2023-02-15 10:55:31 +00:00
Paul Adenot
859e63e756 Bug 1812542 - Rename nsMediaElement and nsMediaElementEvents log modules. r=media-playback-reviewers,kinetik
Differential Revision: https://phabricator.services.mozilla.com/D167913
2023-01-27 17:10:47 +00:00
alwu
60bbc8ab3d Bug 1773551 - part1 : move AutoplayPolicy to media namespace in order to prevent naming collision. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D164748
2022-12-19 20:57:54 +00:00
alwu
2a156f31ff Bug 1803834 - part2 : pause/resume non-audible autoplay video when its visibility changes. r=media-playback-reviewers,padenot
https://html.spec.whatwg.org/multipage/media.html#ready-states:eligible-for-autoplay-2

Depends on D163741

Differential Revision: https://phabricator.services.mozilla.com/D163742
2022-12-06 18:21:39 +00:00
alwu
64af530cf1 Bug 1803834 - part1 : rename mAutoplaying to 'mCanAutoplayFlag'. r=media-playback-reviewers,padenot
Our current attribute `mAutoplaying` seems be equal to the `can
autoplay flag` defined in the spec, so rename it to the spec name.

https://html.spec.whatwg.org/multipage/media.html#can-autoplay-flag

Differential Revision: https://phabricator.services.mozilla.com/D163741
2022-12-06 18:21:39 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Andreas Pehrson
2ed52d6125 Bug 1796069 - Annotate MediaStreamTrackSources with a tracking id and apply it to CopyVideoStages. r=padenot
This will allow time consuming tasks (copies, capture, etc.) along the pipe to
be grouped per-track-source when visualizing profiler markers.

Differential Revision: https://phabricator.services.mozilla.com/D160754
2022-12-01 09:52:46 +00:00
Botond Ballo
68c71a503c Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Karl Tomlinson
703b1dbfda Bug 1786306 merge AudioStreamTrack::SetAudioOutputDevice() into AddAudioOutput() r=padenot
The SetAudioOutputDevice() implementation required a subsequent
AddAudioOutput() call, so there is no need to have separate methods.

Differential Revision: https://phabricator.services.mozilla.com/D158310
2022-09-30 04:13:35 +00:00
Brad Werth
51de674b99 Bug 1787561 Part 2: Expose HDR telemetry to HTMLMediaElement as a Chrome property. r=alwu,emilio
This is necessary scaffolding for testing of the HDR telemetry in a way
that involves the RDD process. This is important for matching real-world
conditions.

Depends on D155902

Differential Revision: https://phabricator.services.mozilla.com/D156245
2022-09-08 18:02:04 +00:00
Kershaw Chang
d164608d66 Bug 1760580 - P2: Provide a reason when request is cancelled with NS_BINDING_ABORTED, r=necko-reviewers,media-playback-reviewers,valentin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D156071
2022-09-08 09:11:19 +00:00
criss
d87f2984cd Backed out 3 changesets (bug 1787561) for causing mochitest failures on browser_tab_visibility_and_play_time.js
Backed out changeset a41ab0c5f32f (bug 1787561)
Backed out changeset c1375f03dc75 (bug 1787561)
Backed out changeset afef5857aea6 (bug 1787561)
2022-09-07 23:49:05 +03:00
Brad Werth
99ed6acbb7 Bug 1787561 Part 2: Expose HDR telemetry to HTMLMediaElement as a Chrome property. r=alwu,emilio
This is necessary scaffolding for testing of the HDR telemetry in a way
that involves the RDD process. This is important for matching real-world
conditions.

Depends on D155902

Differential Revision: https://phabricator.services.mozilla.com/D156245
2022-09-07 18:31:46 +00:00
Emilio Cobos Álvarez
08dfe7c199 Bug 1785089 - Minor drive-by clean-ups. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D154800
2022-08-17 21:07:27 +00:00
Emilio Cobos Álvarez
060844671d Bug 1785089 - Don't spam the console and front-end with autoplay blocked events. r=alwu
Once per video should be enough.

Differential Revision: https://phabricator.services.mozilla.com/D154798
2022-08-17 21:02:44 +00:00
Chun-Min Chang
edc56a360b Bug 1776796 - Rename MarkAsContentSource r=media-playback-reviewers,alwu
`HTMLMediaElement::MarkAsContentSource` [1] was added in Bug 1299718 to
monitor the visibility / invisibility of various usage of video element.
However, that telemetry had been removed in Bug 1356046.
`MarkAsContentSource` is only used for logging currently. It's better to
reword its name and related comments to bring the code in line with the
current status.

[1] https://searchfox.org/mozilla-central/rev/5b2d2863bd315f232a3f769f76e0eb16cdca7cb0/dom/html/HTMLMediaElement.h#799

Differential Revision: https://phabricator.services.mozilla.com/D150434
2022-07-27 00:20:45 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
june wilde
29fb0fb057 Bug 1731614 - Clarify error phrasing in NoSupportedMediaSourceError; r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D145576
2022-05-23 21:27:48 +00:00
Kagami Sascha Rosylight
b1653a09c7 Bug 1767996 - Apply readability-make-member-function-const on dom/html r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145627
2022-05-13 05:35:25 +00:00
az
2607db324d Bug 1652950 - Unprefix mozPreservesPitch, update corresponding tests r=emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D143237
2022-04-20 18:43:47 +00:00
ashley
bbae966812 Bug 1744398 - Media element load algorithm must fire 'emptied' before 'timeupdate' r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D142628
2022-04-01 18:26:05 +00:00
Bryce Seager van Dyk
ff03cc04a5 Bug 1724106 - Clarify threading usage when getting media debug info. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D124104
2022-03-29 22:17:58 +00:00
Paul Adenot
7506e056c3 Bug 1272636 - Reset HTMLMediaElement.played when loading a new source. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D139925
2022-03-08 13:05:28 +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
Masayuki Nakano
4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve nsINode or its concrete classes from EventTarget r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Jeff Muizelaar
cde3f4b00b Bug 1736077 - Remove unusued LayerManager.cpp. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128632
2021-10-17 01:28:41 +00:00
Paul Adenot
5f6c907318 Bug 1678373 - Add a way to measure the duration a media was muted. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125088
2021-10-12 09:03:53 +00:00
Paul Adenot
2a5cb9f5c5 Bug 1678373 - Expose audio telemetry counters as chrome-only attributes like their video counterparts. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125084
2021-10-12 09:03:52 +00:00
Paul Adenot
1a85208ad7 Bug 1678373 - Rename chrome-only telemetry counter attributes to distinguish audio and video. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125083
2021-10-12 09:03:52 +00:00
Alexandru Michis
26c14b3225 Backed out 24 changesets (bug 1678373) for causing bc failures in browser_tab_visibility_and_play_time.js
CLOSED TREE

Backed out changeset 1886dbd81c46 (bug 1678373)
Backed out changeset aeff26b5b1ae (bug 1678373)
Backed out changeset 261d8e4483d4 (bug 1678373)
Backed out changeset 89cb5ae23632 (bug 1678373)
Backed out changeset b1eaedd192ab (bug 1678373)
Backed out changeset 58a3eb19c818 (bug 1678373)
Backed out changeset b027ec789cbe (bug 1678373)
Backed out changeset fd596a84feb9 (bug 1678373)
Backed out changeset 1f0ed0392ae2 (bug 1678373)
Backed out changeset ac2be1df81af (bug 1678373)
Backed out changeset bf6d47905d78 (bug 1678373)
Backed out changeset a9fe4f310962 (bug 1678373)
Backed out changeset a15316058968 (bug 1678373)
Backed out changeset 217cdfd46120 (bug 1678373)
Backed out changeset c33c8411129b (bug 1678373)
Backed out changeset 3b854fc36abf (bug 1678373)
Backed out changeset e47c82bcb49a (bug 1678373)
Backed out changeset 2a77cbba1c9f (bug 1678373)
Backed out changeset 65206afede36 (bug 1678373)
Backed out changeset bd04930155f4 (bug 1678373)
Backed out changeset 034e8edd4619 (bug 1678373)
Backed out changeset ed1e56487c4c (bug 1678373)
Backed out changeset b7673d20c521 (bug 1678373)
Backed out changeset 5a93251e2fea (bug 1678373)
2021-10-07 20:36:47 +03:00
Paul Adenot
82125c0639 Bug 1678373 - Add a way to measure the duration a media was muted. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125088
2021-10-07 15:44:54 +00:00
Paul Adenot
6dc847cdf6 Bug 1678373 - Expose audio telemetry counters as chrome-only attributes like their video counterparts. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125084
2021-10-07 15:44:53 +00:00
Paul Adenot
94b7678216 Bug 1678373 - Rename chrome-only telemetry counter attributes to distinguish audio and video. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125083
2021-10-07 15:44:53 +00:00
Paul Adenot
2d55780bdd Bug 1733109 - function 'mozilla::dom::HTMLMediaElement::MozGetMetadata' has a definition with different parameter names in HTMLMediaElement.cpp. r=alwu
Depends on D126946

Differential Revision: https://phabricator.services.mozilla.com/D126947
2021-09-30 12:36:18 +00:00