Changes for new ESDS implementation in library.

This commit is contained in:
Thulinma 2015-02-18 02:55:21 +01:00
parent 225a11132f
commit aa00b31ddb
2 changed files with 2 additions and 36 deletions

View file

@ -103,7 +103,7 @@ namespace Mist {
}
}
if (FLV::Parse_Error){
std::cerr << FLV::Error_Str << std::endl;
FAIL_MSG("FLV error: %s", FLV::Error_Str.c_str());
thisPack.null();
lastPack.null();
return;

View file

@ -118,41 +118,7 @@ namespace Mist {
ase.setSampleRate(thisTrack.rate);
ase.setChannelCount(thisTrack.channels);
ase.setSampleSize(thisTrack.size);
//MP4::ESDS esdsBox(thisTrack.init, thisTrack.bps);
MP4::ESDS esdsBox;
//outputting these values first, so malloc isn't called as often.
if (thisTrack.codec == "MP3"){
esdsBox.setESHeaderStartCodes("\002");
esdsBox.setConfigDescriptorTypeLength(1);
esdsBox.setSLConfigExtendedDescriptorTypeTag(0);
esdsBox.setSLDescriptorTypeLength(0);
esdsBox.setESDescriptorTypeLength(27);
esdsBox.setSLConfigDescriptorTypeTag(0);
esdsBox.setDecoderDescriptorTypeTag(0x06);
esdsBox.setSLValue(0);
//esdsBox.setBufferSize(0);
esdsBox.setDecoderConfigDescriptorTypeLength(13);
esdsBox.setByteObjectTypeID(0x6b);
}else{
//AAC
esdsBox.setESHeaderStartCodes(thisTrack.init);
esdsBox.setConfigDescriptorTypeLength(thisTrack.init.size());
esdsBox.setSLConfigExtendedDescriptorTypeTag(0x808080);
esdsBox.setSLDescriptorTypeLength(1);
esdsBox.setESDescriptorTypeLength(32+thisTrack.init.size());
esdsBox.setSLConfigDescriptorTypeTag(0x6);
esdsBox.setSLValue(2);
esdsBox.setDecoderConfigDescriptorTypeLength(18 + thisTrack.init.size());
esdsBox.setByteObjectTypeID(0x40);
}
esdsBox.setESID(2);
esdsBox.setStreamPriority(0);
esdsBox.setStreamType(5);
esdsBox.setReservedFlag(1);
esdsBox.setMaximumBitRate(10000000);
esdsBox.setAverageBitRate(thisTrack.bps * 8);
esdsBox.setBufferSize(1250000);
MP4::ESDS esdsBox("");
ase.setCodecBox(esdsBox);
stsdBox.setEntry(ase,0);
}