cannam@86: cannam@86: cannam@86: cannam@86: Vorbisfile - function - ov_test_callbacks cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

cannam@86: cannam@86:

ov_test_callbacks

cannam@86: cannam@86:

declared in "vorbis/vorbisfile.h";

cannam@86: cannam@86:

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

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

cannam@86:

cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86:

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

Parameters

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

Return Values

cannam@86:
cannam@86:
  • 0 for success
  • cannam@86:
  • less than zero for failure:
  • cannam@86: cannam@86:
    cannam@86:

    cannam@86: cannam@86:

    Notes

    cannam@86:
    cannam@86: cannam@86:
    [a] Windows and use as an ov_test() substitute

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

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

    cannam@86: cannam@86:

    cannam@86: cannam@86:

    cannam@86:
    cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:

    copyright © 2000-2010 Xiph.Org

    Ogg Vorbis

    Vorbisfile documentation

    vorbisfile version 1.3.2 - 20101101

    cannam@86: cannam@86: cannam@86: cannam@86: