Changes for new ESDS implementation in library.
This commit is contained in:
parent
225a11132f
commit
aa00b31ddb
2 changed files with 2 additions and 36 deletions
|
@ -103,7 +103,7 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FLV::Parse_Error){
|
if (FLV::Parse_Error){
|
||||||
std::cerr << FLV::Error_Str << std::endl;
|
FAIL_MSG("FLV error: %s", FLV::Error_Str.c_str());
|
||||||
thisPack.null();
|
thisPack.null();
|
||||||
lastPack.null();
|
lastPack.null();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -118,41 +118,7 @@ namespace Mist {
|
||||||
ase.setSampleRate(thisTrack.rate);
|
ase.setSampleRate(thisTrack.rate);
|
||||||
ase.setChannelCount(thisTrack.channels);
|
ase.setChannelCount(thisTrack.channels);
|
||||||
ase.setSampleSize(thisTrack.size);
|
ase.setSampleSize(thisTrack.size);
|
||||||
//MP4::ESDS esdsBox(thisTrack.init, thisTrack.bps);
|
MP4::ESDS esdsBox("");
|
||||||
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);
|
|
||||||
ase.setCodecBox(esdsBox);
|
ase.setCodecBox(esdsBox);
|
||||||
stsdBox.setEntry(ase,0);
|
stsdBox.setEntry(ase,0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue