summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libm4a/m4a.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-10-29 17:12:52 +0000
committerDave Chapman <dave@dchapman.com>2005-10-29 17:12:52 +0000
commit45f9e5d7b02ce3b9d165f45d63825d50244634d4 (patch)
tree900097f56dbecc41ea4fc6cd50366f0af3164e84 /apps/codecs/libm4a/m4a.h
parente75cbdd2a84904e9294091c0ae599762b067077a (diff)
downloadrockbox-45f9e5d7b02ce3b9d165f45d63825d50244634d4.tar.gz
rockbox-45f9e5d7b02ce3b9d165f45d63825d50244634d4.zip
Remove generic M4A parsing code from libalac and create a libm4a - so it can be used by other codecs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7682 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libm4a/m4a.h')
-rw-r--r--apps/codecs/libm4a/m4a.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/apps/codecs/libm4a/m4a.h b/apps/codecs/libm4a/m4a.h
new file mode 100644
index 0000000000..98cf8d6acb
--- /dev/null
+++ b/apps/codecs/libm4a/m4a.h
@@ -0,0 +1,104 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2005 Dave Chapman
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef _M4A_H
+#define _M4A_H
+
+#include <codecs.h>
+#include <inttypes.h>
+
+typedef struct {
+ struct codec_api* ci;
+ int eof;
+} stream_t;
+
+typedef uint32_t fourcc_t;
+
+typedef struct
+{
+ uint16_t num_channels;
+ uint16_t sample_size;
+ uint32_t sample_rate;
+ fourcc_t format;
+ void *buf;
+
+ struct {
+ uint32_t sample_count;
+ uint32_t sample_duration;
+ } *time_to_sample;
+ uint32_t num_time_to_samples;
+
+ uint32_t *sample_byte_size;
+ uint32_t num_sample_byte_sizes;
+
+ uint32_t codecdata_len;
+ void *codecdata;
+
+ int mdat_offset;
+ uint32_t mdat_len;
+#if 0
+ void *mdat;
+#endif
+} demux_res_t;
+
+int qtmovie_read(stream_t *stream, demux_res_t *demux_res);
+
+#ifndef MAKEFOURCC
+#define MAKEFOURCC(ch0, ch1, ch2, ch3) ( \
+ ( (int32_t)(char)(ch0) << 24 ) | \
+ ( (int32_t)(char)(ch1) << 16 ) | \
+ ( (int32_t)(char)(ch2) << 8 ) | \
+ ( (int32_t)(char)(ch3) ) )
+#endif
+
+#ifndef SLPITFOURCC
+/* splits it into ch0, ch1, ch2, ch3 - use for printf's */
+#define SPLITFOURCC(code) \
+ (char)((int32_t)code >> 24), \
+ (char)((int32_t)code >> 16), \
+ (char)((int32_t)code >> 8), \
+ (char)code
+#endif
+
+void stream_read(stream_t *stream, size_t len, void *buf);
+
+int32_t stream_tell(stream_t *stream);
+int32_t stream_read_int32(stream_t *stream);
+uint32_t stream_read_uint32(stream_t *stream);
+
+int16_t stream_read_int16(stream_t *stream);
+uint16_t stream_read_uint16(stream_t *stream);
+
+int8_t stream_read_int8(stream_t *stream);
+uint8_t stream_read_uint8(stream_t *stream);
+
+void stream_skip(stream_t *stream, size_t skip);
+
+int stream_eof(stream_t *stream);
+
+void stream_create(stream_t *stream,struct codec_api* ci);
+int get_sample_info(demux_res_t *demux_res, uint32_t samplenum,
+ uint32_t *sample_duration,
+ uint32_t *sample_byte_size);
+unsigned int alac_seek (demux_res_t* demux_res,
+ stream_t* stream,
+ unsigned int sample_loc,
+ uint32_t* samplesdone, int* currentblock);
+
+#endif /* STREAM_H */