Moved getMainSelectedTrack to InOutBase class

This commit is contained in:
Thulinma 2018-01-24 18:59:29 +01:00
parent 7c1a6fe7ce
commit 363df9aacf
4 changed files with 15 additions and 15 deletions

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(){ void negotiationProxy::clear(){
pagesByTrack.clear(); pagesByTrack.clear();
trackOffset.clear(); trackOffset.clear();

View file

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

View file

@ -771,20 +771,6 @@ namespace Mist{
return 0; 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){ 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 //depending on whether this is probably bad and the current debug level, print a message
unsigned int printLevel = DLVL_INFO; unsigned int printLevel = DLVL_INFO;

View file

@ -50,7 +50,6 @@ namespace Mist {
uint64_t startTime(); uint64_t startTime();
uint64_t endTime(); uint64_t endTime();
void setBlocking(bool blocking); void setBlocking(bool blocking);
long unsigned int getMainSelectedTrack();
void updateMeta(); void updateMeta();
void selectDefaultTracks(); void selectDefaultTracks();
bool connectToFile(std::string file); bool connectToFile(std::string file);