Bijna klaar!
This commit is contained in:
parent
5ca7a72b86
commit
a3fd7a5a43
84 changed files with 879 additions and 969 deletions
59
util/MP4/box_hdlr.cpp
Normal file
59
util/MP4/box_hdlr.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
#include "box.cpp"
|
||||
#include <string>
|
||||
|
||||
class Box_hdlr {
|
||||
public:
|
||||
Box_hdlr( );
|
||||
~Box_hdlr();
|
||||
Box * GetBox();
|
||||
void SetHandlerType( uint32_t HandlerType = 0 );
|
||||
void SetName ( std::string Name = "" );
|
||||
private:
|
||||
Box * Container;
|
||||
void SetReserved( );
|
||||
void SetDefaults( );
|
||||
uint32_t CurrentHandlerType;
|
||||
};//Box_ftyp Class
|
||||
|
||||
Box_hdlr::Box_hdlr( ) {
|
||||
Container = new Box( 0x68646C72 );
|
||||
CurrentHandlerType = 0;
|
||||
SetReserved();
|
||||
}
|
||||
|
||||
Box_hdlr::~Box_hdlr() {
|
||||
delete Container;
|
||||
}
|
||||
|
||||
Box * Box_hdlr::GetBox() {
|
||||
return Container;
|
||||
}
|
||||
|
||||
void Box_hdlr::SetReserved( ) {
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(0),20);
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(0),16);
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(0),12);
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(0),4);
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(0));
|
||||
}
|
||||
|
||||
void Box_hdlr::SetHandlerType( uint32_t HandlerType ) {
|
||||
if( HandlerType != 0 ) {
|
||||
CurrentHandlerType = HandlerType;
|
||||
}
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(CurrentHandlerType),8);
|
||||
}
|
||||
|
||||
void Box_hdlr::SetName ( std::string Name ) {
|
||||
char * tmp = new char[Name.size()+1];
|
||||
strcpy(tmp,Name.c_str());
|
||||
Container->ResetPayload();
|
||||
SetReserved();
|
||||
SetHandlerType(0);
|
||||
Container->SetPayload((uint32_t)strlen(tmp)+1,(uint8_t*)tmp,24);
|
||||
}
|
||||
|
||||
void Box_hdlr::SetDefaults( ) {
|
||||
SetName( );
|
||||
SetHandlerType( );
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue