summaryrefslogtreecommitdiff
path: root/lib/rbcodec/metadata/metadata_common.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 /lib/rbcodec/metadata/metadata_common.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 'lib/rbcodec/metadata/metadata_common.h')
-rw-r--r--lib/rbcodec/metadata/metadata_common.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/rbcodec/metadata/metadata_common.h b/lib/rbcodec/metadata/metadata_common.h
new file mode 100644
index 0000000000..db91729de4
--- /dev/null
+++ b/lib/rbcodec/metadata/metadata_common.h
@@ -0,0 +1,69 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Dave Chapman
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#include <inttypes.h>
22#include "metadata.h"
23
24#ifdef ROCKBOX_BIG_ENDIAN
25#define IS_BIG_ENDIAN 1
26#else
27#define IS_BIG_ENDIAN 0
28#endif
29
30#define TAG_NAME_LENGTH 32
31#define TAG_VALUE_LENGTH 128
32
33#define FOURCC(a,b,c,d) (((a)<<24) | ((b) << 16) | ((c) << 8) | (d))
34
35enum tagtype { TAGTYPE_APE = 1, TAGTYPE_VORBIS };
36
37bool read_ape_tags(int fd, struct mp3entry* id3);
38long read_vorbis_tags(int fd, struct mp3entry *id3,
39 long tag_remaining);
40
41bool skip_id3v2(int fd, struct mp3entry *id3);
42long read_string(int fd, char* buf, long buf_size, int eos, long size);
43
44int read_uint8(int fd, uint8_t* buf);
45#ifdef ROCKBOX_BIG_ENDIAN
46#define read_uint16be(fd,buf) read((fd), (buf), 2)
47#define read_uint32be(fd,buf) read((fd), (buf), 4)
48#define read_uint64be(fd,buf) read((fd), (buf), 8)
49int read_uint16le(int fd, uint16_t* buf);
50int read_uint32le(int fd, uint32_t* buf);
51int read_uint64le(int fd, uint64_t* buf);
52#else
53int read_uint16be(int fd, uint16_t* buf);
54int read_uint32be(int fd, uint32_t* buf);
55int read_uint64be(int fd, uint64_t* buf);
56#define read_uint16le(fd,buf) read((fd), (buf), 2)
57#define read_uint32le(fd,buf) read((fd), (buf), 4)
58#define read_uint64le(fd,buf) read((fd), (buf), 8)
59#endif
60
61uint64_t get_uint64_le(void* buf);
62uint32_t get_long_le(void* buf);
63uint16_t get_short_le(void* buf);
64uint32_t get_long_be(void* buf);
65uint16_t get_short_be(void* buf);
66int32_t get_slong(void* buf);
67uint32_t get_itunes_int32(char* value, int count);
68long parse_tag(const char* name, char* value, struct mp3entry* id3,
69 char* buf, long buf_remaining, enum tagtype type);