Chris@1: Chris@1: Chris@1: Chris@1: Vorbisfile - function - ov_test_callbacks Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

Chris@1: Chris@1:

ov_test_callbacks

Chris@1: Chris@1:

declared in "vorbis/vorbisfile.h";

Chris@1: Chris@1:

This is an alternative function used to open and test an OggVorbis_File Chris@1: structure when using a data source other than a file, Chris@1: when its necessary to modify default file access behavior, or to Chris@1: test for Vorbis content from a FILE * pointer under Chris@1: Windows where ov_test() cannot be used. It Chris@1: allows the application to specify custom file manipulation routines Chris@1: and sets up all the related decoding structures. Chris@1: Chris@1:

Once this has been called, the same OggVorbis_File Chris@1: struct should be passed to all the libvorbisfile functions. Chris@1:

Chris@1:

Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1:

Chris@1: int ov_test_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
Chris@1: 
Chris@1:
Chris@1: Chris@1:

Parameters

Chris@1:
Chris@1:
f
Chris@1:
File pointer to an already opened file Chris@1: or pipe (it need not be seekable--though this obviously restricts what Chris@1: can be done with the bitstream).
Chris@1:
vf
Chris@1:
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile Chris@1: functions. Once this has been called, the same OggVorbis_File Chris@1: struct should be passed to all the libvorbisfile functions.
Chris@1:
initial
Chris@1:
Typically set to NULL. This parameter is useful if some data has already been Chris@1: read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial Chris@1: should be a pointer to a buffer containing the data read.
Chris@1:
ibytes
Chris@1:
Typically set to 0. This parameter is useful if some data has already been Chris@1: read from the file and the stream is not seekable. In this case, ibytes Chris@1: should contain the length (in bytes) of the buffer. Used together with initial.
Chris@1:
callbacks
Chris@1:
A completed ov_callbacks struct which indicates desired custom file manipulation routines. vorbisfile.h defines several preprovided callback sets; see ov_callbacks for details.
Chris@1:
Chris@1: Chris@1: Chris@1:

Return Values

Chris@1:
Chris@1:
  • 0 for success
  • Chris@1:
  • less than zero for failure:
  • Chris@1: Chris@1:
    Chris@1:

    Chris@1: Chris@1:

    Notes

    Chris@1:
    Chris@1: Chris@1:
    [a] Windows and use as an ov_test() substitute

    Windows Chris@1: applications should not use ov_test() due Chris@1: to the likelihood of CRT linking Chris@1: mismatches and runtime protection faults Chris@1: [ov_open:a]. ov_test_callbacks() is a safe substitute; specifically: Chris@1: Chris@1:

    ov_test_callbacks(f, vf, initial, ibytes, OV_CALLBACKS_DEFAULT);
    Chris@1: 
    Chris@1: Chris@1: ... provides exactly the same functionality as ov_test() but will always work correctly under Chris@1: Windows, regardless of linking setup details.

    Chris@1: Chris@1:

    Chris@1: Chris@1:

    Chris@1:
    Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

    copyright © 2000-2010 Xiph.Org

    Ogg Vorbis

    Vorbisfile documentation

    vorbisfile version 1.3.2 - 20101101

    Chris@1: Chris@1: Chris@1: Chris@1: