Added track language support to TS input
This commit is contained in:
parent
523c00f462
commit
d0abad68b3
3 changed files with 30 additions and 2 deletions
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace Analysers {
|
|||
}
|
||||
res << std::endl;
|
||||
|
||||
if(detailLevel==1){
|
||||
if(detailLevel==10){
|
||||
unsigned int counter = 0;
|
||||
for (unsigned int i = 9+headSize+padding; i<d.size(); ++i){
|
||||
if ((i < d.size() - 4) && d[i] == 0 && d[i+1] == 0 && d[i+2] == 0 && d[i+3] == 1){res << std::endl; counter = 0;}
|
||||
|
@ -187,7 +187,7 @@ int main(int argc, char ** argv){
|
|||
Util::Config conf = Util::Config(argv[0]);
|
||||
conf.addOption("analyse", JSON::fromString("{\"long\":\"analyse\", \"short\":\"a\", \"default\":1, \"long_off\":\"notanalyse\", \"short_off\":\"b\", \"help\":\"Analyse a file's contents (-a), or don't (-b) returning false on error. Default is analyse.\"}"));
|
||||
conf.addOption("validate", JSON::fromString("{\"long\":\"validate\", \"short\":\"V\", \"default\":0, \"long_off\":\"notvalidate\", \"short_off\":\"X\", \"help\":\"Validate (-V) the file contents or don't validate (-X) its integrity, returning false on error. Default is don't validate.\"}"));
|
||||
conf.addOption("detail", JSON::fromString("{\"long\":\"detail\", \"short\":\"D\", \"arg\":\"num\", \"default\":3, \"help\":\"Detail level of analysis.\"}"));
|
||||
conf.addOption("detail", JSON::fromString("{\"long\":\"detail\", \"short\":\"D\", \"arg\":\"num\", \"default\":2, \"help\":\"Detail level of analysis. 1 = PES only, 2 = PAT/PMT (default), 3 = all TS packets, 9 = raw PES packet bytes, 10 = raw TS packet bytes\"}"));
|
||||
conf.parseArgs(argc, argv);
|
||||
return Analysers::analyseTS(conf.getBool("validate"),conf.getBool("analyse"),conf.getInteger("detail"));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue