More boxes
This commit is contained in:
parent
4738624b3e
commit
32d8f8b6f5
6 changed files with 83 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
SRC = box.cpp box_ftyp.cpp box_h264.cpp box_stbl.cpp box_stco.cpp box_stsc.cpp box_stsd.cpp box_stts.cpp box_url.cpp box_dref.cpp box_dinf.cpp box_minf.cpp main.cpp
|
||||
SRC = box.cpp box_ftyp.cpp box_h264.cpp box_stbl.cpp box_stco.cpp box_stsc.cpp box_stsd.cpp box_stts.cpp box_url.cpp box_dref.cpp box_dinf.cpp box_minf.cpp box_vmhd.cpp main.cpp
|
||||
OBJ = $(SRC:.cpp=.o)
|
||||
OUT = Boxtest
|
||||
INCLUDES =
|
||||
|
|
20
MP4/box_hdlr.cpp
Normal file
20
MP4/box_hdlr.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "box_hdlr.h"
|
||||
|
||||
Box_hdlr::Box_hdlr( ) {
|
||||
Container = new Box( 0x68646C72 );
|
||||
SetDefaults();
|
||||
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(1));
|
||||
}
|
||||
|
14
MP4/box_hdlr.h
Normal file
14
MP4/box_hdlr.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "box.h"
|
||||
|
||||
class Box_hdlr {
|
||||
public:
|
||||
Box_hdlr( );
|
||||
~Box_hdlr();
|
||||
Box * GetBox();
|
||||
void SetHandlerType( uint32_t HandlerType );
|
||||
void SetName ( std::string Name );
|
||||
private:
|
||||
Box * Container;
|
||||
void SetReserved( );
|
||||
};//Box_ftyp Class
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#include "box_minf.h"
|
||||
|
||||
Box_minf::Box_minf( ) {
|
||||
Container = new Box( 0x7374626C );
|
||||
Container = new Box( 0x6D696E66 );
|
||||
}
|
||||
|
||||
Box_minf::~Box_minf() {
|
||||
|
|
32
MP4/box_vmhd.cpp
Normal file
32
MP4/box_vmhd.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "box_vmhd.h"
|
||||
|
||||
Box_vmhd::Box_vmhd( ) {
|
||||
Container = new Box( 0x766D6864 );
|
||||
SetDefaults();
|
||||
SetReserved();
|
||||
}
|
||||
|
||||
Box_vmhd::~Box_vmhd() {
|
||||
delete Container;
|
||||
}
|
||||
|
||||
Box * Box_vmhd::GetBox() {
|
||||
return Container;
|
||||
}
|
||||
|
||||
void Box_vmhd::SetGraphicsMode( uint16_t GraphicsMode ) {
|
||||
Container->SetPayload((uint32_t)2,Box::uint16_to_uint8(GraphicsMode),8);
|
||||
}
|
||||
void Box_vmhd::SetOpColor( uint16_t Red, uint16_t Green, uint16_t Blue ) {
|
||||
Container->SetPayload((uint32_t)2,Box::uint16_to_uint8(Blue),14);
|
||||
Container->SetPayload((uint32_t)2,Box::uint16_to_uint8(Green),12);
|
||||
Container->SetPayload((uint32_t)2,Box::uint16_to_uint8(Red),10);
|
||||
}
|
||||
|
||||
void Box_vmhd::SetReserved( ) {
|
||||
Container->SetPayload((uint32_t)4,Box::uint32_to_uint8(1));
|
||||
}
|
||||
void Box_vmhd::SetDefaults( ) {
|
||||
SetOpColor();
|
||||
SetGraphicsMode();
|
||||
}
|
15
MP4/box_vmhd.h
Normal file
15
MP4/box_vmhd.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "box.h"
|
||||
|
||||
class Box_vmhd {
|
||||
public:
|
||||
Box_vmhd( );
|
||||
~Box_vmhd();
|
||||
Box * GetBox();
|
||||
void SetGraphicsMode( uint16_t GraphicsMode = 0 );
|
||||
void SetOpColor( uint16_t Red = 0, uint16_t Green = 0, uint16_t Blue = 0);
|
||||
private:
|
||||
Box * Container;
|
||||
void SetReserved( );
|
||||
void SetDefaults( );
|
||||
};//Box_ftyp Class
|
||||
|
Loading…
Add table
Reference in a new issue