Added header read speed timers, simplified header logic for VoD.

This commit is contained in:
Thulinma 2017-07-26 10:38:20 +02:00
parent 6b1db9d0ec
commit 8f4ddf14d9
8 changed files with 10 additions and 9 deletions

View file

@ -93,9 +93,6 @@ namespace Mist {
} }
bool inputAV::readHeader() { bool inputAV::readHeader() {
//See whether a separate header file exists.
if (readExistingHeader()){return true;}
myMeta.tracks.clear(); myMeta.tracks.clear();
for(unsigned int i=0; i < pFormatCtx->nb_streams; ){ for(unsigned int i=0; i < pFormatCtx->nb_streams; ){
AVStream * strm = pFormatCtx->streams[i++]; AVStream * strm = pFormatCtx->streams[i++];

View file

@ -9,6 +9,7 @@ namespace Mist {
protected: protected:
bool checkArguments(){return false;}; bool checkArguments(){return false;};
bool readHeader(){return false;}; bool readHeader(){return false;};
bool needHeader(){return false;};
}; };
} }

View file

@ -9,6 +9,7 @@ namespace Mist {
protected: protected:
bool checkArguments(){return false;}; bool checkArguments(){return false;};
bool readHeader(){return false;}; bool readHeader(){return false;};
bool needHeader(){return false;};
}; };
} }

View file

@ -116,6 +116,7 @@ namespace Mist{
bool checkArguments(); bool checkArguments();
bool preSetup(); bool preSetup();
bool readHeader(); bool readHeader();
bool needHeader(){return true;}
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);
void trackSelect(std::string trackSpec); void trackSelect(std::string trackSpec);

View file

@ -53,8 +53,6 @@ namespace Mist {
if (!inFile) { if (!inFile) {
return false; return false;
} }
//See whether a separate header file exists.
if (readExistingHeader()){return true;}
//parse ismv header //parse ismv header
fseek(inFile, 0, SEEK_SET); fseek(inFile, 0, SEEK_SET);
std::string ftyp; std::string ftyp;

View file

@ -87,6 +87,7 @@ namespace Mist {
bool checkArguments(); bool checkArguments();
bool preRun(); bool preRun();
bool readHeader(); bool readHeader();
bool needHeader(){return true;}
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);
void trackSelect(std::string trackSpec); void trackSelect(std::string trackSpec);

View file

@ -218,6 +218,11 @@ namespace Mist {
} }
bool inputTS::needHeader(){
if (!standAlone){return false;}
return Input::needHeader();
}
///Reads headers from a TS stream, and saves them into metadata ///Reads headers from a TS stream, and saves them into metadata
///It works by going through the entire TS stream, and every time ///It works by going through the entire TS stream, and every time
///It encounters a new PES start, it writes the currently found PES data ///It encounters a new PES start, it writes the currently found PES data
@ -225,11 +230,7 @@ namespace Mist {
///it writes the remaining metadata. ///it writes the remaining metadata.
///\todo Find errors, perhaps parts can be made more modular ///\todo Find errors, perhaps parts can be made more modular
bool inputTS::readHeader() { bool inputTS::readHeader() {
if (!standAlone){return true;}
if (!inFile){return false;} if (!inFile){return false;}
//See whether a separate header file exists.
if (readExistingHeader()){return true;}
TS::Packet packet;//to analyse and extract data TS::Packet packet;//to analyse and extract data
fseek(inFile, 0, SEEK_SET);//seek to beginning fseek(inFile, 0, SEEK_SET);//seek to beginning

View file

@ -19,6 +19,7 @@ namespace Mist {
bool checkArguments(){return true;} bool checkArguments(){return true;}
bool preRun(); bool preRun();
bool readHeader(); bool readHeader();
bool needHeader();
void getNext(bool smart = true); void getNext(bool smart = true);
void seek(int seekTime); void seek(int seekTime);
void trackSelect(std::string trackSpec); void trackSelect(std::string trackSpec);