summaryrefslogtreecommitdiffstats
path: root/libmpdemux/parse_mp4.h
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-24 02:25:41 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-24 02:25:41 +0000
commit086814f29412aac40b43a35e807a76090f2f500c (patch)
tree896534f281478e6821b6bfd2a47b52f037fb3b21 /libmpdemux/parse_mp4.h
parent52457a7c61c17b7d098df8b7c6cf0c24aec782ad (diff)
downloadmpv-086814f29412aac40b43a35e807a76090f2f500c.tar.bz2
mpv-086814f29412aac40b43a35e807a76090f2f500c.tar.xz
Improved MP4 parsing (finally)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5302 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/parse_mp4.h')
-rw-r--r--libmpdemux/parse_mp4.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/libmpdemux/parse_mp4.h b/libmpdemux/parse_mp4.h
new file mode 100644
index 0000000000..882924bfe0
--- /dev/null
+++ b/libmpdemux/parse_mp4.h
@@ -0,0 +1,78 @@
+/* parse_mp4.h - Headerfile for MP4 file format parser code
+ * This file is part of MPlayer, see http://mplayerhq.hu/ for info.
+ * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net>
+ * File licensed under the GPL, see http://www.fsf.org/ for more info.
+ */
+
+#ifndef __PARSE_MP4_H
+#define __PARSE_MP4_H 1
+
+#include <inttypes.h>
+
+/* one byte tag identifiers */
+#define MP4ODescrTag 0x01
+#define MP4IODescrTag 0x02
+#define MP4ESDescrTag 0x03
+#define MP4DecConfigDescrTag 0x04
+#define MP4DecSpecificDescrTag 0x05
+#define MP4SLConfigDescrTag 0x06
+#define MP4ContentIdDescrTag 0x07
+#define MP4SupplContentIdDescrTag 0x08
+#define MP4IPIPtrDescrTag 0x09
+#define MP4IPMPPtrDescrTag 0x0A
+#define MP4IPMPDescrTag 0x0B
+#define MP4RegistrationDescrTag 0x0D
+#define MP4ESIDIncDescrTag 0x0E
+#define MP4ESIDRefDescrTag 0x0F
+#define MP4FileIODescrTag 0x10
+#define MP4FileODescrTag 0x11
+#define MP4ExtProfileLevelDescrTag 0x13
+#define MP4ExtDescrTagsStart 0x80
+#define MP4ExtDescrTagsEnd 0xFE
+
+/* I define uint24 here for better understanding */
+#ifndef uint24_t
+#define uint24_t uint32_t
+#endif
+
+/* esds_t */
+typedef struct {
+ uint8_t version;
+ uint24_t flags;
+
+ /* 0x03 ESDescrTag */
+ uint16_t ESId;
+ uint8_t streamPriority;
+
+ /* 0x04 DecConfigDescrTag */
+ uint8_t objectTypeId;
+ uint8_t streamType;
+ /* XXX: really streamType is
+ * only 6bit, followed by:
+ * 1bit upStream
+ * 1bit reserved
+ */
+ uint24_t bufferSizeDB;
+ uint32_t maxBitrate;
+ uint32_t avgBitrate;
+
+ /* 0x05 DecSpecificDescrTag */
+ uint8_t decoderConfigLen;
+ uint8_t *decoderConfig;
+
+ /* 0x06 SLConfigDescrTag */
+ uint8_t SLConfigLen;
+ uint8_t *SLConfig;
+
+ /* TODO: add the missing tags,
+ * I currently have no specs
+ * for them and doubt they
+ * are currently needed ::atmos
+ */
+
+} esds_t;
+
+int mp4_parse_esds(unsigned char *data, int datalen, esds_t *esds);
+
+#endif /* !__PARSE_MP4_H */
+