mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #738, add doc, moov box.
This commit is contained in:
parent
6b6ac9a054
commit
ca02aaa7b3
4 changed files with 79 additions and 7 deletions
BIN
trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf
Normal file
BIN
trunk/doc/ISO_IEC_14496-12-base-format-2005.pdf
Normal file
Binary file not shown.
Binary file not shown.
|
@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
uint32_t size;
|
||||
uint32_t type;
|
||||
public:
|
||||
SrsMp4Box(uint32_t bt);
|
||||
SrsMp4Box();
|
||||
virtual ~SrsMp4Box();
|
||||
};
|
||||
|
||||
|
@ -58,10 +58,51 @@ public:
|
|||
// 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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue