Merge branch 'development' into LTS_development

# Conflicts:
#	lib/bitfields.h
#	src/input/input.cpp
#	src/output/output.cpp
This commit is contained in:
Thulinma 2018-01-24 19:04:21 +01:00
commit ad29c297c2
11 changed files with 130 additions and 16 deletions

View file

@ -611,6 +611,20 @@ namespace Mist {
}
}
}
void Input::trackSelect(std::string trackSpec){
selectedTracks.clear();
size_t index;
while (trackSpec != "") {
index = trackSpec.find(' ');
selectedTracks.insert(atoi(trackSpec.substr(0, index).c_str()));
if (index != std::string::npos) {
trackSpec.erase(0, index + 1);
} else {
trackSpec = "";
}
}
}
void Input::parseHeader() {
if (hasSrt){

View file

@ -46,7 +46,7 @@ namespace Mist {
void quitPlay();
void checkHeaderTimes(std::string streamFile);
virtual void removeUnused();
virtual void trackSelect(std::string trackSpec){};
virtual void trackSelect(std::string trackSpec);
virtual void userCallback(char * data, size_t len, unsigned int id);
virtual void convert();
virtual void serve();

View file

@ -29,6 +29,20 @@ namespace Mist {
}
/// Returns the ID of the main selected track, or 0 if no tracks are selected.
/// The main track is the first video track, if any, and otherwise the first other track.
long unsigned int InOutBase::getMainSelectedTrack(){
if (!selectedTracks.size()){
return 0;
}
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
if (myMeta.tracks.count(*it) && myMeta.tracks[*it].type == "video"){
return *it;
}
}
return *(selectedTracks.begin());
}
void negotiationProxy::clear(){
pagesByTrack.clear();
trackOffset.clear();

View file

@ -77,6 +77,7 @@ namespace Mist {
void bufferFinalize(unsigned long tid);
void bufferRemove(unsigned long tid, unsigned long pageNumber);
virtual void bufferLivePacket(const DTSC::Packet & packet);
long unsigned int getMainSelectedTrack();
protected:
void continueNegotiate(unsigned long tid, bool quickNegotiate = false);
void continueNegotiate();

View file

@ -1246,20 +1246,6 @@ namespace Mist{
return 0;
}
/// Returns the ID of the main selected track, or 0 if no tracks are selected.
/// The main track is the first video track, if any, and otherwise the first other track.
long unsigned int Output::getMainSelectedTrack(){
if (!selectedTracks.size()){
return 0;
}
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
if (myMeta.tracks.count(*it) && myMeta.tracks[*it].type == "video"){
return *it;
}
}
return *(selectedTracks.begin());
}
void Output::dropTrack(uint32_t trackId, std::string reason, bool probablyBad){
//depending on whether this is probably bad and the current debug level, print a message
unsigned int printLevel = DLVL_INFO;

View file

@ -54,7 +54,6 @@ namespace Mist {
uint64_t endTime();
uint64_t liveTime();
void setBlocking(bool blocking);
long unsigned int getMainSelectedTrack();
void updateMeta();
void selectTrack(const std::string &trackType, const std::string &trackVal); /*LTS*/
void selectDefaultTracks();