summaryrefslogtreecommitdiff
path: root/apps/mp3data.h
diff options
context:
space:
mode:
authorSean Bartell <wingedtachikoma@gmail.com>2011-06-24 01:25:21 -0400
committerNils Wallménius <nils@rockbox.org>2012-03-18 12:00:39 +0100
commitb5716df4cb2837bbbc42195cf1aefcf03e21d6a6 (patch)
tree130cd712e2e00893b6df9959a375a8d9523a1aca /apps/mp3data.h
parent24bd9d5393dbe39a5c6194877bc00ede669b1d5d (diff)
downloadrockbox-b5716df4cb2837bbbc42195cf1aefcf03e21d6a6.tar.gz
rockbox-b5716df4cb2837bbbc42195cf1aefcf03e21d6a6.zip
Build librbcodec with DSP and metadata.
All associated files are moved to /lib/rbcodec. Change-Id: I572ddd2b8a996aae1e98c081d06b1ed356dce222
Diffstat (limited to 'apps/mp3data.h')
-rw-r--r--apps/mp3data.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/apps/mp3data.h b/apps/mp3data.h
deleted file mode 100644
index 762c2f4583..0000000000
--- a/apps/mp3data.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _MP3DATA_H_
23#define _MP3DATA_H_
24
25#define MPEG_VERSION1 0
26#define MPEG_VERSION2 1
27#define MPEG_VERSION2_5 2
28
29#include <string.h> /* size_t */
30
31struct mp3info {
32 /* Standard MP3 frame header fields */
33 int version;
34 int layer;
35 int bitrate;
36 long frequency;
37 int padding;
38 int channel_mode;
39 int frame_size; /* Frame size in bytes */
40 int frame_samples;/* Samples per frame */
41 int ft_num; /* Numerator of frametime in milliseconds */
42 int ft_den; /* Denominator of frametime in milliseconds */
43
44 bool is_vbr; /* True if the file is VBR */
45 bool has_toc; /* True if there is a VBR header in the file */
46 unsigned char toc[100];
47 unsigned long frame_count; /* Number of frames in the file (if VBR) */
48 unsigned long byte_count; /* File size in bytes */
49 unsigned long file_time; /* Length of the whole file in milliseconds */
50 int enc_delay; /* Encoder delay, fetched from LAME header */
51 int enc_padding; /* Padded samples added to last frame. LAME header */
52};
53
54/* Xing header information */
55#define VBR_FRAMES_FLAG 0x01
56#define VBR_BYTES_FLAG 0x02
57#define VBR_TOC_FLAG 0x04
58#define VBR_QUALITY_FLAG 0x08
59
60#define MAX_XING_HEADER_SIZE 576
61
62unsigned long find_next_frame(int fd,
63 long *offset,
64 long max_offset,
65 unsigned long reference_header);
66unsigned long mem_find_next_frame(int startpos,
67 long *offset,
68 long max_offset,
69 unsigned long reference_header,
70 unsigned char* buf, size_t buflen);
71int get_mp3file_info(int fd,
72 struct mp3info *info);
73
74int count_mp3_frames(int fd, int startpos, int filesize,
75 void (*progressfunc)(int),
76 unsigned char* buf, size_t buflen);
77
78int create_xing_header(int fd, long startpos, long filesize,
79 unsigned char *buf, unsigned long num_frames,
80 unsigned long rec_time, unsigned long header_template,
81 void (*progressfunc)(int), bool generate_toc,
82 unsigned char *tempbuf, size_t tempbuflen );
83
84extern unsigned long bytes2int(unsigned long b0,
85 unsigned long b1,
86 unsigned long b2,
87 unsigned long b3);
88
89#endif