[Stable] Interface::GenerateLiveBootstrap( )
This commit is contained in:
parent
13a4dfff81
commit
dab1ec345d
4 changed files with 39 additions and 3 deletions
|
@ -40,7 +40,7 @@ void Box_abst::SetSMPTE( uint32_t Smpte ) {
|
|||
curSMPTE = Smpte;
|
||||
}
|
||||
|
||||
void Box_abst::SetMovieIdentfier( std::string Identifier ) {
|
||||
void Box_abst::SetMovieIdentifier( std::string Identifier ) {
|
||||
curMovieIdentifier = Identifier;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ void Box_abst::SetDefaults( ) {
|
|||
SetTimeScale( );
|
||||
SetMediaTime( );
|
||||
SetSMPTE( );
|
||||
SetMovieIdentfier( );
|
||||
SetMovieIdentifier( );
|
||||
SetDRM( );
|
||||
SetMetaData( );
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class Box_abst {
|
|||
void SetTimeScale( uint32_t Scale = 1000 );
|
||||
void SetMediaTime( uint32_t Time = 0 );
|
||||
void SetSMPTE( uint32_t Smpte = 0 );
|
||||
void SetMovieIdentfier( std::string Identifier = "" );
|
||||
void SetMovieIdentifier( std::string Identifier = "" );
|
||||
void SetDRM( std::string Drm = "" );
|
||||
void SetMetaData( std::string MetaData = "" );
|
||||
void AddServerEntry( std::string Url = "", uint32_t Offset = 0 );
|
||||
|
|
|
@ -450,3 +450,37 @@ void Interface::SetOffsets( std::vector<uint32_t> NewOffsets, uint32_t Track ) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Interface::GenerateLiveBootstrap( uint32_t CurMediaTime ) {
|
||||
//SetUpAFRT
|
||||
afrt->SetUpdate(false);
|
||||
afrt->SetTimeScale( 1000 );
|
||||
afrt->AddQualityEntry( "" );
|
||||
afrt->AddFragmentRunEntry( 1, 0, 0, 2 );
|
||||
afrt->WriteContent( );
|
||||
|
||||
//SetUpASRT
|
||||
asrt->SetUpdate(false);
|
||||
asrt->AddQualityEntry( "" );
|
||||
asrt->AddSegmentRunEntry( 1, 0 );
|
||||
asrt->WriteContent( );
|
||||
|
||||
//SetUpABST
|
||||
abst->SetBootstrapVersion( 1 );
|
||||
abst->SetProfile( 0 );
|
||||
abst->SetLive( true );
|
||||
abst->SetUpdate( false );
|
||||
abst->SetTimeScale( 1000 );
|
||||
abst->SetMediaTime( CurMediaTime );
|
||||
abst->SetSMPTE( 0 );
|
||||
abst->SetMovieIdentifier( "" );
|
||||
abst->SetDRM( "" );
|
||||
abst->SetMetaData( "" );
|
||||
abst->AddServerEntry( "" );
|
||||
abst->AddQualityEntry( "" );
|
||||
abst->WriteContent( );
|
||||
|
||||
std::string Result;
|
||||
Result.append( (char*)abst->GetBox( )->GetBoxedData( ), (int)abst->GetBox( )->GetBoxedDataSize( ) );
|
||||
return Result;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ class Interface {
|
|||
void EmptySTSC( uint32_t Track );
|
||||
void SetOffsets( std::vector<uint32_t> NewOffsets, uint32_t Track );
|
||||
void SetData( uint8_t * Data, uint32_t DataSize );
|
||||
|
||||
std::string GenerateLiveBootstrap( uint32_t CurMediaTime );
|
||||
private:
|
||||
void SetStaticDefaults();
|
||||
void UpdateContents();
|
||||
|
|
Loading…
Add table
Reference in a new issue