Mdat functies toegvoegd

This commit is contained in:
Erik Zandvliet 2011-02-16 19:13:52 +01:00
parent 8bfc5d87c0
commit 5ca7a72b86
3 changed files with 17 additions and 1 deletions

View file

@ -97,6 +97,7 @@ int mainHandler(int CONN_fd){
int ReqFragment = -1;
int temp;
int CurrentFragment = -1;
Interface * Flash_Interface = new Interface;
while (!socketError && !All_Hell_Broke_Loose){
//only parse input if available or not yet init'ed
@ -207,6 +208,9 @@ int mainHandler(int CONN_fd){
if (handler == HANDLER_FLASH){
if(tag->data[0] != 0x12 ) {
FlashBuf.append(tag->data,tag->len);
//JARON:er is een Interface * Flash_Interface aangemaakt, met de functie Setmdat( std::string )
//JARON:kun je data setten( de hele string in 1 keer ) en met Getmdat krijg je de boxed
//JARON:versie als string terug.
} else {
FlashMeta = "";
FlashMeta.append(tag->data,tag->len);

View file

@ -484,3 +484,13 @@ std::string Interface::GenerateLiveBootstrap( uint32_t CurMediaTime ) {
Result.append( (char*)abst->GetBox( )->GetBoxedData( ), (int)abst->GetBox( )->GetBoxedDataSize( ) );
return Result;
}
void Interface::Setmdat( std::string data ) {
mdat->SetContent( data.c_str(), data.size( ) );
}
std::string Interface::Getmdat( ) {
std::string Result;
Result.append( (char*)mdat->GetBox( )->GetBoxedData( ), (int)mdat->GetBox( )->GetBoxedDataSize( ) );
return Result;
}

View file

@ -1,5 +1,7 @@
#include "box_includes.h"
#include <string>
class Interface {
public:
Interface();
@ -17,7 +19,7 @@ class Interface {
void AddSTSCEntry( uint32_t FirstChunk, uint32_t SamplesPerChunk, uint32_t Track );
void EmptySTSC( uint32_t Track );
void SetOffsets( std::vector<uint32_t> NewOffsets, uint32_t Track );
void SetData( uint8_t * Data, uint32_t DataSize );
void SetData( std::string data );
std::string GenerateLiveBootstrap( uint32_t CurMediaTime );
private: