X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh_common.h;h=e0cf2d40c3ffb825c9f19338aa792558cb1c8742;hp=89c8268b1fa0335bf98675c89135a7d1531a9630;hb=3685a9093ae12ff9ce02fc58e607eb9b63894443;hpb=92e4a0579a320372d2e94efc7c2a0d9f419e3ffe diff --git a/ogg_afh_common.h b/ogg_afh_common.h index 89c8268b..e0cf2d40 100644 --- a/ogg_afh_common.h +++ b/ogg_afh_common.h @@ -1,33 +1,41 @@ -/* - * Copyright (C) 2010-2011 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2010 Andre Noll , see file COPYING. */ /** * \file ogg_afh_common.h Structures and prototypes common to audio format * handlers that use the ogg container format. */ +struct oac_custom_header *oac_custom_header_new(void); +void oac_custom_header_init(int serial, struct oac_custom_header *h); +int oac_custom_header_append(ogg_packet *op, struct oac_custom_header *h); +void oac_custom_header_flush(struct oac_custom_header *h); +size_t oac_custom_header_get(char **buf, struct oac_custom_header *h); + /** - * Callback structure provided by vorbis/speex audio format handlers. + * Callback structure provided by audio format handlers. * - * Both audio formats utilize the ogg container format. Meta info about - * the audio file is contained in the first three ogg packets. + * All audio formats which utilize the ogg container format define a callback + * function whose purpose is to extract the meta information about the audio + * file from the first few ogg packets of the bitstream. */ -struct ogg_afh_callback_info { +struct oac_callback_info { /** - * ogg_get_file_info() calls this function for each of the three - * header packets. If this callback returns a negative value, the - * audio file is considered invalid and the chunk table is not - * created. If it returns zero, the end of the header has been - * reached and no further ogg packets should be processed. - */ + * ogg_get_file_info() calls this function for the first three ogg + * packets, or until the callback returns a non-positive value. If it + * returns negative, the audio file was not recognized by the audio + * format handler. If it returns zero, the audio file is considered + * valid, and no further processing by the callback is needed. In this + * case the header chunk, i.e. chunk number zero, is defined as the + * concatenation of all packets that have been processed by the + * callback. + */ int (*packet_callback)(ogg_packet *packet, int packet_num, int serial, struct afh_info *afhi, void *private_data); - /** Vorbis/speex specific data. */ + /** Data specific to the audio format handler. */ void *private_data; }; -int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, - struct ogg_afh_callback_info *ci); +int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, + struct oac_callback_info *ci); +int oac_rewrite_tags(const char *map, size_t mapsize, int fd, + char *meta_packet, size_t meta_sz);