Skip to content

Commit

Permalink
Revise hardwareAcceleration based on consensus decision.
Browse files Browse the repository at this point in the history
* It's now a hint instead of being required.
* Values are noPreference, preferSoftware, and preferHardware.

Fixes: #239
  • Loading branch information
dalecurtis committed Jul 28, 2021
1 parent 03e42e7 commit c985f35
Showing 1 changed file with 41 additions and 28 deletions.
69 changes: 41 additions & 28 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@
[EnforceRange] unsigned long codedHeight;
[EnforceRange] unsigned long displayAspectWidth;
[EnforceRange] unsigned long displayAspectHeight;
HardwareAcceleration hardwareAcceleration = "allow";
HardwareAcceleration hardwareAcceleration = "noPreference";
boolean optimizeForLatency;
};
</xmp>
Expand Down Expand Up @@ -1697,7 +1697,7 @@

<dt><dfn dict-member for=VideoDecoderConfig>hardwareAcceleration</dfn></dt>
<dd>
Configures hardware acceleration for this codec. See
Hint that configures hardware acceleration for this codec. See
{{HardwareAcceleration}}.
</dd>

Expand Down Expand Up @@ -1762,7 +1762,7 @@
[EnforceRange] unsigned long displayHeight;
[EnforceRange] unsigned long long bitrate;
[EnforceRange] double framerate;
HardwareAcceleration hardwareAcceleration = "allow";
HardwareAcceleration hardwareAcceleration = "noPreference";
AlphaOption alpha = "discard";
DOMString scalabilityMode;
BitrateMode bitrateMode = "variable";
Expand Down Expand Up @@ -1849,7 +1849,7 @@

<dt><dfn dict-member for=VideoEncoderConfig>hardwareAcceleration</dfn></dt>
<dd>
Configures hardware acceleration for this codec. See
Hint that configures hardware acceleration for this codec. See
{{HardwareAcceleration}}.
</dd>

Expand Down Expand Up @@ -1885,30 +1885,41 @@
---------------------------------------------
<xmp class='idl'>
enum HardwareAcceleration {
"allow",
"deny",
"require",
"noPreference",
"preferHardware",
"preferSoftware",
};
</xmp>

When supported, hardware acceleration offloads encoding or decoding to
specialized hardware.
specialized hardware. {{HardwareAcceleration/preferHardware}} and
{{HardwareAcceleration/preferSoftware}} are hints. While User Agents SHOULD
respect these values when possible, User Agents may ignore these values in some
or all circumstances for any reason.

<div class='note'>
NOTE: Good examples of when a User Agent may ignore
{{HardwareAcceleration/preferHardware}} or
{{HardwareAcceleration/preferSoftware}} are for reasons of user privacy or
circumstances where the User Agent determines an alternative setting would
better serve the end user.

NOTE: Most authors will be best served by using the default of
{{HardwareAcceleration/allow}}. This gives the User Agent flexibility to
optimize based on its knowledge of the system and configuration. A common
{{HardwareAcceleration/noPreference}}. This gives the User Agent flexibility
to optimize based on its knowledge of the system and configuration. A common
strategy will be to prioritize hardware acceleration at higher resolutions
with a fallback to software codecs if hardware acceleration fails.

Authors should carefully weigh the tradeoffs when setting a hardware acceleration
preference. The precise tradeoffs will be device-specific, but authors should
generally expect the following:
Authors should carefully weigh the tradeoffs when setting a hardware
acceleration preference. The precise tradeoffs will be device-specific, but
authors should generally expect the following:

* Setting a value of {{HardwareAcceleration/require}} may significantly
restrict what configurations are supported. It may occur that the user's
device does not offer acceleration for any codec, or only for the most
common profiles of older codecs.
* Setting a value of {{HardwareAcceleration/preferHardware}} or
{{HardwareAcceleration/preferSoftware}} may significantly restrict what
configurations are supported. It may occur that the user's device does not
offer acceleration for any codec, or only for the most common profiles of
older codecs. It may also occur that a given User Agent lacks a software
based codec implementation.
* Hardware acceleration does not simply imply faster encoding / decoding.
Hardware acceleration often has higher startup latency but more consistent
throughput performance. Acceleration will generally reduce CPU load.
Expand All @@ -1920,33 +1931,35 @@
may yield decreased performance and power efficiency compared to purely
software based codecs.

Given these tradeoffs, a good example of using "require" would be if an author
intends to provide their own software based fallback via WebAssembly.
Given these tradeoffs, a good example of using "preferHardware" would be if an
author intends to provide their own software based fallback via WebAssembly.

Alternatively, a good example of using "disallow" would be if an author is
especially sensitive to the higher startup latency or decreased robustness
Alternatively, a good example of using "preferSoftware" would be if an author
is especially sensitive to the higher startup latency or decreased robustness
generally associated with hardware acceleration.
</div>

<dl>
<dt><dfn enum-value for=HardwareAcceleration>allow</dfn></dt>
<dt><dfn enum-value for=HardwareAcceleration>noPreference</dfn></dt>
<dd>
Indicates that the User Agent may use hardware acceleration if it is
available and compatible with other aspects of the codec configuration.
</dd>
<dt><dfn enum-value for=HardwareAcceleration>deny</dfn></dt>
<dt><dfn enum-value for=HardwareAcceleration>preferSoftware</dfn></dt>
<dd>
Indicates that the User Agent must not use hardware acceleration.
Indicates that the User Agent SHOULD prefer a software codec implementation.
User Agents may ignore this value for any reason.

NOTE: This will cause the configuration to be unsupported on platforms where
NOTE: This may cause the configuration to be unsupported on platforms where
an unaccelerated codec is unavailable or is incompatible with other aspects
of the codec configuration.
</dd>
<dt><dfn enum-value for=HardwareAcceleration>require</dfn></dt>
<dt><dfn enum-value for=HardwareAcceleration>preferHardware</dfn></dt>
<dd>
Indicates that the User Agent must use hardware acceleration.
Indicates that the User Agent SHOULD prefer hardware acceleration. User
Agents may ignore this value for any reason.

NOTE: This will cause the configuration to be unsupported on platforms where
NOTE: This may cause the configuration to be unsupported on platforms where
an accelerated codec is unavailable or is incompatible with other aspects of
the codec configuration.
</dd>
Expand Down

0 comments on commit c985f35

Please sign in to comment.