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 21159 - SourceBuffer appendArrayBuffer should take ArrayBufferView
Summary: SourceBuffer appendArrayBuffer should take ArrayBufferView
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Aaron Colwell (c)
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-28 21:50 UTC by Mark Watson
Modified: 2013-03-05 17:27 UTC (History)
5 users (show)

See Also:


Attachments

Description Mark Watson 2013-02-28 21:50:07 UTC
Presently the SourceBuffer appendArrayBuffer method takes an ArrayBuffer argument, meaning that there is an additional copy whenever the data to be appended is not already in a single ArrayBuffer object (for example if only part of an ArrayBuffer received from XmlHttpRequest is to be appended).

Consider changing this to ArrayBufferView, so that view objects like Uint8Arrays can be appended (as in the original webkitSourceAppend).
Comment 1 Aaron Colwell (c) 2013-03-04 17:38:14 UTC
Any preference on the method name?
1. Keep as appendArrayBuffer()
2. Change to appendArrayBufferView()
3. Change to appendBuffer()
4. Other suggestions welcome.
Comment 2 Adrian Bateman [MSFT] 2013-03-04 19:37:20 UTC
I think the method can be overloaded to accept either an ArrayBuffer or ArrayBufferView. This is what we've done elsewhere in the platform.

I'm not precious about the naming but prefer to settle on something sooner rather than later if we're going to make a change.
Comment 3 Aaron Colwell (c) 2013-03-04 20:04:54 UTC
(In reply to comment #2)
> I think the method can be overloaded to accept either an ArrayBuffer or
> ArrayBufferView. This is what we've done elsewhere in the platform.
> 
> I'm not precious about the naming but prefer to settle on something sooner
> rather than later if we're going to make a change.

Ok. How about we just call it appendBuffer() and I'll add the 2 overloads.

void appendBuffer(ArrayBuffer)
void appendBuffer(ArrayBufferView)

That way if we come across some other buffer type we need to add, we can just add the extra overload w/o changing the method name.
Comment 4 Aaron Colwell (c) 2013-03-05 17:27:52 UTC
Changes committed.
https://dvcs.w3.org/hg/html-media/rev/dcd406812201