MP4A Box Finished
This commit is contained in:
		
							parent
							
								
									e8d4ba32ac
								
							
						
					
					
						commit
						aef485c113
					
				
					 2 changed files with 57 additions and 0 deletions
				
			
		
							
								
								
									
										39
									
								
								MP4/box_mp4a.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								MP4/box_mp4a.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | |||
| #include "box_mp4a.h" | ||||
| 
 | ||||
| Box_mp4a::Box_mp4a( ) { | ||||
|   Container = new Box( 0x6D703461 ); | ||||
|   SetReserved(); | ||||
|   SetDefaults(); | ||||
| } | ||||
| 
 | ||||
| Box_mp4a::~Box_mp4a() { | ||||
|   delete Container; | ||||
| } | ||||
| 
 | ||||
| Box * Box_mp4a::GetBox() { | ||||
|   return Container; | ||||
| } | ||||
| 
 | ||||
| void Box_mp4a::SetDataReferenceIndex( uint16_t DataReferenceIndex ) { | ||||
|   Container->SetPayload((uint32_t)2,Box::uint16_to_uint8( DataReferenceIndex ),6); | ||||
| } | ||||
| 
 | ||||
| void Box_mp4a::SetChannelCount( uint16_t Count ) { | ||||
|   Container->SetPayload((uint32_t)2,Box::uint16_to_uint8( Count ),16); | ||||
| } | ||||
| 
 | ||||
| void Box_mp4a::SetSampleSize( uint16_t Size ) { | ||||
|   Container->SetPayload((uint32_t)2,Box::uint16_to_uint8( Size ),18); | ||||
| } | ||||
| 
 | ||||
| void Box_mp4a::SetReserved( ) { | ||||
|   Container->SetPayload((uint32_t)4,Box::uint32_to_uint8( 0 ),20); | ||||
|   Container->SetPayload((uint32_t)2,Box::uint16_to_uint8( 0 ),4); | ||||
|   Container->SetPayload((uint32_t)4,Box::uint32_to_uint8( 0 )); | ||||
| } | ||||
| 
 | ||||
| void Box_mp4a::SetDefaults( ) { | ||||
|   SetSampleSize( ); | ||||
|   SetChannelCount( ); | ||||
|   SetDataReferenceIndex( ); | ||||
| } | ||||
							
								
								
									
										18
									
								
								MP4/box_mp4a.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								MP4/box_mp4a.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include "box.h" | ||||
| #include <string> | ||||
| 
 | ||||
| class Box_mp4a { | ||||
|   public: | ||||
|     Box_mp4a( ); | ||||
|     ~Box_mp4a(); | ||||
|     Box * GetBox(); | ||||
|     void SetDataReferenceIndex( uint16_t DataReferenceIndex = 0); | ||||
|     void SetChannelCount( uint16_t Count = 2 ); | ||||
|     void SetSampleSize( uint16_t Size = 16 ); | ||||
|   private: | ||||
|     Box * Container; | ||||
| 
 | ||||
|     void SetReserved( ); | ||||
|     void SetDefaults( ); | ||||
| };//Box_ftyp Class
 | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Erik Zandvliet
						Erik Zandvliet