Re: ArrayBuffer / Buffer Objects in C++ Addons

1,067 views
Skip to first unread message

darcy

unread,
Oct 28, 2012, 11:07:37 PM10/28/12
to nod...@googlegroups.com
http://deadhorse.me/nodejs/2012/10/10/c_addon_in_nodejs_buffer.html

This page may be helpful, although it's chinese.

On Sunday, October 28, 2012 3:55:30 AM UTC+8, Henri Tuhola wrote:
I'd need to pass some binary data out of an addon, but node.js addon documentation doesn't seem to cover it.

This is what I'm working on: https://github.com/cheery/node-video

node-video needs the buffer objects to provide composite/native window handles that can be transferred over unix sockets.

The link mentions webgl. There seems to be two authors who have tried to provide WebGL bindings to node.js a year ago, but I don't know whether either of their approach to TypedArray or Image do any good. Some of the bindings can be copied along though. :)

Ben Noordhuis

unread,
Oct 29, 2012, 7:53:07 AM10/29/12
to nod...@googlegroups.com
On Sat, Oct 27, 2012 at 9:55 PM, Henri Tuhola <henri....@gmail.com> wrote:
> I'd need to pass some binary data out of an addon, but node.js addon
> documentation doesn't seem to cover it.
>
> This is what I'm working on: https://github.com/cheery/node-video
>
> node-video needs the buffer objects to provide composite/native window
> handles that can be transferred over unix sockets.
>
> The link mentions webgl. There seems to be two authors who have tried to
> provide WebGL bindings to node.js a year ago, but I don't know whether
> either of their approach to TypedArray or Image do any good. Some of the
> bindings can be copied along though. :)

node.js supports typed arrays. This issue[1] contains an example on
how to interact with them from C++ code. There is also the Buffer
class, check src/node_buffer.h for details.

[1] https://github.com/joyent/node/issues/4201
Reply all
Reply to author
Forward
0 new messages