#include #include "input.h" #include #include namespace Mist { class inputBuffer : public Input { public: inputBuffer(Util::Config * cfg); ~inputBuffer(); void onCrash(); private: void fillBufferDetails(JSON::Value & details); unsigned int bufferTime; unsigned int cutTime; unsigned int segmentSize; /*LTS*/ unsigned int lastReTime; /*LTS*/ bool hasPush; bool resumeMode; IPC::semaphore * liveMeta; protected: //Private Functions bool preRun(); bool checkArguments(){return true;} void updateMeta(); bool readHeader(){return false;} bool needHeader(){return false;} void getNext(bool smart = true){} void updateTrackMeta(unsigned long tNum); void updateMetaFromPage(unsigned long tNum, unsigned long pageNum); void seek(int seekTime){} void trackSelect(std::string trackSpec){} bool removeKey(unsigned int tid); void removeUnused(); void eraseTrackDataPages(unsigned long tid); void finish(); void userCallback(char * data, size_t len, unsigned int id); std::set negotiatingTracks; std::set activeTracks; std::map lastUpdated; std::map negotiationTimeout; ///Maps trackid to a pagenum->pageData map std::map > bufferLocations; std::map pushLocation; inputBuffer * singleton; //This is used for an ugly fix to prevent metadata from disappearing in some cases. std::map initData; }; } typedef Mist::inputBuffer mistIn;