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

MSE: Blink portion of non-preemptive eviction policy API #19581

Closed
wants to merge 1 commit into from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

This is the second part of landing an experimental prototype of new
non-preemptive MSE eviction policies. Combined prototype CL is [1].
First part (Chromium portion) is [2].

This CL adds an experimental (MediaSourceExperimental) new MSE API to
modify the eviction policy of a SourceBuffer. Successful setting of the
eviction policy is constrained to only be allowed before the
SourceBuffer has processed its first initialization segment.

The pre-existing, now default, logic uses the "normal" policy. Two new
policies are added: "before-next-demuxed" and "before-current-gop". The
latter currently has no different behavior in the Chromium
implementation: it behaves precisely like the default "normal" policy.
Later CLs may refine or remove "before-current-gop".

"before-next-demuxed" enables new "infinite GOP" buffering scenarios,
where the keyframe interval might be extreme and prevent successful
buffering of an entire huge GOP if using the "normal" policy. As part of
the prepare append algorithm, "before-next-demuxed" removes anything
buffered before the next demuxed frame (including any previous buffered
ranges). Note that if the next demuxed position is not within any
buffered range, this policy may preserve buffered ranges earlier than
current media time. This allows for newly buffered GOPs for current
media time to have their keyframes preserved until they are demuxed.
This mode will fall-back to the "normal" policy if not enough space has
been freed to accommodate the newly appended data, and may emit quota
exception if even "normal" policy fails to free enough space.

Naming of the new eviction policies may change during
discussion/feedback on the incubation proposal/explainer, which also
needs updating to reflect design decisions taken during this prototype's
development so far. Versus the original explainer, this prototype:

  • Gives exception on changing the eviction policy after "first
    initialization segment received flag" is true. Later spec smithing
    could re-allow this, for instance, to switch back to "normal" to
    accomplish a (deterministic) seek, if this limitation is undesired.

  • Prevents seeking if using "before-next-demuxed" eviction policy in an
    active SourceBuffer. Seeking would introduce complexities such as
    indeterminate behavior especially if asynch append, perhaps on worker
    context, is concurrent with seek, and seek evicts all "partial GOPS"
    whose keyframes are no longer buffered. Later spec smithing could
    re-allow this if such indeterminacy is non-prohibitive.

  • Mechanism: HTMLME::seekable reports empty range if any
    activeSourceBuffer is using before-next-demuxed.

  • set,clearLiveSeekableRange unchanged, since the ::seekable logic for
    before-next-demuxed returns early with empty range

  • See the Chromium-side CL [2] for further discussion of some internal
    range seeking/selection behavior that is retained even in
    "before-next-demuxed".

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1616976
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1848364

Explainer (may still be the original one, that has since been
constrained to prevent seeking, for instance, by this prototype):
https://github.com/wicg/media-source/blob/mse-eviction-policies/mse-eviction-policies-explainer.md

BUG=963717

Change-Id: Ic1b4abc8f6de9b8012fb9b73e8fef8668c2a6c1a
Reviewed-on: https://chromium-review.googlesource.com/1847748
WPT-Export-Revision: d48bf88d1cb6fcb82a76aa1a0490117b15544cb9

This is the second part of landing an experimental prototype of new
non-preemptive MSE eviction policies. Combined prototype CL is [1].
First part (Chromium portion) is [2].

This CL adds an experimental (MediaSourceExperimental) new MSE API to
modify the eviction policy of a SourceBuffer. Successful setting of the
eviction policy is constrained to only be allowed before the
SourceBuffer has processed its first initialization segment.

The pre-existing, now default, logic uses the "normal" policy. Two new
policies are added: "before-next-demuxed" and "before-current-gop". The
latter currently has no different behavior in the Chromium
implementation: it behaves precisely like the default "normal" policy.
Later CLs may refine or remove "before-current-gop".

"before-next-demuxed" enables new "infinite GOP" buffering scenarios,
where the keyframe interval might be extreme and prevent successful
buffering of an entire huge GOP if using the "normal" policy. As part of
the prepare append algorithm, "before-next-demuxed" removes anything
buffered before the next demuxed frame (including any previous buffered
ranges). Note that if the next demuxed position is not within any
buffered range, this policy may preserve buffered ranges earlier than
current media time. This allows for newly buffered GOPs for current
media time to have their keyframes preserved until they are demuxed.
This mode will fall-back to the "normal" policy if not enough space has
been freed to accommodate the newly appended data, and may emit quota
exception if even "normal" policy fails to free enough space.

Naming of the new eviction policies may change during
discussion/feedback on the incubation proposal/explainer, which also
needs updating to reflect design decisions taken during this prototype's
development so far. Versus the original explainer, this prototype:

* Gives exception on changing the eviction policy after "first
  initialization segment received flag" is true. Later spec smithing
  could re-allow this, for instance, to switch back to "normal" to
  accomplish a (deterministic) seek, if this limitation is undesired.

* Prevents seeking if using "before-next-demuxed" eviction policy in an
  active SourceBuffer. Seeking would introduce complexities such as
  indeterminate behavior especially if asynch append, perhaps on worker
  context, is concurrent with seek, and seek evicts all "partial GOPS"
  whose keyframes are no longer buffered. Later spec smithing could
  re-allow this if such indeterminacy is non-prohibitive.
 * Mechanism: HTMLME::seekable reports empty range if any
   activeSourceBuffer is using before-next-demuxed.
 * set,clearLiveSeekableRange unchanged, since the ::seekable logic for
   before-next-demuxed returns early with empty range
 * See the Chromium-side CL [2] for further discussion of some internal
   range seeking/selection behavior that is retained even in
   "before-next-demuxed".

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1616976
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1848364

Explainer (may still be the original one, that has since been
constrained to prevent seeking, for instance, by this prototype):
https://github.com/wicg/media-source/blob/mse-eviction-policies/mse-eviction-policies-explainer.md

BUG=963717

Change-Id: Ic1b4abc8f6de9b8012fb9b73e8fef8668c2a6c1a
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

Already reviewed downstream.

@gsnedders gsnedders closed this Jan 24, 2020
@gsnedders gsnedders deleted the chromium-export-cl-1847748 branch January 24, 2020 18:04
@gsnedders gsnedders restored the chromium-export-cl-1847748 branch January 24, 2020 18:46
@Hexcles Hexcles reopened this Jan 24, 2020
@KyleJu KyleJu closed this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants