Added track language support to TS input

This commit is contained in:
Thulinma 2016-07-18 10:08:34 +02:00
parent 523c00f462
commit d0abad68b3
3 changed files with 30 additions and 2 deletions

View file

@ -736,6 +736,10 @@ namespace TS {
avccBox.setPPSNumber(1);
avccBox.setPPS(ppsInfo[it->first]);
meta.tracks[it->first].init = std::string(avccBox.payload(), avccBox.payloadSize());
}
break;
case H265: {
@ -747,6 +751,17 @@ namespace TS {
meta.tracks[it->first].codec = "HEVC";
meta.tracks[it->first].trackID = it->first;
meta.tracks[it->first].init = hevcInfo[it->first].generateHVCC();
int pmtCount = associationTable.getProgramCount();
for (int i = 0; i < pmtCount; i++){
int pid = associationTable.getProgramPID(i);
ProgramMappingEntry entry = mappingTable[pid].getEntry(0);
while (entry){
if (entry.getElementaryPid() == tid){
meta.tracks[it->first].lang = ProgramDescriptors(entry.getESInfo(), entry.getESInfoLength()).getLanguage();
}
entry.advance();
}
}
}
break;
case ID3: {
@ -780,6 +795,18 @@ namespace TS {
}
break;
}
int pmtCount = associationTable.getProgramCount();
for (int i = 0; i < pmtCount; i++){
int pid = associationTable.getProgramPID(i);
ProgramMappingEntry entry = mappingTable[pid].getEntry(0);
while (entry){
if (entry.getElementaryPid() == tid){
meta.tracks[it->first].lang = ProgramDescriptors(entry.getESInfo(), entry.getESInfoLength()).getLanguage();
}
entry.advance();
}
}
MEDIUM_MSG("Initialized track %lu as %s %s", it->first, meta.tracks[it->first].codec.c_str(), meta.tracks[it->first].type.c_str());
}
if (threaded){

View file

@ -51,6 +51,7 @@ namespace TS {
std::map<unsigned long, std::string > ppsInfo;
std::map<unsigned long, h265::initData > hevcInfo;
std::map<unsigned long, std::string> metaInit;
std::map<unsigned long, std::string> descriptors;
mutable IPC::semaphore globalSem;