Commit Graph

1524 Commits

Author SHA1 Message Date
Florian Quèze
39b8885527 Bug 1913624 - Remove expired telemetry histograms VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE, VIDEO_INTER_KEYFRAME_AVERAGE_MS and VIDEO_INTER_KEYFRAME_MAX_MS, r=chutten,webidl,emilio.
Depends on D219447

Differential Revision: https://phabricator.services.mozilla.com/D219448
2024-08-20 10:26:54 +00:00
Chun-Min Chang
1b1e18f58f Bug 1865896 - Apply DefineEnum to AudioChannelService::AudibleState r=media-playback-reviewers,padenot
Note this patch changes the converted enum string from X to eX in the
logs, and free the crash caused by passing `AudibleState::eMaybeAudible`
to `ToAudibilityStr`

Depends on D213363

Differential Revision: https://phabricator.services.mozilla.com/D213364
2024-07-31 16:32:18 +00:00
Chun-Min Chang
5f58811432 Bug 1865896 - Apply DefineEnum to MediaPlaybackState r=media-playback-reviewers,padenot
Note that this patch changes the MediaPlaybackState enum string from X
to eX (e.g., started -> eStarted), but no functional change involves.

Depends on D210117

Differential Revision: https://phabricator.services.mozilla.com/D210118
2024-07-31 16:32:16 +00:00
Chun-Min Chang
a1336ad4a9 Bug 1865896 - Sort include headers in HTMLMediaElement.cpp per coding style r=media-playback-reviewers,padenot
Depends on D210114

Differential Revision: https://phabricator.services.mozilla.com/D210115
2024-07-31 16:32:14 +00:00
Kagami Sascha Rosylight
90c218ca5f Bug 1908664 - Add nsIPrincipal::GetIsInPrivateBrowsing r=media-playback-reviewers,anti-tracking-reviewers,dom-storage-reviewers,padenot,asuth,pbz
Differential Revision: https://phabricator.services.mozilla.com/D216993
2024-07-26 17:47:51 +00:00
alwu
8ab575596a Bug 1904937 - part2 : add debug logs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D215265
2024-07-03 15:40:14 +00:00
Emilio Cobos Álvarez
71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Masayuki Nakano
fb5048e05b Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
sotaro
1f80fb5b98 Bug 1898142 - Deliver image usage type to WebRenderImageHost r=gfx-reviewers,lsalzman
Adds ImageUsageType to ImageClient and ImageContainer to identify user of Image at WebRenderImageHost.

Some ImageContainers are used only for allocating Image. Only following types calls ImageContainer::SetCurrentImages().
- ImageUsageType::Canvas
- ImageUsageType::OffscreenCanvas
- ImageUsageType::VideoFrameContainer

Differential Revision: https://phabricator.services.mozilla.com/D211147
2024-05-22 23:03:22 +00:00
Emilio Cobos Álvarez
bf22d33f87 Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug
This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.

Differential Revision: https://phabricator.services.mozilla.com/D209525
2024-05-06 21:54:37 +00:00
Nerixyz
a8a8a46eea Bug 1887128 - Guess position state from media elements. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D204691
2024-04-29 17:41:10 +00:00
Ray Kraesig
286effabaf Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio
All present uses of the call-site arguments to MozPromise's methods
supply static strings. However, this is nowhere enforced. Do so.

Additionally, since this is the third or fourth time the present author
alone has personally implemented such an enforcement mechanism, create a
helper class to simplify doing so.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D207462
2024-04-24 17:02:49 +00:00
Byron Campen
7ed01e8da5 Bug 1818283: Make DOMMediaStream::TrackListener cycle-collected. r=pehrsons
This prevents HTMLMediaElements from being prematurely cycle-collected, and
also makes things a bit safer.

Differential Revision: https://phabricator.services.mozilla.com/D205734
2024-04-05 20:55:53 +00:00
Chun-Min Chang
363a0d7e2b Bug 1886057 - Replace ToMediaControlKeyStr by GetEnumString r=media-playback-reviewers,padenot
The `ToMediaControlKeyStr` can be replaced by `GetEnumString` since
`GetEnumString` is able to access the enum mapping strings of the
`MediaControlKey` generated by the dom binding in
`EnumStrings<MediaControlKey>::Values`

