W3C home > Mailing lists > Public > public-media-capture@w3.org > July 2013

Re: Mediastream Recording implementation

From: Robert O'Callahan <robert@ocallahan.org>
Date: Wed, 17 Jul 2013 10:54:01 +1200
Message-ID: <CAOp6jLYUgn7xarTTszZ75UtXsuO2JoT+gqrs10Ucwq5sef+Q5Q@mail.gmail.com>
To: Greg Billock <gbillock@google.com>
Cc: Travis Leithead <travis.leithead@microsoft.com>, Jim Barnett <Jim.Barnett@genesyslab.com>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On Wed, Jul 17, 2013 at 10:33 AM, Greg Billock <gbillock@google.com> wrote:

> For access to streaming output of the encoder, ArrayBuffer seems to me
> more appropriate. It's compatible with XHR2, File, and direct manipulation.

So are Blobs.

Blobs also have the nice property that they're immutable and can therefore
be shared easily between pages/across processes without copying.
ArrayBuffers don't have that property. The only advantage ArrayBuffers
have, in my view, is that individual bytes can be read and mutated very
efficiently. Do we have use-cases for that sort of mutation of recorded
data --- that would not be adequately served by making a copy of (parts of)
Blobs to mutate them?

Blobs also offer efficient concatenation (without copying), which
ArrayBuffers do not.

If you want to make a Blob out of it, you can, of course, but ordinarily
> you'd be collecting these slices to manually append them somewhere or
> sending them off as media stream slices.

I actually think Blobs (memory-backed) can be more efficient than
ArrayBuffers for streaming (via Websockets for example), because we can
share the Blob's memory buffer between processes without copying or
breaking semantics.

I also think that it's simpler to have a single data delivery event that
produces a Blob, than to have separate events one of which produces a Blob
and the other which produces an ArrayBuffer.

Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
Received on Tuesday, 16 July 2013 22:54:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:18 UTC