Use large values for MediaCache size/readahead/resume and preload action if we're on Wifi/Ethernet, small if we're on cellular
Categories
(Core :: Audio/Video: Playback, enhancement, P2)
Tracking
()
People
(Reporter: cpearce, Assigned: cpearce)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [gvtv:p1] [media-q2])
Attachments
(8 files, 2 obsolete files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
On Android, we unilaterally use small values for the media cache size, resume threshold, and readahead limit. We do this under the assumption that Android is likely to be running on a phone, and we assume we should conserve the user's cellular data allowance on a phone.
This is probably a reasonable thing to do while we're running on a cellular connection, but a phone may in fact have a WiFi connection (say while being used from the couch at home).
For running GeckoView on the FireTV Stick/Cube, these small values are annoying, as while running on these device we typically have either an Ethernet or WiFi connection.
Small values of these prefs mean we're more likely to have to rebuffer while playing HD content. If we have super high quality content, the default cache size of 32MB can actually be too small to reliably play (see bug 1538023, but note such content is only likely to be in src=url video for testing purposes).
We should also change the default preload action if we're running on what we assume is non-cellular connection; assuming preload:none is super annoying on FireTV devices.
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
67=fix-optional because FFTV will use some GV version > 67.
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
In GeckoView the nsINetworkLinkService doesn't work in the content process, as
we don't seem to have an AndroidBridge there, so just maintain the network
connection type on the ContentChild.
(I had considered keeping this on the NeckoChild, but the creation of that is
initiated from the content process side, and there's not an easy and clean way
to have the parent process send us the connection type after construction of
the NeckoParent, other than have the NeckoChild request it either
synchronously, or doing it async and hoping it's not asked for the value before
the response comes in.)
Depends on D26231
Assignee | ||
Comment 4•6 years ago
|
||
Depends on D26232
Assignee | ||
Comment 5•6 years ago
|
||
Normally when downloading media data we throttle the download only if we're
ahead of the read cursor more than the "readahead limit", and if we estimate
that the connection is fast enough that we'll be able to download at a rate
fast enough to playback in real time if we resume it later.
On mobile we additionally override this so that we always throttle the download
once we're ahead of the read cursor by the readahead limit. This is to save
data. I think we can relax this to only do this override if we're on a
cellular connection; if we're on WiFi we can assume data is cheap.
Depends on D26233
Assignee | ||
Comment 6•6 years ago
|
||
We're allowed to take some liberties as to what the default value and behaviour
we assume for the 'preload' attribute on HTMLMediaElement by the spec. On
desktop we assumed preload="metadata", while on mobile we assumed the default
of preload="none" to save data. On mobile we also assumed that preload="auto"
meant preload="metadata".
I think it makes sense to instead of always assuming that data on Android is
always expensive, we can instead detect if we're running on a cellular connection,
and preload frugally then, otherwise aggressively.
Depends on D26234
Comment 7•6 years ago
|
||
67=wontfix because there's no rush to uplift to Fennec 67 Beta if this fix only introduces new behavior for Android devices on wired networks. That's an uncommon configuration.
Assignee | ||
Comment 8•6 years ago
|
||
GeckoView can't necessarily assume that the android.app.Application instance
is a GeckoApplication, so we need to factor out the foreground/background
callbacks into a new interface which GeckoRuntime and GeckoApplication can
both implement.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 9•6 years ago
|
||
This is esawin's patch from Bug 1544076; D28083.
Assignee | ||
Comment 10•6 years ago
|
||
This allows Gecko to react to network link/status changes events as needed.
Depends on D28941
Updated•6 years ago
|
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Backed out 6 changesets (Bug 1540573) for failures in test_CSP.html
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&selectedJob=244080604&revision=599e6e06599d34f06a9e1152329bd16e15889613
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=244075251&repo=autoland&lineNumber=3264
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=244073864&repo=autoland&lineNumber=1801
Backout: https://hg.mozilla.org/integration/autoland/rev/e5ce38e989b82a775d85bd590a6d2da1ec20d63c
Assignee | ||
Comment 13•6 years ago
|
||
The Content Security Policy tests were handling the smaller android preload
values that were #defined on Android by setting media.preload.default=2. Now
that we're detecting whether we're on cellular or not, and the android
emulators that our tests run on emulate a cellular connection, just setting
media.preload.default is no longer enough.
So set media.preload.default.cellular=2 in the CSP mochitests instead of
media.preload.default, to make the CSP mochitests pass in the Android
emulators.
Depends on D26235
Comment 14•6 years ago
|
||
There were also robocop failures on testAudioFocus.
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=244087118&repo=autoland&lineNumber=1566
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4ff116b9d729
https://hg.mozilla.org/mozilla-central/rev/1bde5042e507
https://hg.mozilla.org/mozilla-central/rev/fe196b2dfc62
https://hg.mozilla.org/mozilla-central/rev/3db059b34e40
https://hg.mozilla.org/mozilla-central/rev/270a8917377f
https://hg.mozilla.org/mozilla-central/rev/b10d2cae45f2
https://hg.mozilla.org/mozilla-central/rev/dd882b8cd73e
Comment 17•6 years ago
|
||
Backed out for causing 1548441
backout: https://hg.mozilla.org/integration/autoland/rev/0bb9da8fe6af
Assignee | ||
Comment 18•6 years ago
|
||
I believe the problem with test_preload_suspend is caused by that test changing the media cache size via pref, and the there's nothing to cause MediaCache::UpdateGeometry() to run in response to the pref change.
Assignee | ||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6a17951bc4b9
https://hg.mozilla.org/mozilla-central/rev/d029091d7fd8
https://hg.mozilla.org/mozilla-central/rev/b78948e4f480
https://hg.mozilla.org/mozilla-central/rev/bcbb8c779852
https://hg.mozilla.org/mozilla-central/rev/07c6d54744f7
https://hg.mozilla.org/mozilla-central/rev/0d175912734d
https://hg.mozilla.org/mozilla-central/rev/90ebd256a92b
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
bugherder |
Description
•