Differential Revision: https://phabricator.services.mozilla.com/D205006
2024-03-21 18:19:12 +00:00
Cristian Tuns
dbeb8af991 Backed out 6 changesets (bug 1886057) for causing build bustages in MFCDMSession.cpp CLOSED TREE
Backed out changeset 4e4e5d843fc3 (bug 1886057)
Backed out changeset eee295a109f8 (bug 1886057)
Backed out changeset deeb4d41a8ed (bug 1886057)
Backed out changeset 93dcd5c56c14 (bug 1886057)
Backed out changeset 3daba4b63121 (bug 1886057)
Backed out changeset ce3a6cf698ec (bug 1886057)
2024-03-20 15:16:54 -04:00
Chun-Min Chang
7b1ad1988f Bug 1886057 - Replace ToMediaControlKeyStr by GetEnumString r=media-playback-reviewers,padenot
The `ToMediaControlKeyStr` can be replaced by `GetEnumString` since
`GetEnumString` is able to access the enum mapping strings of the
`MediaControlKey` generated by the dom binding in
`EnumStrings<MediaControlKey>::Values`

Differential Revision: https://phabricator.services.mozilla.com/D205006
2024-03-20 18:12:02 +00:00
Emilio Cobos Álvarez
5b62de6483 Bug 1883435 - Don't include GleanMetrics.h from Document.h. r=chutten,necko-reviewers,valentin
In bug 1883435 comment 2 chutten mentions that including
nsGlobalWindowInner.h from GleanMetrics.h causes a stylo build failure.

This is because nsGlobalWindowInner.h itself brings a bunch of DOM
bindings template soup that bindgen isn't great at dealing with.

That can be fixed in various ways. However, there is a simpler fix,
which is not including GleanMetrics at all.

It's trivial to do, and given it's a massive autogenerated file, and
Document.h is a very common header, it's worth doing this if only for
build times.

Fix a bunch of unused includes while at it.

Differential Revision: https://phabricator.services.mozilla.com/D203625
2024-03-05 17:54:14 +00:00
Emilio Cobos Álvarez
7506fc5879 Bug 1881011 - Refactor UnbindFromTree to take a context argument. r=smaug
Much like BindToTree.

This will be useful because I need to pass more information through
UnbindFromTree() to speed up dir=auto for bug 1874040.

Differential Revision: https://phabricator.services.mozilla.com/D202215
2024-02-20 15:05:40 +00:00
alwu
622ca5c169 Bug 1873394 - part1 : collect playback statistic data for MFCDM. r=media-playback-reviewers,chunmin,chutten
Differential Revision: https://phabricator.services.mozilla.com/D198109
2024-02-08 18:38:29 +00:00
pstanciu
dbc4a6f9dd Backed out 3 changesets (bug 1873394) for causing bug 1879250. CLOSED TREE
Backed out changeset b355f33d28c9 (bug 1873394)
Backed out changeset 6711b73d58e1 (bug 1873394)
Backed out changeset 44fdf4e83c7c (bug 1873394)
2024-02-08 11:53:13 +02:00
alwu
1394934faf Bug 1873394 - part1 : collect playback statistic data for MFCDM. r=media-playback-reviewers,chunmin,chutten
Differential Revision: https://phabricator.services.mozilla.com/D198109
2024-02-07 20:05:24 +00:00
Karl Tomlinson
9d08ae8be5 Bug 1875174 add logging for setSinkId() and MediaStreamRenderer r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D198876
2024-01-18 23:15:15 +00:00
Karl Tomlinson
343a8ea27d Bug 1872787 allow mozCaptureStream() on a media element already captured by MediaElementAudioSourceNode with a non-default MediaTrackGraph r=pehrsons
The graph of the MediaElementAudioSourceNode will be used for tracks for
decoded media resource output.

Similarly for mozCaptureStreamUntilEnded().

The MediaTrackGraph of default sample rate is now constructed only if required
and when a track on the graph will be created, to address a MediaTrackGraph
leak, and so allows landing a crashtest.

Tab audio capture still expects the default graph.
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1633436

Differential Revision: https://phabricator.services.mozilla.com/D198771
2024-01-18 04:52:55 +00:00
Karl Tomlinson
532e71a558 Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStarted() r=pehrsons
The aTrack parameter is no longer required because, as of
https://phabricator.services.mozilla.com/D198231, MediaStreamRenderer no
longer needs the promise to be rejected when the track is destroyed.

Instead the wait for the device to start is terminated when no outputs to the
specified device remain.

NotifyWhenDeviceStarted() is removed from some gtests that don't have any
track outputs.  They use WaitFor(cubeb->StreamInitEvent()) to wait for a
device anyway and don't need to know precisely when the graph switches from
the fallback driver to the callback.  If a test does need this precise timing
it can use NotifyWhenDeviceStarted() if MediaTrack::AddAudioOutput() is used.

