[RoarAudio] Fun with libroaross and HT_VIO

Philipp Schafft lion at lion.leolix.org
Fri Jun 25 02:08:22 CEST 2010


flum,

I just added this function to libroaross:
 int libroaross_open_vio(struct handle         ** handleret,
                         struct roar_vio_calls ** vio,
                         int                      flags);

This function can be used to create a file handle from a VIO object.
It will return a file handle and a vio struct (as parameter) which get
linkted together.
The VIO handle should be ignored after open and MUST NOT be closed.
The file handle MUST be closed as soon as work is done.

The vio structure is inited with a dummy. If opening the vio fails it
should be reinited with roar_vio_init_calls() to get back into a defined
and save state before closing the filehandle.
If the file handle is closed while the vio is in undefined state behavor
is undefined and may result in crash and data lose.

I attach an example on how to use this function.
it can be compiled using this command:
 $ cc -Wall -Wextra -g -O2 -o libroarosstest libroarosstest.c -lroaross

Please note that the typedef and explicit prototype at the begin is
subject to change.

Consider this function at best as experimental.

Expected output is something like this:
 fh=3
 Hello World!


Happy hacking!

-- 
Philipp.
 (Rah of PH2)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libroarosstest.c
Type: text/x-csrc
Size: 440 bytes
Desc: not available
URL: <http://lists.keep-cool.org/pipermail/roaraudio/attachments/20100625/78fce790/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.keep-cool.org/pipermail/roaraudio/attachments/20100625/78fce790/attachment.pgp>


More information about the RoarAudio mailing list