MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
input_ismv.h
Go to the documentation of this file.
1 #include "input.h"
2 #include <mist/dtsc.h>
3 #include <mist/mp4.h>
4 #include <mist/mp4_generic.h>
5 #include <mist/mp4_encryption.h>
6 #include <set>
7 
8 namespace Mist {
9  struct seekPos {
10  bool operator < (const seekPos & rhs) const {
11  if (time < rhs.time){
12  return true;
13  }
14  return (time == rhs.time && trackId < rhs.trackId);
15  }
16  long long int position;
17  int trackId;
18  long long int time;
19  long long int duration;
20  int size;
21  long long int offset;
22  bool isKeyFrame;
23  std::string iVec;
24  };
25 
26 
27  class inputISMV : public Input {
28  public:
29  inputISMV(Util::Config * cfg);
30  protected:
31  //Private Functions
32  bool setup();
33  bool readHeader();
34  void getNext(bool smart = true);
35  void seek(int seekTime);
36  void trackSelect(std::string trackSpec);
37  bool atKeyFrame();
38 
39  FILE * inFile;
40 
41  void parseMoov(MP4::MOOV & moovBox);
42  bool parseFrag(int & tId, std::vector<MP4::trunSampleInformation> & trunSamples, std::vector<std::string> & initVecs, std::string & mdat);
43  void parseFragHeader(const unsigned int & trackId, const unsigned int & keyNum);
44  void readBox(const char * type, std::string & result);
45  std::set<seekPos> buffered;
46  std::map<int, int> lastKeyNum;
47  };
48 }
49 
51 
FILE * inFile
Definition: input_ismv.h:39
int size
Definition: input_ismv.h:20
std::map< int, int > lastKeyNum
Definition: input_ismv.h:46
long long int position
Definition: input_ismv.h:16
Definition: input.h:19
Recording to file.
Definition: input.cpp:13
Mist::inputISMV mistIn
Definition: input_ismv.h:50
long long int offset
Definition: input_ismv.h:21
long long int time
Definition: input_ismv.h:18
Definition: input_ismv.h:9
Definition: input_ismv.h:27
Deals with parsing configuration from commandline options.
Definition: config.h:18
bool operator<(const seekPos &rhs) const
Definition: input_ismv.h:10
int trackId
Definition: input_ismv.h:17
long long int duration
Definition: input_ismv.h:19
std::string iVec
Definition: input_ismv.h:23
Definition: mp4_generic.h:274
std::set< seekPos > buffered
Definition: input_ismv.h:45
bool isKeyFrame
Definition: input_ismv.h:22