Skip to content

Commit

Permalink
Add config to disableXlinkProcessing (#3240)
Browse files Browse the repository at this point in the history
Xlink processing is very slow on some TVs.

This adds a configuration parameter to disable that feature, for platforms that won't use it.
  • Loading branch information
Álvaro Velad Galván committed Mar 17, 2021
1 parent 9c2315e commit 014e146
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/common/message_ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ shakaDemo.MessageIds = {
DISABLE_TEXT: 'DEMO_DISABLE_TEXT',
DISABLE_THUMBNAILS: 'DEMO_DISABLE_THUMBNAILS',
DISABLE_VIDEO: 'DEMO_DISABLE_VIDEO',
DISABLE_XLINK_PROCESSING: 'DEMO_DISABLE_XLINK_PROCESSING',
DRM_RETRY_SECTION_HEADER: 'DEMO_DRM_RETRY_SECTION_HEADER',
DRM_SECTION_HEADER: 'DEMO_DRM_SECTION_HEADER',
DURATION_BACKOFF: 'DEMO_DURATION_BACKOFF',
Expand Down
2 changes: 2 additions & 0 deletions demo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ shakaDemo.Config = class {
'manifest.dash.ignoreDrmInfo')
.addBoolInput_(MessageIds.AUTO_CORRECT_DASH_DRIFT,
'manifest.dash.autoCorrectDrift')
.addBoolInput_(MessageIds.DISABLE_XLINK_PROCESSING,
'manifest.dash.disableXlinkProcessing')
.addBoolInput_(MessageIds.XLINK_FAIL_GRACEFULLY,
'manifest.dash.xlinkFailGracefully')
.addBoolInput_(MessageIds.IGNORE_DASH_SUGGESTED_PRESENTATION_DELAY,
Expand Down
1 change: 1 addition & 0 deletions demo/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"DEMO_DISABLE_TEXT": "Disable Text",
"DEMO_DISABLE_THUMBNAILS": "Disable Thumbnails",
"DEMO_DISABLE_VIDEO": "Disable Video",
"DEMO_DISABLE_XLINK_PROCESSING": "Disable Xlink processing",
"DEMO_DOCUMENTATION": "Documentation",
"DEMO_DRM_RETRY_SECTION_HEADER": "DRM Retry Parameters",
"DEMO_DRM_SEARCH": "DRM",
Expand Down
4 changes: 4 additions & 0 deletions demo/locales/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@
"description": "The name of a configuration value.",
"message": "Disable Video"
},
"DEMO_DISABLE_XLINK_PROCESSING": {
"description": "The name of a configuration value.",
"message": "Disable [JARGON:Xlink] processing"
},
"DEMO_DOCUMENTATION": {
"description": "A link in the footer, to the Shaka Player documentation.",
"message": "Documentation"
Expand Down
4 changes: 4 additions & 0 deletions externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ shaka.extern.DrmConfiguration;
* @typedef {{
* clockSyncUri: string,
* ignoreDrmInfo: boolean,
* disableXlinkProcessing: boolean,
* xlinkFailGracefully: boolean,
* ignoreMinBufferTime: boolean,
* autoCorrectDrift: boolean,
Expand All @@ -629,6 +630,9 @@ shaka.extern.DrmConfiguration;
* If true will cause DASH parser to ignore DRM information specified
* by the manifest and treat it as if it signaled no particular key
* system and contained no init data. Defaults to false if not provided.
* @property {boolean} disableXlinkProcessing
* If true, xlink-related processing will be disabled. Defaults to
* <code>false</code> if not provided.
* @property {boolean} xlinkFailGracefully
* If true, xlink-related errors will result in a fallback to the tag's
* existing contents. If false, xlink-related errors will be propagated
Expand Down
4 changes: 4 additions & 0 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ shaka.dash.DashParser = class {
Error.Severity.CRITICAL, Error.Category.MANIFEST,
Error.Code.DASH_INVALID_XML, finalManifestUri);
}
const disableXlinkProcessing = this.config_.dash.disableXlinkProcessing;
if (disableXlinkProcessing) {
return this.processManifest_(mpd, finalManifestUri);
}

// Process the mpd to account for xlink connections.
const failGracefully = this.config_.dash.xlinkFailGracefully;
Expand Down
1 change: 1 addition & 0 deletions lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ shaka.util.PlayerConfiguration = class {
dash: {
clockSyncUri: '',
ignoreDrmInfo: false,
disableXlinkProcessing: false,
xlinkFailGracefully: false,
ignoreMinBufferTime: false,
autoCorrectDrift: true,
Expand Down

0 comments on commit 014e146

Please sign in to comment.