Merge branch 't/recv_fix'
[paraslash.git] / ogg_afh_common.h
1 /*
2 * Copyright (C) 2010-2014 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /**
8 * \file ogg_afh_common.h Structures and prototypes common to audio format
9 * handlers that use the ogg container format.
10 */
11
12 /**
13 * Callback structure provided by vorbis/speex audio format handlers.
14 *
15 * Both audio formats utilize the ogg container format. Meta info about
16 * the audio file is contained in the first three ogg packets.
17 */
18 struct ogg_afh_callback_info {
19 /**
20 * ogg_get_file_info() calls this function for each of the three
21 * header packets. If this callback returns a negative value, the
22 * audio file is considered invalid and the chunk table is not
23 * created. If it returns zero, the end of the header has been
24 * reached and no further ogg packets should be processed.
25 */
26 int (*packet_callback)(ogg_packet *packet, int packet_num,
27 int serial, struct afh_info *afhi, void *private_data);
28 /** Vorbis/speex specific data. */
29 void *private_data;
30 };
31
32 int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
33 struct ogg_afh_callback_info *ci);