Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specific rebufferingGoal override manifest one #1547 #1581

Merged
merged 6 commits into from
Sep 21, 2018

Conversation

fadomire
Copy link
Contributor

@fadomire fadomire commented Sep 12, 2018

EDIT: pull request updated to add manifest.dash.ignoreMinBufferTime

i'm not really satisfied of adding a defaultRebufferingGoal to config but at least changes in code are very light

see #1547

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@fadomire
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

add the config field manifest.dash.ignoreMinBufferTime, which will default to false. If true, the DASH parser will ignore minBufferTime in the manifest, such that streaming.rebufferingGoal is the only factor in play.
let ignoreMinBufferTime = this.config_.dash.ignoreMinBufferTime;
let minBufferTime = 0;
if (!ignoreMinBufferTime) {
minBufferTime =
XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseAttr() can return null if there's no such attribute, so please add || 0 to the end of this statement.

@@ -101,6 +101,7 @@ shaka.util.PlayerConfiguration = class {
ignoreDrmInfo: false,
xlinkFailGracefully: false,
defaultPresentationDelay: 10,
ignoreMinBufferTime: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be added to externs/shaka/player.js, in the shaka.extern.DashManifestConfiguration type. Please add @property to describe the property, and also add it to the @typedef block.

This will probably produce a few build errors, as the DASH config object in several of our tests will need to be updated to match the updated type. Be sure to run python build/all.py and fix any errors that come up.

After that, please add a new test in test/dash/dash_parser_manifest_unit.js that shows the effect of ignoreMinBufferTime. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not yet sure on how to write a test properly but will check it later on

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest looking at the very last test in that file ('exposes Representation IDs') as a template.

The important parts of the test are:

  1. Fake manifest text. This can be very simple for your case, with only one Representation.
  2. A call to fakeNetEngine.setResponseText() so the fake manifest text gets returned from the networking engine.
  3. Any necessary configuration passed to parser.configure(). For you, this should set the new flag.
  4. The (async) call to parser.start() to parse the manifest and get the results.
  5. Expectations on the output. You would expect that minBufferTime is 0, in spite of the attribute in the manifest text.

Does that help?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitly help, thanks

@joeyparrish
Copy link
Member

Thank you for contributing! You should also add yourself to CONTRIBUTORS and AUTHORS files (alphabetically).

@@ -536,6 +537,10 @@ shaka.extern.DrmConfiguration;
* @property {number} defaultPresentationDelay
* A default presentationDelay if suggestedPresentationDelay is missing
* in the MPEG DASH manifest. This has to be bigger than minBufferTime * 1.5.
* @property {boolean} ignoreMinBufferTime
* If true will cause DASH parser to ignore minBufferTime from manifest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor English nit: This sentence needs a period at the end, and the next line should begin with a capital letter.

@fadomire
Copy link
Contributor Author

fadomire commented Sep 19, 2018

i added 2 tests for ignoreMinBufferTime

  • one to check that when ignoreMinBufferTime is true minBufferTime is 0
  • another to verify when it is false it should respect manifest minBufferTime

dont know if the second one is necessary or if it is already tested somehow

Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks!

@shaka-bot
Copy link
Collaborator

All tests passed!

@joeyparrish joeyparrish merged commit 99ebc69 into shaka-project:master Sep 21, 2018
@joeyparrish
Copy link
Member

Released in v2.5.0-beta2.

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants