diff --git a/trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf b/trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf new file mode 100644 index 0000000000..5a6a6290f2 Binary files /dev/null and b/trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf differ diff --git a/trunk/doc/ISO_IEC_14496-12-base-format-2012.pdf b/trunk/doc/ISO_IEC_14496-12-base-format-2012.pdf index c3ac62ca3f..d58e84ec18 100644 Binary files a/trunk/doc/ISO_IEC_14496-12-base-format-2012.pdf and b/trunk/doc/ISO_IEC_14496-12-base-format-2012.pdf differ diff --git a/trunk/src/kernel/srs_kernel_mp4.cpp b/trunk/src/kernel/srs_kernel_mp4.cpp index 5e7a938598..5f9abd8223 100644 --- a/trunk/src/kernel/srs_kernel_mp4.cpp +++ b/trunk/src/kernel/srs_kernel_mp4.cpp @@ -23,23 +23,54 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include -SrsMp4Box::SrsMp4Box(uint32_t bt) +SrsMp4Box::SrsMp4Box() { size = 0; - type = bt; + type = 0; } SrsMp4Box::~SrsMp4Box() { } -SrsMp4FullBox::SrsMp4FullBox(uint32_t bt, uint8_t v, uint32_t f) : SrsMp4Box(bt) +SrsMp4FullBox::SrsMp4FullBox() { - version = v; - flags = f; + version = 0; + flags = 0; } SrsMp4FullBox::~SrsMp4FullBox() { } +SrsMp4FileTypeBox::SrsMp4FileTypeBox() +{ + type = 0x66747970; // 'ftyp' + nb_compatible_brands = 0; + compatible_brands = NULL; + major_brand = minor_version = 0; +} + +SrsMp4FileTypeBox::~SrsMp4FileTypeBox() +{ + srs_freepa(compatible_brands); +} + +SrsMp4MovieBox::SrsMp4MovieBox() +{ + type = 0x6d6f6f76; // 'moov' +} + +SrsMp4MovieBox::~SrsMp4MovieBox() +{ +} + +SrsMp4MovieHeaderBox::SrsMp4MovieHeaderBox() +{ + type = 0x6d766864; // 'mvhd' +} + +SrsMp4MovieHeaderBox::~SrsMp4MovieHeaderBox() +{ +} + diff --git a/trunk/src/kernel/srs_kernel_mp4.hpp b/trunk/src/kernel/srs_kernel_mp4.hpp index ddca3c6cea..0ccce0a0bf 100644 --- a/trunk/src/kernel/srs_kernel_mp4.hpp +++ b/trunk/src/kernel/srs_kernel_mp4.hpp @@ -42,7 +42,7 @@ class SrsMp4Box uint32_t size; uint32_t type; public: - SrsMp4Box(uint32_t bt); + SrsMp4Box(); virtual ~SrsMp4Box(); }; @@ -58,10 +58,51 @@ class SrsMp4FullBox : public SrsMp4Box // a map of flags uint32_t flags; public: - SrsMp4FullBox(uint32_t bt, uint8_t v, uint32_t f); + SrsMp4FullBox(); virtual ~SrsMp4FullBox(); }; +/** + * 4.3 File Type Box + * ISO_IEC_14496-12-base-format-2012.pdf, page 17 + */ +class SrsMp4FileTypeBox : public SrsMp4Box +{ +public: + // a brand identifier + uint32_t major_brand; + // an informative integer for the minor version of the major brand + uint32_t minor_version; +private: + // a list, to the end of the box, of brands + int nb_compatible_brands; + uint32_t* compatible_brands; +public: + SrsMp4FileTypeBox(); + virtual ~SrsMp4FileTypeBox(); +}; + +/** + * 8.2.1 Movie Box + * ISO_IEC_14496-12-base-format-2012.pdf, page 31 + */ +class SrsMp4MovieBox : public SrsMp4Box +{ +public: + SrsMp4MovieBox(); + virtual ~SrsMp4MovieBox(); +}; + +/** + * 8.2.2 Movie Header Box + * ISO_IEC_14496-12-base-format-2012.pdf, page 31 + */ +class SrsMp4MovieHeaderBox : public SrsMp4Box +{ +public: + SrsMp4MovieHeaderBox(); + virtual ~SrsMp4MovieHeaderBox(); +}; #endif