AW: [vorbis] ov_open from memory
Mike
just.me at aon.at
Fri Feb 28 14:17:26 PST 2003
Greetings again,
thank's for the quick reply!
I have a few more questions regarding the parameters of ov_open_callbacks()
and 'struct ov_callback'.
I suppose the first parameter at ov_open_callbacks must be a pointer to my
data in memory.
(This is a little bit opaque, because at documentation version 1.65 -
20020702, the parameter is defined as 'void* datasource', but the parameter
description is the same as the first parameter at ov_open(). (this looks
like a copy&paste mistake))
Now to the callback funktions, where i suppose the following:
Each 'void *datasource' parameter should point to the raw ogg data in
memory.
In read_func, the first parameter (void* ptr) looks like the destination
buffer, the third parameter should be the ammount of bytes to copy. What is
the second parameter (size_t size) used for?
Please let me know and thanks in advance,
Mike
<p><p>-----Ursprüngliche Nachricht-----
Von: owner-vorbis at xiph.org [mailto:owner-vorbis at xiph.org]Im Auftrag von
Michael Smith
Gesendet: 28 February 2003 02:01
An: vorbis at xiph.org
Betreff: Re: [vorbis] ov_open from memory
<p>Mike <just.me at aon.at> said:
> Hi folks,
>
> i would like to know if it is valid to load a whole .ogg file into memory
> and call ov_open like this:
> ov_open(NULL, &OggVorbisFile, pRawData, RawDataLen);
This should work, but may not. It's not the preferred way to do this (see
below).
> An other question is, is it valid to copy some ogg files into one
(resource)
> file, position the filehandle and use ov_read to read only the ogg file
> which starts at the current position of the file handle? (In other words,
> does ov_read return 0 only if the end of file is reached or also if the
> current file content has ended?)
This will not work correctly.
>
> As already mentioned, i use one resourcefile which contains all my data.
> Whats the best way to load the ogg files from the resource file?
Ok. It's pretty straightforward - both for the latter case, where this is
neccesary, and for the from-memory case (where it's preferred). Rather than
using ov_open, use ov_open_callbacks, and implement a set of callbacks that
work for your format (where 'format' might be a large memory buffer, or it
might be a subset of a single file (your resource file).
The callbacks are documented and very straightforward, but if you can't
figure
them out feel free to ask for more specific assisstance here.
Mike
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list