moof box added
This commit is contained in:
parent
d5db1debf5
commit
b2b8491655
2 changed files with 26 additions and 0 deletions
17
lib/mp4.cpp
17
lib/mp4.cpp
|
@ -539,4 +539,21 @@ namespace MP4{
|
|||
void MFHD::setSequenceNumber( long newSequenceNumber ) {
|
||||
setInt32( newSequenceNumber, 4 );
|
||||
}
|
||||
|
||||
MOOF::MOOF() : Box("moof") {}
|
||||
|
||||
void MOOF::addContent( Box* newContent ) {
|
||||
content.push_back( newContent );
|
||||
isUpdated = true;
|
||||
}
|
||||
|
||||
void MOOF::regenerate() {
|
||||
int myOffset = 0;
|
||||
//retrieve box for each entry
|
||||
for( std::deque<Box*>::iterator it = content.begin(); it != content.end(); it++ ) {
|
||||
memcpy( (char*)data.c_str() + myOffset, (*it)->asBox().c_str(), (*it)->boxedSize() + 1);
|
||||
myOffset += (*it)->boxedSize();
|
||||
}
|
||||
isUpdated = false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -125,4 +125,13 @@ namespace MP4{
|
|||
MFHD();
|
||||
void setSequenceNumber( long newSequenceNumber );
|
||||
};//MFHD Box
|
||||
|
||||
class MOOF : public Box {
|
||||
public:
|
||||
MOOF();
|
||||
void addContent( Box* newContent );
|
||||
void regenerate( );
|
||||
private:
|
||||
std::deque<Box*> content;
|
||||
};//MOOF Box
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue