annotate Plugins/Input/mpg123/dxhead.h @ 1238:dc6f7048a9fa trunk

[svn] - remove metatag entirely
author nenolod
date Wed, 14 Jun 2006 22:41:05 -0700
parents b5ae09a6c2f1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * A Xing header may be present in the ancillary
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 * data field of the first frame of an mp3 bitstream
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * The Xing header (optionally) contains
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * frames total number of audio frames in the bitstream
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 * bytes total number of bytes in the bitstream
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * toc table of contents
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * toc (table of contents) gives seek points
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * for random access
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 * the ith entry determines the seek point for
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * i-percent duration
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 * seek point in bytes = (toc[i]/256.0) * total_bitstream_bytes
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * e.g. half duration seek point = (toc[50]/256.0) * total_bitstream_bytes
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 #define FRAMES_FLAG 0x0001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 #define BYTES_FLAG 0x0002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 #define TOC_FLAG 0x0004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 #define VBR_SCALE_FLAG 0x0008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 * structure to receive extracted header
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 typedef struct {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 int frames; /* total bit stream frames from Xing header data */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 int bytes; /* total bit stream bytes from Xing header data */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 unsigned char toc[100]; /* "table of contents" */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 } xing_header_t;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 * Returns zero on fail, non-zero on success
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 * xing structure to receive header data (output)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 * buf bitstream input
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 */
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 61
diff changeset
36 int mpgdec_get_xing_header(xing_header_t * xing, unsigned char *buf);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 * Returns seekpoint in bytes (may be at eof if percent=100.0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 * percent: play time percentage of total playtime. May be fractional.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 */
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 61
diff changeset
43 int mpgdec_seek_point(xing_header_t * xing, float percent);