LTS commit of OS edition Input edits

This commit is contained in:
Thulinma 2017-07-19 11:28:20 +02:00
parent 29c05bda3f
commit fc5adc6ac0
15 changed files with 30 additions and 17 deletions

View file

@ -41,7 +41,7 @@ namespace Mist {
} }
} }
bool inputAV::setup() { bool inputAV::checkArguments() {
if (config->getString("input") == "-") { if (config->getString("input") == "-") {
std::cerr << "Input from stdin not yet supported" << std::endl; std::cerr << "Input from stdin not yet supported" << std::endl;
return false; return false;
@ -57,9 +57,12 @@ namespace Mist {
return false; return false;
} }
} }
return true;
}
bool inputAV::preRun(){
//make sure all av inputs are registered properly, just in case //make sure all av inputs are registered properly, just in case
//setup() already does this, but under windows it doesn't remember that it has. //the constructor already does this, but under windows it doesn't remember that it has.
//Very sad, that. We may need to get windows some medication for it. //Very sad, that. We may need to get windows some medication for it.
av_register_all(); av_register_all();
@ -204,7 +207,7 @@ namespace Mist {
return;//success! return;//success!
} }
thisPacket.null(); thisPacket.null();
setup(); preRun();
//failure :-( //failure :-(
DEBUG_MSG(DLVL_FAIL, "getNext failed"); DEBUG_MSG(DLVL_FAIL, "getNext failed");
} }

View file

@ -19,7 +19,8 @@ namespace Mist {
~inputAV(); ~inputAV();
protected: protected:
//Private Functions //Private Functions
bool setup(); bool checkArguments();
bool preRun();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);

View file

@ -7,7 +7,7 @@ namespace Mist {
inputBalancer(Util::Config * cfg); inputBalancer(Util::Config * cfg);
int boot(int argc, char * argv[]); int boot(int argc, char * argv[]);
protected: protected:
bool setup(){return false;}; bool checkArguments(){return false;};
bool readHeader(){return false;}; bool readHeader(){return false;};
}; };
} }

View file

@ -596,7 +596,7 @@ namespace Mist {
/*LTS-START*/ /*LTS-START*/
//Reload the configuration to make sure we stay up to date with changes through the api //Reload the configuration to make sure we stay up to date with changes through the api
if (Util::epoch() - lastReTime > 4) { if (Util::epoch() - lastReTime > 4) {
setup(); preRun();
} }
/*LTS-END*/ /*LTS-END*/
//Static variable keeping track of the next temporary mapping to use for a track. //Static variable keeping track of the next temporary mapping to use for a track.

View file

@ -52,7 +52,7 @@ namespace Mist {
srand(time(NULL)); srand(time(NULL));
} }
bool inputDTSC::setup() { bool inputDTSC::checkArguments() {
key = Encodings::Base64::decode(config->getString("key")); key = Encodings::Base64::decode(config->getString("key"));
if (key == ""){ if (key == ""){
if (config->getString("keyseed") == "" || config->getString("keyid") == ""){ if (config->getString("keyseed") == "" || config->getString("keyid") == ""){

View file

@ -7,7 +7,7 @@ namespace Mist {
inputDTSC(Util::Config * cfg); inputDTSC(Util::Config * cfg);
protected: protected:
//Private Functions //Private Functions
bool setup(); bool checkArguments();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);

View file

@ -7,7 +7,7 @@ namespace Mist {
inputFolder(Util::Config * cfg); inputFolder(Util::Config * cfg);
int boot(int argc, char * argv[]); int boot(int argc, char * argv[]);
protected: protected:
bool setup(){return false;}; bool checkArguments(){return false;};
bool readHeader(){return false;}; bool readHeader(){return false;};
}; };
} }

View file

@ -286,7 +286,7 @@ namespace Mist{
if (inFile){fclose(inFile);} if (inFile){fclose(inFile);}
} }
bool inputHLS::setup(){ bool inputHLS::checkArguments(){
if (config->getString("input") == "-"){return false;} if (config->getString("input") == "-"){return false;}
if (!initPlaylist(config->getString("input"))){return false;} if (!initPlaylist(config->getString("input"))){return false;}

View file

@ -101,7 +101,7 @@ namespace Mist{
int firstSegment(); int firstSegment();
void waitForNextSegment(); void waitForNextSegment();
void readPMT(); void readPMT();
bool setup(); bool checkArguments();
bool preSetup(); bool preSetup();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);

View file

@ -22,7 +22,7 @@ namespace Mist {
inFile = 0; inFile = 0;
} }
bool inputISMV::setup() { bool inputISMV::checkArguments() {
if (config->getString("input") == "-") { if (config->getString("input") == "-") {
std::cerr << "Input from stdin not yet supported" << std::endl; std::cerr << "Input from stdin not yet supported" << std::endl;
return false; return false;
@ -38,6 +38,9 @@ namespace Mist {
return false; return false;
} }
} }
return true;
}
bool inputISMV::preRun() {
//open File //open File
inFile = fopen(config->getString("input").c_str(), "r"); inFile = fopen(config->getString("input").c_str(), "r");
if (!inFile) { if (!inFile) {

View file

@ -29,7 +29,8 @@ namespace Mist {
inputISMV(Util::Config * cfg); inputISMV(Util::Config * cfg);
protected: protected:
//Private Functions //Private Functions
bool setup(); bool checkArguments();
bool preRun();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);

View file

@ -156,7 +156,7 @@ namespace Mist {
free(data); free(data);
} }
bool inputMP4::setup() { bool inputMP4::checkArguments() {
if (config->getString("input") == "-") { if (config->getString("input") == "-") {
std::cerr << "Input from stdin not yet supported" << std::endl; std::cerr << "Input from stdin not yet supported" << std::endl;
return false; return false;
@ -173,7 +173,10 @@ namespace Mist {
} }
streamName = config->getString("streamname"); streamName = config->getString("streamname");
} }
return true;
}
bool inputMP4::preRun() {
//open File //open File
inFile = fopen(config->getString("input").c_str(), "r"); inFile = fopen(config->getString("input").c_str(), "r");
if (!inFile) { if (!inFile) {

View file

@ -84,7 +84,8 @@ namespace Mist {
~inputMP4(); ~inputMP4();
protected: protected:
//Private Functions //Private Functions
bool setup(); bool checkArguments();
bool preRun();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);

View file

@ -141,7 +141,7 @@ namespace Mist {
} }
///Live Setup of TS Input ///Live Setup of TS Input
bool inputTS::setup() { bool inputTS::preRun() {
const std::string & inpt = config->getString("input"); const std::string & inpt = config->getString("input");
//streamed standard input //streamed standard input
if (inpt == "-") { if (inpt == "-") {

View file

@ -16,7 +16,8 @@ namespace Mist {
bool needsLock(); bool needsLock();
protected: protected:
//Private Functions //Private Functions
bool setup(); bool checkArguments(){return true;}
bool preRun();
bool readHeader(); bool readHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);