diff --git a/MP4/box_abst.cpp b/MP4/box_abst.cpp index 6e264a1b..607b9d12 100644 --- a/MP4/box_abst.cpp +++ b/MP4/box_abst.cpp @@ -11,3 +11,73 @@ Box_abst::~Box_abst() { Box * Box_abst::GetBox() { return Container; } + +void Box_abst::SetProfile( uint8_t Profile ) { + curProfile = Profile; +} + +void Box_abst::SetLive( bool Live ) { + isLive = Live; +} + +void Box_abst::SetUpdate( bool Update ) { + isUpdate = Update; +} + +void Box_abst::SetTimeScale( uint32_t Scale ) { + curTimeScale = Scale; +} + +void Box_abst::SetMediaTime( uint32_t Time ) { + curMediaTime = Time; +} + +void Box_abst::SetSMPTE( uint32_t Smpte ) { + curSMPTE = Smpte; +} + +void Box_abst::SetMovieIdentfier( std::string Identifier ) { + curMovieIdentifier = Identifier; +} + +void Box_abst::SetDRM( std::string Drm ) { + curDRM = Drm; +} + +void Box_abst::SetMetaData( std::string MetaData ) { + curMetaData = MetaData; +} + +void Box_abst::AddServerEntry( std::string Url, uint32_t Offset ) { + if(Offset >= Servers.size()) { + Servers.resize(Offset+1); + } + Servers[Offset].ServerBaseUrl = Url; +} + +void Box_abst::AddQualityEntry( std::string Quality, uint32_t Offset ) { + if(Offset >= Qualities.size()) { + Qualities.resize(Offset+1); + } + Qualities[Offset].QualityModifier = Quality; +} + +void Box_abst::AddSegmentRunTable( Box * newSegment, uint32_t Offset ) { + if( Offset >= SegmentRunTables.size() ) { + SegmentRunTables.resize(Offset+1); + } + if( SegmentRunTables[Offset] ) { + delete SegmentRunTables[Offset]; + } + SegmentRunTables[Offset] = newSegment; +} + +void Box_abst::AddFragmentRunTable( Box * newFragment, uint32_t Offset ) { + if( Offset >= FragmentRunTables.size() ) { + FragmentRunTables.resize(Offset+1); + } + if( FragmentRunTables[Offset] ) { + delete FragmentRunTables[Offset]; + } + FragmentRunTables[Offset] = newFragment; +} diff --git a/MP4/box_abst.h b/MP4/box_abst.h index 289f43cf..e6ec5985 100644 --- a/MP4/box_abst.h +++ b/MP4/box_abst.h @@ -15,7 +15,19 @@ class Box_abst { Box_abst( ); ~Box_abst(); Box * GetBox(); - + void SetProfile( uint8_t Profile = 0 ); + void SetLive( bool Live = true ); + void SetUpdate( bool Update = false ); + void SetTimeScale( uint32_t Scale = 1000 ); + void SetMediaTime( uint32_t Time = 0 ); + void SetSMPTE( uint32_t Smpte = 0 ); + void SetMovieIdentfier( std::string Identifier = "" ); + void SetDRM( std::string Drm = "" ); + void SetMetaData( std::string MetaData = "" ); + void AddServerEntry( std::string Url = "", uint32_t Offset = 0 ); + void AddQualityEntry( std::string Quality = "", uint32_t Offset = 0 ); + void AddSegmentRunTable( Box * newSegment, uint32_t Offset = 0 ); + void AddFragmentRunTable( Box * newFragment, uint32_t Offset = 0 ); private: uint8_t curProfile; bool isLive;