summaryrefslogtreecommitdiff
path: root/firmware/export/mp3data.h
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-03-10 14:55:31 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-03-10 14:55:31 +0000
commita039091187f40d018b6353b8c13de7a01d3a6fe0 (patch)
tree08f7eb86e86e2c61f4d36f9c91731cb93252ba84 /firmware/export/mp3data.h
parent22cbe938feb48895d7488449835d3ee577399057 (diff)
downloadrockbox-a039091187f40d018b6353b8c13de7a01d3a6fe0.tar.gz
rockbox-a039091187f40d018b6353b8c13de7a01d3a6fe0.zip
New ID3 and MP3 stream parser, plus not-yet-ready Xing header generation code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3410 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/mp3data.h')
-rw-r--r--firmware/export/mp3data.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/firmware/export/mp3data.h b/firmware/export/mp3data.h
new file mode 100644
index 0000000000..a1018ebaa2
--- /dev/null
+++ b/firmware/export/mp3data.h
@@ -0,0 +1,66 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef _MP3DATA_H_
21#define _MP3DATA_H_
22
23#define MPEG_VERSION2_5 0
24#define MPEG_VERSION1 1
25#define MPEG_VERSION2 2
26
27struct mp3info {
28 /* Standard MP3 frame header fields */
29 int version;
30 int layer;
31 bool protection;
32 int bitrate;
33 int frequency;
34 int padding;
35 int channel_mode;
36 int mode_extension;
37 int emphasis;
38 int frame_size; /* Frame size in bytes */
39 int frame_time; /* Frame duration in milliseconds */
40
41 bool is_vbr; /* True if the file is VBR */
42 bool has_toc; /* True if there is a VBR header in the file */
43 bool is_xing_vbr; /* True if the VBR header is of Xing type */
44 bool is_vbri_vbr; /* True if the VBR header is of VBRI type */
45 unsigned char toc[100];
46 int frame_count; /* Number of frames in the file (if VBR) */
47 int byte_count; /* File size in bytes */
48 int file_time; /* Length of the whole file in milliseconds */
49 int xing_header_pos;
50};
51
52/* Xing header information */
53#define VBR_FRAMES_FLAG 0x01
54#define VBR_BYTES_FLAG 0x02
55#define VBR_TOC_FLAG 0x04
56
57
58unsigned long find_next_frame(int fd, int *offset, int max_offset, unsigned long last_header);
59int get_mp3file_info(int fd, struct mp3info *info);
60int count_mp3_frames(int fd, int startpos, int filesize,
61 void (*progressfunc)(int));
62int create_xing_header(int fd, int startpos, int filesize,
63 unsigned char *buf, int num_frames,
64 void (*progressfunc)(int));
65
66#endif