58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
#include "input.h"
|
|
#include <fstream>
|
|
#include <mist/dtsc.h>
|
|
#include <mist/shared_memory.h>
|
|
|
|
namespace Mist{
|
|
class inputBuffer : public Input{
|
|
public:
|
|
inputBuffer(Util::Config *cfg);
|
|
~inputBuffer();
|
|
void onCrash();
|
|
|
|
private:
|
|
void fillBufferDetails(JSON::Value &details) const;
|
|
uint64_t bufferTime;
|
|
uint64_t cutTime;
|
|
size_t segmentSize; /*LTS*/
|
|
uint64_t lastReTime; /*LTS*/
|
|
uint64_t finalMillis;
|
|
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(size_t idx = INVALID_TRACK_ID){};
|
|
void seek(uint64_t seekTime, size_t idx = INVALID_TRACK_ID){};
|
|
|
|
void removeTrack(size_t tid);
|
|
|
|
bool removeKey(size_t tid);
|
|
void removeUnused();
|
|
void finish();
|
|
|
|
uint64_t retrieveSetting(DTSC::Scan &streamCfg, const std::string &setting, const std::string &option = "");
|
|
|
|
void userLeadIn();
|
|
void userOnActive(size_t id);
|
|
void userOnDisconnect(size_t id);
|
|
void userLeadOut();
|
|
// This is used for an ugly fix to prevent metadata from disappearing in some cases.
|
|
std::map<size_t, std::string> initData;
|
|
|
|
uint64_t findTrack(const std::string &trackVal);
|
|
void checkProcesses(const JSON::Value &procs); // LTS
|
|
std::map<std::string, pid_t> runningProcs; // LTS
|
|
|
|
std::set<size_t> generatePids;
|
|
std::map<size_t, std::set<size_t> > sourcePids;
|
|
};
|
|
}// namespace Mist
|
|
|
|
typedef Mist::inputBuffer mistIn;
|