1 /* Copyright (C) 2010 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
4 * \file ogg_afh_common.h Structures and prototypes common to audio format
5 * handlers that use the ogg container format.
8 __malloc struct oac_custom_header *oac_custom_header_new(void);
9 void oac_custom_header_init(int serial, struct oac_custom_header *h);
10 int oac_custom_header_append(ogg_packet *op, struct oac_custom_header *h);
11 void oac_custom_header_flush(struct oac_custom_header *h);
12 size_t oac_custom_header_get(char **buf, struct oac_custom_header *h);
15 * Callback structure provided by audio format handlers.
17 * All audio formats which utilize the ogg container format define a callback
18 * function whose purpose is to extract the meta information about the audio
19 * file from the first few ogg packets of the bitstream.
21 struct oac_callback_info {
23 * ogg_get_file_info() calls this function for the first three ogg
24 * packets, or until the callback returns a non-positive value. If it
25 * returns negative, the audio file was not recognized by the audio
26 * format handler. If it returns zero, the audio file is considered
27 * valid, and no further processing by the callback is needed. In this
28 * case the header chunk, i.e. chunk number zero, is defined as the
29 * concatenation of all packets that have been processed by the
32 int (*packet_callback)(ogg_packet *packet, int packet_num,
33 int serial, struct afh_info *afhi, void *private_data);
34 /** Data specific to the audio format handler. */
38 int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
39 struct oac_callback_info *ci);
40 int oac_rewrite_tags(const char *map, size_t mapsize, int fd,
41 char *meta_packet, size_t meta_sz);