Bug 18709 - Add SourceBuffer.remove() method
Add SourceBuffer.remove() method
Status: RESOLVED FIXED
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions
unspecified
PC Linux
: P2 normal
: ---
Assigned To: Adrian Bateman [MSFT]
HTML WG Bugzilla archive list
tpac2012
:
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

Note You need to log in before you can comment on or make changes to this bug.
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