Differential Revision: https://phabricator.services.mozilla.com/D198232
2024-01-16 09:14:07 +00:00
Karl Tomlinson
e18f1219f6 Bug 1869043 track and resolve device changed/running promises in MediaStreamRenderer r=pehrsons
The primary motivation for MediaStreamRenderer keeping track of and settling
incomplete promises is that, after changes in subsequent patches,
AudioStreamTrack outputs will share CrossGraphReceivers and so dedicated
CrossGraphReceivers will no longer be available to reject incomplete promises
when CrossGraphRecievers are Destroy()ed when an output is removed.

This also reliably keeps promise resolution in order wrt the synchronous
resolution from a setSinkId() call while playback is paused.

When a promise is settled because a subsequent pause or setSinkId() makes
the device change unnecessary, the promise is now resolved instead of
rejected.  The new behavior is consistent with the resolution of a
promise created while playback is paused and with AudioSinkWrapper.  Promise
resolution may be less likely to surprise content script than promise
rejection.

The situation with multiple tracks is somewhat arbitrary.  Settling of the
promise depends on which tracks were present when setSinkId() was called.
GenericPromise::All() in MediaStreamRenderer::SetAudioOutputDevice() would
reject when the first track that existed at setSinkId() was removed or ended.
This patch switches to AllSettled() and resolves when all tracks that existed
at setSinkId() have ended.  When AudioStreamTrack outputs no longer have
dedicated CrossGraphRecievers, removal of tracks will no longer cause the
promise to be settled until no tracks require the device.

Differential Revision: https://phabricator.services.mozilla.com/D198231
2024-01-15 23:51:19 +00:00
sunil mayya
8fc5324936 Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-27 13:30:11 +00:00
Narcis Beleuzu
a71d185ff5 Backed out 6 changesets (bug 1851992) for DT failure on browser_net_image_cache.js . CLOSED TREE
Backed out changeset 3ceaf46f8f55 (bug 1851992)
Backed out changeset c9d322362e22 (bug 1851992)
Backed out changeset 673df3f83249 (bug 1851992)
Backed out changeset 46e18c56dd39 (bug 1851992)
Backed out changeset f9f9143ac713 (bug 1851992)
Backed out changeset 38c40d735ab7 (bug 1851992)
2023-10-24 13:16:40 +03:00
sunil mayya
69ed451168 Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-24 01:48:09 +00:00
Cristina Horotan
c792918ab6 Backed out 5 changesets (bug 1851992) for causing multiple failures
Backed out changeset d28399b3d947 (bug 1851992)
Backed out changeset 95e4df69007a (bug 1851992)
Backed out changeset fa61d4e76827 (bug 1851992)
Backed out changeset 79969d9eb5cd (bug 1851992)
Backed out changeset 03c17255f1af (bug 1851992)
2023-10-17 14:48:23 +03:00
sunil mayya
40a8c4d35c Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-17 08:27:49 +00:00
Emilio Cobos Álvarez
d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Emilio Cobos Álvarez
3bbfb2e943 Bug 1817122 - Make AsyncEventDispatcher(Event) take ownership of the event. r=smaug,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D190059
2023-10-04 19:37:39 +00:00
scottjehl
3d4c5c86b9 Bug 1836128 - Implement source media for media elements and reference/update relevant platform tests r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D189416
2023-10-03 13:52:06 +00:00
Emilio Cobos Álvarez
eb5453c631 Bug 1856300 - Remove some unnecessary casts in HTMLMediaElement. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D189750
2023-10-02 15:17:44 +00:00
Markus Stange
70bd936589 Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
Thomas Wisniewski
3993d66f78 Bug 1397646 - return empty statusText for HTTP2 fetches and XMLHttpRequests; r=kershaw,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D184527
2023-08-08 19:47:39 +00:00
Iulian Moraru
b1529c5cba Backed out changeset 675cf3cb3d33 (bug 1397646) for causing mochitest failures on test_fetch_basic_http.html. CLOSED TREE 2023-08-07 07:46:50 +03:00
Thomas Wisniewski
7009795aa6 Bug 1397646 - return empty statusText for HTTP2 fetches and XMLHttpRequests; r=kershaw,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D184527
2023-08-07 04:00:31 +00:00
Natalia Csoregi
9a4e48d386 Backed out 3 changesets (bug 1693250) for causing high frequency failures on test_recreate_audio_sink_clock_time.html. CLOSED TREE
Backed out changeset 7a2f57793a3b (bug 1693250)
Backed out changeset f869096a85f2 (bug 1693250)
Backed out changeset 54b9fbe63086 (bug 1693250)
2023-07-18 06:01:09 +03:00
alwu
2c2afcf279 Bug 1693250 - part3 : add another test to check whether audio sink incorrectly inserts silence. r=media-playback-reviewers,webidl,saschanaz,padenot
Differential Revision: https://phabricator.services.mozilla.com/D183435
2023-07-17 19:54:24 +00:00
alwu
49d28ce1ba Bug 1693250 - part2 : reset the audible state when the audio sink get shutdown. r=bryce,karlt
When the audio sink shutdown, we should also reset the audible state for
the listeners. Otherwise, MediaDecoderStateMachine would possibly rely
on the incorrect audible state that is produced by previous sink, which
would cause showing the sound indicator even if no sound is being playing.

Eg. Considering following case without the reset of the audible state

1. Sink A is audible -> MDSM set mIsAudioDataAudible=true
2. Stop sink
3. Recreate sink B and it's playing silence -> MDSM's mIsAudioDataAudible=true is still true, this is wrong!

Differential Revision: https://phabricator.services.mozilla.com/D113550
2023-07-17 19:54:24 +00:00
Karl Tomlinson
062cb9e0b4 Bug 1829068 retain the same AudioSinkWrapper when switching output devices r=padenot
This allows video playback to continue uninterrupted.

The AudioSinkWrapper now maintains the correct playback position in the media
data.  Previously the replacement AudioSinkWrapper started its clock at the
"current playback position" from the MediaDecoderStateMachine, which did not
include additional time from looping, so silence would be played until the
missing time had passed.

The AudioSinkWrapper now continues to periodically attempt to open a new
output device if not initially available.  Previously such attempts were only
performed on state changes such as seeking or unmuting.

The promise returned from MediaDecoderStateMachine::InvokeSetSink() now
resolves regardless of whether the new device can be opened successfully.
Previously the promise could be rejected if the device was necessary for audio
output at the time of the call but no check for device availability (beyond
that of device enumeration) was performed if playback was suspended or muted
or if a subsequent device change had already been queued.  Even previously the
underlying device was changed even when the promise was rejected and could be
used if a state change occurred.

Differential Revision: https://phabricator.services.mozilla.com/D181975
2023-06-27 08:53:50 +00:00
Cristian Tuns
5d943204d3 Backed out 3 changesets (bug 1829068) for causing wpt failures in setSinkId-with-MediaElementAudioSourceNode.https.html CLOSED TREE
Backed out changeset 40cf2b588396 (bug 1829068)
Backed out changeset 1a8f8cda9b25 (bug 1829068)
Backed out changeset 5eb680967020 (bug 1829068)
2023-06-27 01:25:48 -04:00
Karl Tomlinson
d3b05162c8 Bug 1829068 retain the same AudioSinkWrapper when switching output devices r=padenot
This allows video playback to continue uninterrupted.

The AudioSinkWrapper now maintains the correct playback position in the media
data.  Previously the replacement AudioSinkWrapper started its clock at the
"current playback position" from the MediaDecoderStateMachine, which did not
include additional time from looping, so silence would be played until the
missing time had passed.

The AudioSinkWrapper now continues to periodically attempt to open a new
output device if not initially available.  Previously such attempts were only
performed on state changes such as seeking or unmuting.

The promise returned from MediaDecoderStateMachine::InvokeSetSink() now
resolves regardless of whether the new device can be opened successfully.
Previously the promise could be rejected if the device was necessary for audio
output at the time of the call but no check for device availability (beyond
that of device enumeration) was performed if playback was suspended or muted
or if a subsequent device change had already been queued.  Even previously the
underlying device was changed even when the promise was rejected and could be
used if a state change occurred.

Differential Revision: https://phabricator.services.mozilla.com/D181975
2023-06-27 03:22:10 +00:00
Emilio Cobos Álvarez
529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Tom Schuster
f33200529a Bug 1834737 - Make RFPTarget parameter of Document::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D178925
2023-05-31 09:46:54 +00:00
Paul Adenot
fa15d38480 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-24 13:18:43 +00:00
Paul Adenot
71f41c3a9c Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-24 13:18:43 +00:00
Paul Adenot
450c7cfa1a Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-24 13:18:42 +00:00
Paul Adenot
fcd4b24422 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-24 13:18:42 +00:00