[Webkit-unassigned] [Bug 51424] Add WebKitClient::createAudioDevice() for Chromium port of web audio API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 21 16:49:38 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=51424





--- Comment #10 from Chris Rogers <crogers at google.com>  2010-12-21 16:49:38 PST ---
(In reply to comment #8)
> (In reply to comment #7)
> > >> WebKit/chromium/public/WebAudioDevice.h:45
> > >> +    typedef void (*RenderCallback)(std::vector<float*>& audioData, size_t numberOfFrames, void* userData);
> > > 
> > > note: we do not use STL types in the WebKit API.  please use WebVector, or just use a raw float* here.  do you need the callee to allocate the audioData buffer, or will it be preallocated to the maximum size by the caller?  if it will be preallocated, then passing a raw float* would seem fine.
> > 
> > FIXED: I switched over to WebVector.  I can't use raw float* since it's an array of pointers to float (planar non-interleaved)
> 
> oh, right!  what about float** then?  aren't you concerned about the overhead of copying the buffers that a WebVector imposes?

The only overhead is copying the pointers, but not the actual PCM data.  But, if you really don't like WebVector, then we can switch to float**.
WebVector just seems a little safer, since we can check its size...



> 
> > > however the downside to it being an inner class is that you force WebKitClient.h
> > > to also #include WebAudioDevice.h.  it would be nice to avoid that.
> > 
> > FIXED: added the new line and changed this to use an inner class as you suggest instead of old-fashioned callback
> 
> i also suggested not using inner classes since it forces a #include.  any thoughts
> on that?

It's up to you.  I like the inner class since it seems cleaner, but if you feel the extra include is too big a build-time penalty then I can change it...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list