Blame doc/vorbisfile/ov_callbacks.html

Packit 06404a
<html>
Packit 06404a
Packit 06404a
<head>
Packit 06404a
<title>Vorbisfile - datatype - ov_callbacks</title>
Packit 06404a
<link rel=stylesheet href="style.css" type="text/css">
Packit 06404a
</head>
Packit 06404a
Packit 06404a
<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
Packit 06404a
Packit 06404a
Packit 06404a

Vorbisfile documentation

Packit 06404a

vorbisfile version 1.3.2 - 20101101

Packit 06404a
Packit 06404a
Packit 06404a
Packit 06404a

ov_callbacks

Packit 06404a
Packit 06404a

declared in "vorbis/codec.h"

Packit 06404a
Packit 06404a

Packit 06404a
The ov_callbacks structure contains file manipulation function prototypes necessary for opening, closing, seeking, and location.
Packit 06404a
Packit 06404a

Packit 06404a
The ov_callbacks structure does not need to be user-defined if you are
Packit 06404a
working with stdio-based file manipulation; the 
Packit 06404a
href="ov_fopen.html">ov_fopen() and 
Packit 06404a
href="ov_open.html">ov_open() calls internally provide default callbacks for
Packit 06404a
stdio.  ov_callbacks are defined and passed to 
Packit 06404a
href="ov_open_callbacks.html">ov_open_callbacks() when
Packit 06404a
implementing non-stdio based stream manipulation (such as playback
Packit 06404a
from a memory buffer) or when 
Packit 06404a
href="ov_open.html#winfoot">ov_open()-style initialization from a <tt>FILE *</tt> is required under Windows [a].
Packit 06404a

Packit 06404a
Packit 06404a
Packit 06404a
Packit 06404a
	
Packit 06404a
typedef struct {
Packit 06404a
  size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
Packit 06404a
  int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
Packit 06404a
  int    (*close_func) (void *datasource);
Packit 06404a
  long   (*tell_func)  (void *datasource);
Packit 06404a
} ov_callbacks;
Packit 06404a
	
Packit 06404a
Packit 06404a
Packit 06404a
Packit 06404a

Relevant Struct Members

Packit 06404a
Packit 06404a
read_func
Packit 06404a
Pointer to custom data reading function.
Packit 06404a
seek_func
Packit 06404a
Pointer to custom data seeking function. If the data source is not seekable (or the application wants the data source to be treated as unseekable at all times), the provided seek callback should always return -1 (failure) or the <tt>seek_func</tt> and <tt>tell_func</tt> fields should be set to NULL.
Packit 06404a
close_func
Packit 06404a
Pointer to custom data source closure function. Set to NULL if libvorbisfile should not attempt to automatically close the file/data handle.
Packit 06404a
tell_func
Packit 06404a
Pointer to custom data location function. If the data source is not seekable (or the application wants the data source to be treated as unseekable at all times), the provided tell callback should always return -1 (failure) or the <tt>seek_func</tt> and <tt>tell_func</tt> fields should be set to NULL.
Packit 06404a
Packit 06404a
Packit 06404a

Packit 06404a
Packit 06404a

Predefined callbacks

Packit 06404a
The header vorbis/vorbisfile.h provides several predefined static ov_callbacks structures that may be passed to 
Packit 06404a
href="ov_open_callbacks.html">ov_open_callbacks():
Packit 06404a
Packit 06404a
<tt>OV_CALLBACKS_DEFAULT</tt>
Packit 06404a
Packit 06404a
These callbacks provide the same behavior as used internally by 
Packit 06404a
href="ov_fopen.html">ov_fopen() and 
Packit 06404a
href="ov_open.html">ov_open().
Packit 06404a
Packit 06404a
<tt>OV_CALLBACKS_NOCLOSE</tt>
Packit 06404a
Packit 06404a
The same as <tt>OV_CALLBACKS_DEFAULT</tt>, but with the
Packit 06404a
<tt>close_func</tt> field set to NULL.  The most typical use would be
Packit 06404a
to use ov_open_callbacks() to
Packit 06404a
provide the same behavior as ov_open(), but
Packit 06404a
not close the file/data handle in 
Packit 06404a
href="ov_clear.html">ov_clear().
Packit 06404a
Packit 06404a
<tt>OV_CALLBACKS_STREAMONLY</tt>
Packit 06404a
Packit 06404a
A set of callbacks that set <tt>seek_func</tt> and <tt>tell_func</tt>
Packit 06404a
to NULL, thus forcing strict streaming-only behavior regardless of
Packit 06404a
whether or not the input is actually seekable.
Packit 06404a
Packit 06404a
<tt>OV_CALLBACKS_STREAMONLY_NOCLOSE</tt>
Packit 06404a
Packit 06404a
The same as <tt>OV_CALLBACKS_STREAMONLY</tt>, but with
Packit 06404a
<tt>close_func</tt> also set to null, preventing libvorbisfile from
Packit 06404a
attempting to close the file/data handle in 
Packit 06404a
href="ov_clear.html">ov_clear().
Packit 06404a
Packit 06404a
Packit 06404a

Packit 06404a
Packit 06404a

Examples and usage

Packit 06404a
Packit 06404a
See the callbacks and non-stdio I/O document for more
Packit 06404a
detailed information on required behavior of the various callback
Packit 06404a
functions.

Packit 06404a
Packit 06404a


Packit 06404a

Packit 06404a
Packit 06404a
Packit 06404a

copyright © 2000-2010 Xiph.Org

Packit 06404a

Ogg Vorbis

Packit 06404a
Packit 06404a

Vorbisfile documentation

Packit 06404a

vorbisfile version 1.3.2 - 20101101

Packit 06404a
Packit 06404a
Packit 06404a
Packit 06404a
</body>
Packit 06404a
Packit 06404a
</html>