MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
input.h
Go to the documentation of this file.
1 #include <set>
2 #include <map>
3 #include <cstdlib>
4 #include <mist/config.h>
5 #include <mist/json.h>
6 #include <mist/timing.h>
7 #include <mist/dtsc.h>
8 #include <mist/shared_memory.h>
9 
10 #include "../io.h"
11 
12 namespace Mist {
13  struct booking {
14  int first;
15  int curKey;
16  int curPart;
17  };
18 
19  class Input : public InOutBase {
20  public:
21  Input(Util::Config * cfg);
22  virtual int run();
23  virtual void argumentsParsed(){}
24  virtual ~Input() {};
25  protected:
26  static void callbackWrapper(char * data, size_t len, unsigned int id);
27  virtual bool setup() = 0;
28  virtual bool readHeader() = 0;
29  virtual bool atKeyFrame();
30  virtual void getNext(bool smart = true) {};
31  virtual void seek(int seekTime){};
32  virtual void finish();
33  void play(int until = 0);
34  void playOnce();
35  void quitPlay();
36  void checkHeaderTimes(std::string streamFile);
37  virtual void removeUnused();
38  virtual void trackSelect(std::string trackSpec){};
39  virtual void userCallback(char * data, size_t len, unsigned int id);
40  virtual void convert();
41  virtual void serve();
42 
43  virtual void parseHeader();
44  bool bufferFrame(unsigned int track, unsigned int keyNum);
45 
46  unsigned int packTime;
49  int playing;
50  unsigned int playUntil;
51  unsigned int benchMark;
52 
53  bool isBuffer;
54 
56 
57  std::map<int,std::set<int> > keyTimes;
58 
59  //Create server for user pages
61 
62  std::map<unsigned int, std::map<unsigned int, unsigned int> > pageCounter;
63 
64  static Input * singleton;
65  };
66 
67 }
68 
unsigned int packTime
Definition: input.h:46
int initialTime
Timestamp of the last time we received or sent something.
Definition: input.h:48
Class containing all basic input and output functions.
Definition: io.h:66
int curPart
Definition: input.h:16
virtual void seek(int seekTime)
Definition: input.h:31
A JSON::Value is either a string or an integer, but may also be an object, array or null...
Definition: json.h:21
int playing
Definition: input.h:49
IPC::sharedServer userPage
Definition: input.h:60
std::map< unsigned int, std::map< unsigned int, unsigned int > > pageCounter
Definition: input.h:62
Definition: input.h:19
int lastActive
Media-timestamp of the last packet.
Definition: input.h:47
Recording to file.
Definition: input.cpp:13
unsigned int benchMark
Definition: input.h:51
The server part of a server/client model for shared memory.
Definition: shared_memory.h:177
Definition: input.h:13
unsigned int playUntil
Definition: input.h:50
JSON::Value capa
Definition: input.h:55
std::map< int, std::set< int > > keyTimes
Definition: input.h:57
Deals with parsing configuration from commandline options.
Definition: config.h:18
bool isBuffer
Definition: input.h:53
virtual void trackSelect(std::string trackSpec)
Definition: input.h:38
int first
Definition: input.h:14
virtual ~Input()
Definition: input.h:24
static Input * singleton
Definition: input.h:64
int curKey
Definition: input.h:15
virtual void getNext(bool smart=true)
Definition: input.h:30
virtual void argumentsParsed()
Definition: input.h:23