[ANN] glibvnc - Go wrapper for C library libvnc

286 views
Skip to first unread message

Luke Mauldin

unread,
Jan 7, 2014, 11:00:37 AM1/7/14
to golan...@googlegroups.com
Announcing  glibvnc, a Go wrapper for C library libvnc: https://github.com/LukeMauldin/glibvnc The package exposes both the server and client functionality of libvnc.

gvncrecord: https://github.com/LukeMauldin/gvncrecord is an example of a package using glibvnc.  gvncrecord connects to a VNC server and sends the result through FFMPEG to write an mp4 file.


I would greatly appreciate code reviews of both packages and I welcome all of your feedback.  Thank you,

Luke Mauldin

Hǎiliàng

unread,
Jan 15, 2014, 9:52:34 PM1/15/14
to golan...@googlegroups.com
Would you consider automatically generate the wrapper using https://github.com/hailiang/cwrap ?

Hǎiliàng

Luke Mauldin

unread,
Jan 16, 2014, 5:48:25 PM1/16/14
to golan...@googlegroups.com
Yes, I actually used cwrap to generate the initial files.  However, as mentioned on the cwrap website there can be problems converting from Go structs to C structs and vice versa (due to padding, alignment, etc...) and the structs rfbServer and rfbClient were very large C structs so I thought there would be issues if I tried to use cwrap.  In addition, I wanted to change the methods to have the methods attached to the rfbServer and rfbClient rather than accepting them as the first parameter.

Luke

Hailiang Wang

unread,
Jan 20, 2014, 8:31:46 PM1/20/14
to Luke Mauldin, golang-nuts
cwrap is able to attach functions to the first parameter as method as
long as its a struct pointer.

For the struct, if it is allocated by c, and its members are not
accessed directly, there could be no issues.

Hǎiliàng
Reply all
Reply to author
Forward
0 new messages