diff --git a/MP4/box_avcC.cpp b/MP4/box_avcC.cpp index 293bf168..0bcb15eb 100644 --- a/MP4/box_avcC.cpp +++ b/MP4/box_avcC.cpp @@ -55,7 +55,7 @@ void Box_avcC::SetReserved( ) { } void Box_avcC::SetDefaults( ) { - SetResolution ( ); - SetFrameCount ( ); SetDepth ( ); + SetFrameCount ( ); + SetResolution ( ); } diff --git a/MP4/box_avcC.h b/MP4/box_avcC.h index fc7dd27e..51d7dbd7 100644 --- a/MP4/box_avcC.h +++ b/MP4/box_avcC.h @@ -6,15 +6,16 @@ class Box_avcC { Box_avcC( ); ~Box_avcC(); Box * GetBox(); - void SetReserved( ); - void SetDataReferenceIndex( uint16_t DataReferenceIndex ); - void SetDimensions ( uint16_t Width, uint16_t Height ); + void SetDataReferenceIndex( uint16_t DataReferenceIndex = 0 ); + void SetDimensions ( uint16_t Width = 0, uint16_t Height = 0); void SetResolution ( uint32_t Horizontal = 0x00480000, uint32_t Vertical = 0x00480000 ); void SetFrameCount ( uint16_t FrameCount = 1 ); - void SetCompressorName ( std::string CompressorName ); + void SetCompressorName ( std::string CompressorName = ""); void SetDepth ( uint16_t Depth = 0x0018 ); - void SetDefaults( ); private: Box * Container; + + void SetReserved( ); + void SetDefaults( ); };//Box_ftyp Class diff --git a/MP4/box_ftyp.cpp b/MP4/box_ftyp.cpp index 1de5f1b6..67262dc5 100644 --- a/MP4/box_ftyp.cpp +++ b/MP4/box_ftyp.cpp @@ -1,9 +1,7 @@ #include "box_ftyp.h" -Box_ftyp::Box_ftyp( uint32_t MajorBrand, uint32_t MinorBrand ) { +Box_ftyp::Box_ftyp( ) { Container = new Box( 0x66747970 ); - Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(MajorBrand)); - Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(MinorBrand),4); } Box_ftyp::~Box_ftyp() { @@ -21,3 +19,8 @@ void Box_ftyp::SetMajorBrand( uint32_t MajorBrand ) { void Box_ftyp::SetMinorBrand( uint32_t MinorBrand ) { Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(MinorBrand),4); } + +void Box_ftyp::SetDefaults( ) { + SetMinorBrand( ); + SetMajorBrand( ); +} diff --git a/MP4/box_ftyp.h b/MP4/box_ftyp.h index f5b0c746..2a7ac9cd 100644 --- a/MP4/box_ftyp.h +++ b/MP4/box_ftyp.h @@ -2,12 +2,13 @@ class Box_ftyp { public: - Box_ftyp( uint32_t MajorBrand = 0x66347620, uint32_t MinorBrand = 0x1); + Box_ftyp( ); ~Box_ftyp(); Box * GetBox(); - void SetMajorBrand( uint32_t MajorBrand ); - void SetMinorBrand( uint32_t MinorBrand ); + void SetMajorBrand( uint32_t MajorBrand = 0x66347620 ); + void SetMinorBrand( uint32_t MinorBrand = 0x1 ); private: + void SetDefaults( ); Box * Container; };//Box_ftyp Class diff --git a/MP4/box_hdlr.cpp b/MP4/box_hdlr.cpp index 41b70604..48fa1de2 100644 --- a/MP4/box_hdlr.cpp +++ b/MP4/box_hdlr.cpp @@ -37,3 +37,8 @@ void Box_hdlr::SetName ( std::string Name ) { SetHandlerType(0); Container->SetPayload((uint32_t)strlen(tmp)+1,(uint8_t*)tmp,24); } + +void Box_hdlr::SetDefaults( ) { + SetName( ); + SetHandlerType( ); +} diff --git a/MP4/box_hdlr.h b/MP4/box_hdlr.h index 45fd2e0d..c12cfa12 100644 --- a/MP4/box_hdlr.h +++ b/MP4/box_hdlr.h @@ -6,11 +6,12 @@ class Box_hdlr { Box_hdlr( ); ~Box_hdlr(); Box * GetBox(); - void SetHandlerType( uint32_t HandlerType ); - void SetName ( std::string Name ); + void SetHandlerType( uint32_t HandlerType = 0 ); + void SetName ( std::string Name = "" ); private: Box * Container; void SetReserved( ); + void SetDefaults( ); uint32_t CurrentHandlerType; };//Box_ftyp Class diff --git a/MP4/box_stco.h b/MP4/box_stco.h index 3c9ffa42..a75b566b 100644 --- a/MP4/box_stco.h +++ b/MP4/box_stco.h @@ -7,12 +7,12 @@ class Box_stco { Box_stco( ); ~Box_stco(); Box * GetBox(); - void SetReserved( ); void AddOffset( uint32_t DataOffset, uint32_t Offset = 0 ); private: Box * Container; void WriteOffsets( ); + void SetReserved( ); std::vector Offsets; };//Box_ftyp Class diff --git a/MP4/box_stsc.h b/MP4/box_stsc.h index 53e7ba9e..6e1c77f2 100644 --- a/MP4/box_stsc.h +++ b/MP4/box_stsc.h @@ -14,7 +14,7 @@ class Box_stsc { ~Box_stsc(); Box * GetBox(); void SetReserved( ); - void AddEntry( uint32_t FirstChunk, uint32_t SamplesPerChunk, uint32_t SampleDescIndex, uint32_t Offset = 0 ); + void AddEntry( uint32_t FirstChunk = 0, uint32_t SamplesPerChunk = 0, uint32_t SampleDescIndex = 0, uint32_t Offset = 0 ); private: Box * Container;