Fixed a lot of bugs in TS, updated to std-string implementation

This commit is contained in:
Erik Zandvliet 2012-12-11 15:25:59 +01:00 committed by Thulinma
parent c43fba4275
commit 611d4db3d7
2 changed files with 122 additions and 195 deletions

View file

@ -39,18 +39,15 @@ namespace TS {
int BytesFree();
void Print();
char* ToString();
const char* ToString();
void PESVideoLeadIn( int NewLen, long long unsigned int PTS = 1 );
void PESAudioLeadIn( int NewLen, uint64_t PTS = 0 );
void FillFree( std::string & PackageData );
void AddStuffing( int NumBytes );
void FFMpegHeader( );
int PESTimeStamp( );
int GetDataOffset( );
private:
int Free;
char Buffer[188];///< The actual data
//int Free;
std::string strBuf;
//char Buffer[188];///< The actual data
};//TS::Packet class
/// Constructs an audio header to be used on each audio frame.
@ -100,41 +97,6 @@ namespace TS {
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF
};
/// A standard Sevice Description Table, as generated by FFMPEG.
/// Not used in our connector, provided for compatibility means
static char SDT[188] = {
0x47,0x40,0x11,0x10, 0x00,0x42,0xF0,0x25, 0x00,0x01,0xC1,0x00, 0x00,0x00,0x01,0xFF,
0x00,0x01,0xFC,0x80, 0x14,0x48,0x12,0x01, 0x06,0x46,0x46,0x6D, 0x70,0x65,0x67,0x09,
0x53,0x65,0x72,0x76, 0x69,0x63,0x65,0x30, 0x31,0xA7,0x79,0xA0, 0x03,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF
};
/// A standard Picture Parameter Set, as generated by FFMPEG.
/// Seems to be stream-independent.
static char PPS[24] = {
0x00,0x00,0x00,0x01,
0x27,0x4D,0x40,0x1F,
0xA9,0x18,0x0A,0x00,
0xB7,0x60,0x0D,0x40,
0x40,0x40,0x4C,0x2B,
0x5E,0xF7,0xC0,0x40
};
/// A standard Sequence Parameter Set, as generated by FFMPEG.
/// Seems to be stream-independent.
static char SPS[8] = {
0x00,0x00,0x00,0x01,
0x28,0xCE,0x09,0xC8
};
/// The full Bytesteam Nal-Header.
static char NalHeader[4] = {
0x00,0x00,0x00,0x01