#include "input.h" #include #include #include #include #include namespace Mist { struct seekPos { bool operator < (const seekPos & rhs) const { if (time < rhs.time){ return true; } return (time == rhs.time && trackId < rhs.trackId); } long long int position; int trackId; long long int time; long long int duration; int size; long long int offset; bool isKeyFrame; std::string iVec; }; class inputISMV : public Input { public: inputISMV(Util::Config * cfg); protected: //Private Functions bool setup(); bool readHeader(); void getNext(bool smart = true); void seek(int seekTime); void trackSelect(std::string trackSpec); bool atKeyFrame(); FILE * inFile; void parseMoov(MP4::MOOV & moovBox); bool parseFrag(int & tId, std::vector & trunSamples, std::vector & initVecs, std::string & mdat); void parseFragHeader(const unsigned int & trackId, const unsigned int & keyNum); void readBox(const char * type, std::string & result); std::set buffered; std::map lastKeyNum; }; } typedef Mist::inputISMV mistIn;