MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
input_buffer.h
Go to the documentation of this file.
1 #include <fstream>
2 
3 #include "input.h"
4 #include <mist/dtsc.h>
5 #include <mist/shared_memory.h>
6 
7 namespace Mist {
8  class inputBuffer : public Input {
9  public:
11  ~inputBuffer();
12  private:
13  unsigned int bufferTime;
14  unsigned int cutTime;
15  unsigned int segmentSize; /*LTS*/
16  unsigned int lastReTime; /*LTS*/
17  bool hasPush; /*LTS*/
18  bool resumeMode; /*LTS*/
19  protected:
20  //Private Functions
21  bool setup();
22  void updateMeta();
23  bool readHeader();
24  void getNext(bool smart = true);
25  void updateTrackMeta(unsigned long tNum);
26  void updateMetaFromPage(unsigned long tNum, unsigned long pageNum);
27  void seek(int seekTime);
28  void trackSelect(std::string trackSpec);
29  bool removeKey(unsigned int tid);
30  void removeUnused();
31  void eraseTrackDataPages(unsigned long tid);
32  void finish();
33  void userCallback(char * data, size_t len, unsigned int id);
34  std::set<unsigned long> negotiatingTracks;
35  std::set<unsigned long> activeTracks;
36  std::map<unsigned long, unsigned long long> lastUpdated;
37  std::map<unsigned long, unsigned long long> negotiationTimeout;
39  std::map<unsigned long, std::map<unsigned long, DTSCPageData> > bufferLocations;
40  std::map<unsigned long, char *> pushLocation;
42 
43  std::string recName;/*LTS*/
45  std::ofstream recFile;/*LTS*/
46  long long int recBpos;/*LTS*/
47  //This is used for an ugly fix to prevent metadata from dissapearing in some cases.
48  std::map<unsigned long, std::string> initData;
49 
50  /* begin-roxlu */
51  int recordingPid; // pid of the process that does the recording. Currently only MP4 supported.
52  /* end-roxlu */
53  };
54 }
55 
57 
58 
void updateMetaFromPage(unsigned long tNum, unsigned long pageNum)
Definition: input_buffer.cpp:744
Class for storage of meta data.
Definition: dtsc.h:337
bool hasPush
Definition: input_buffer.h:17
std::map< unsigned long, std::map< unsigned long, DTSCPageData > > bufferLocations
Maps trackid to a pagenum->pageData map.
Definition: input_buffer.h:39
bool setup()
Definition: input_buffer.cpp:800
inputBuffer(Util::Config *cfg)
Definition: input_buffer.cpp:26
std::string recName
Definition: input_buffer.h:43
void updateMeta()
Definition: input_buffer.cpp:193
Definition: input_buffer.h:8
std::map< unsigned long, unsigned long long > lastUpdated
Definition: input_buffer.h:36
void updateTrackMeta(unsigned long tNum)
Definition: input_buffer.cpp:715
void trackSelect(std::string trackSpec)
Definition: input_buffer.cpp:983
void removeUnused()
Definition: input_buffer.cpp:398
void finish()
Definition: input_buffer.cpp:378
void eraseTrackDataPages(unsigned long tid)
Definition: input_buffer.cpp:362
DTSC::Meta recMeta
Definition: input_buffer.h:44
long long int recBpos
Definition: input_buffer.h:46
std::map< unsigned long, std::string > initData
Definition: input_buffer.h:48
Definition: input.h:19
unsigned int segmentSize
Definition: input_buffer.h:15
Recording to file.
Definition: input.cpp:13
bool removeKey(unsigned int tid)
Definition: input_buffer.cpp:252
std::ofstream recFile
Definition: input_buffer.h:45
void seek(int seekTime)
Definition: input_buffer.cpp:981
Deals with parsing configuration from commandline options.
Definition: config.h:18
std::set< unsigned long > activeTracks
Definition: input_buffer.h:35
void userCallback(char *data, size_t len, unsigned int id)
Definition: input_buffer.cpp:518
inputBuffer * singleton
Definition: input_buffer.h:41
std::map< unsigned long, char * > pushLocation
Definition: input_buffer.h:40
std::set< unsigned long > negotiatingTracks
Definition: input_buffer.h:34
bool resumeMode
Definition: input_buffer.h:18
std::map< unsigned long, unsigned long long > negotiationTimeout
Definition: input_buffer.h:37
int recordingPid
Definition: input_buffer.h:51
unsigned int lastReTime
Definition: input_buffer.h:16
unsigned int bufferTime
Definition: input_buffer.h:13
Mist::inputBuffer mistIn
Definition: input_buffer.h:56
bool readHeader()
Definition: input_buffer.cpp:975
~inputBuffer()
Definition: input_buffer.cpp:141
void getNext(bool smart=true)
Definition: input_buffer.cpp:979
unsigned int cutTime
Definition: input_buffer.h:14