This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18709 - Add SourceBuffer.remove() method
Summary: Add SourceBuffer.remove() method
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Adrian Bateman [MSFT]
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard: tpac2012
Keywords:
Depends on:
Blocks: 18587
  Show dependency treegraph
 
Reported: 2012-08-27 18:06 UTC by Aaron Colwell (c)
Modified: 2012-11-28 18:25 UTC (History)
3 users (show)

See Also:


Attachments

Description Aaron Colwell (c) 2012-08-27 18:06:11 UTC
This is a proposal to add a method to remove time ranges from the SourceBuffer. append() lets the application explicitly add media to the presentation and this would allow it to explicitly remove media.

Here is the proposed signature & some initial ideas about how it should behave.

partial interface SourceBuffer {
  void flush(TimeRanges ranges);
};

- If readyState is not 'open' throw an INVALID_STATE_ERR exception
- ranges.start() is inclusive & ranges.end() is exclusive (ie [0-1) ). Any media data with a starting timestamp within this range will be removed.
- If ranges.end() is in the middle of a group of pictures(GOP), everything between end() and the end of the GOP will be removed.
- If the beginning of a GOP is inside a range, then the whole GOP will be removed.
Comment 1 Philip Jägenstedt 2012-08-28 08:25:49 UTC
TimeRange objects can't be created from script (TimeRanges is not a constructor) so it would have to be something like flush(start, end), unless the only use case is to remove everything covered by another SourceBuffer.

Also, I think remove(...) would be more clear, flush(...) sounds a lot like it has something to do with the playback pipeline, at least this is what I associate it with: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-events-definitions.html#section-events-flush-start
Comment 2 Aaron Colwell (c) 2012-09-21 21:09:23 UTC
Good points. How about this?

partial interface SourceBuffer {
  void reset(double start, double end);
};

- If readyState is not 'open' throw an INVALID_STATE_ERR exception
- start is inclusive & end is exclusive (ie [0-1) ). Any
media data with a starting timestamp within this range will be removed.
- If end is in the middle of a group of pictures(GOP), everything
between end and the end of the GOP will be removed.
- If the beginning of a GOP is inside a range, then the whole GOP will be
removed.
Comment 3 Aaron Colwell (c) 2012-09-21 22:22:39 UTC
(In reply to comment #2)
> Good points. How about this?
> 
> partial interface SourceBuffer {
>   void reset(double start, double end);
> };
> 
> - If readyState is not 'open' throw an INVALID_STATE_ERR exception
> - start is inclusive & end is exclusive (ie [0-1) ). Any
> media data with a starting timestamp within this range will be removed.
> - If end is in the middle of a group of pictures(GOP), everything
> between end and the end of the GOP will be removed.
> - If the beginning of a GOP is inside a range, then the whole GOP will be
> removed.

Make that remove() not reset()
Comment 4 Philip Jägenstedt 2012-09-24 08:01:57 UTC
That sounds OK to me.
Comment 5 Aaron Colwell (c) 2012-11-28 18:25:40 UTC
Changes committed.

Initial remove() IDL and algorithm added
http://dvcs.w3.org/hg/html-media/rev/4d013fe2dbec

Updated algorithm to describe what happens if the current playback position is removed.
http://dvcs.w3.org/hg/html-media/rev/0c638da9a67a