2 * Copyright (C) 2010 Andre Noll <maan@tuebingen.mpg.de>
4 * Licensed under the GPL v2. For licencing details see COPYING.
8 * \file ogg_afh_common.h Structures and prototypes common to audio format
9 * handlers that use the ogg container format.
13 * Callback structure provided by audio format handlers.
15 * All audio formats which utilize the ogg container format define a callback
16 * function whose purpose is to extract the meta information about the audio
17 * file from the first few ogg packets of the bitstream.
19 struct ogg_afh_callback_info {
21 * ogg_get_file_info() calls this function for the first three ogg
22 * packets, or until the callback returns a non-positive value. If it
23 * returns negative, the audio file was not recognized by the audio
24 * format handler. If it returns zero, the audio file is considered
25 * valid, and no further processing by the callback is needed. In this
26 * case the header chunk, i.e. chunk number zero, is defined as the
27 * concatenation of all packets that have been processed by the
30 int (*packet_callback)(ogg_packet *packet, int packet_num,
31 int serial, struct afh_info *afhi, void *private_data);
32 /** Data specific to the audio format handler. */
36 int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
37 struct ogg_afh_callback_info *ci);
38 int ogg_rewrite_tags(const char *map, size_t mapsize, int fd,
39 char *meta_packet, size_t meta_sz);