Skip to content

Commit

Permalink
for #738, add doc, moov box.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 28, 2017
1 parent 6b6ac9a commit ca02aaa
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 7 deletions.
Binary file added trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf
Binary file not shown.
Binary file modified trunk/doc/ISO_IEC_14496-12-base-format-2012.pdf
Binary file not shown.
41 changes: 36 additions & 5 deletions trunk/src/kernel/srs_kernel_mp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,54 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include <srs_kernel_mp4.hpp>

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()
{
}

45 changes: 43 additions & 2 deletions trunk/src/kernel/srs_kernel_mp4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SrsMp4Box
uint32_t size;
uint32_t type;
public:
SrsMp4Box(uint32_t bt);
SrsMp4Box();
virtual ~SrsMp4Box();
};

Expand All @@ -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

0 comments on commit ca02aaa

Please sign in to comment.