MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
io.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <deque>
5 #include <mist/shared_memory.h>
6 #include <mist/defines.h>
7 #include <mist/dtsc.h>
8 
9 #include <mist/encryption.h>//LTS
10 namespace Mist {
16  };
17 
18  struct DTSCPageData {
20  unsigned long pageNum;
21  unsigned long keyNum;
22  unsigned long partNum;
23  unsigned long long int dataSize;
24  unsigned long long int curOffset;
25  unsigned long long int firstTime;
26  unsigned long lastKeyTime;
27  };
28 
30  public:
31  negotiationProxy() : encrypt(false) {}
32  void initiateEncryption();//LTS
33  bool bufferStart(unsigned long tid, unsigned long pageNumber, DTSC::Meta & myMeta);
34  void bufferNext(DTSC::Packet & pack, DTSC::Meta & myMeta);
35  void bufferFinalize(unsigned long tid, DTSC::Meta &myMeta);
36  void bufferLivePacket(DTSC::Packet & packet, DTSC::Meta & myMeta);
37  bool isBuffered(unsigned long tid, unsigned long keyNum);
38  unsigned long bufferedOnPage(unsigned long tid, unsigned long keyNum);
39 
40 
41 
42 
43  std::map<unsigned long, std::map<unsigned long, DTSCPageData> > pagesByTrack;
44 
45  //Negotiation stuff (from unmapped tid's)
46  std::map<unsigned long, unsigned long> trackOffset;
47  std::map<unsigned long, negotiationState> trackState;
48  std::map<unsigned long, unsigned long> trackMap;
49  std::map<unsigned long, IPC::sharedPage> metaPages;
50  std::map<unsigned long, unsigned long> curPageNum;
51  std::map<unsigned long, IPC::sharedPage> curPage;
52 
54 
55  std::string streamName;
56 
57  bool encrypt;
59  std::map<int,unsigned long long int> iVecs;
61 
62  void continueNegotiate(unsigned long tid, DTSC::Meta & myMeta);
63  };
64 
66  class InOutBase {
67  public:
68  void initiateMeta();
69  bool bufferStart(unsigned long tid, unsigned long pageNumber);
70  void bufferNext(DTSC::Packet & pack);
71  void bufferNext(JSON::Value & pack);
72  void bufferFinalize(unsigned long tid);
73  void bufferRemove(unsigned long tid, unsigned long pageNumber);
74  void bufferLivePacket(JSON::Value & packet);
75  void bufferLivePacket(DTSC::Packet & packet);
76  protected:
77  void continueNegotiate(unsigned long tid);
78 
79 
80 
81  bool standAlone;
82  static Util::Config * config;
83 
85 
86  DTSC::Packet thisPacket;//The current packet that is being parsed
87 
88  std::string streamName;
89 
90 
91  std::set<unsigned long> selectedTracks;
92 
94  };
95 }
std::set< unsigned long > selectedTracks
Stores the track id&#39;s that are either selected for playback or input.
Definition: io.h:91
Class for storage of meta data.
Definition: dtsc.h:337
Negotiating this track, written metadata.
Definition: io.h:13
negotiationState
Definition: io.h:11
Definition: io.h:18
Definition: io.h:29
std::map< unsigned long, unsigned long > trackMap
Determines which input track maps onto which "final" track.
Definition: io.h:48
Class containing all basic input and output functions.
Definition: io.h:66
Definition: encryption.h:6
A JSON::Value is either a string or an integer, but may also be an object, array or null...
Definition: json.h:21
std::map< unsigned long, unsigned long > curPageNum
For each track, holds the number page that is currently being written.
Definition: io.h:50
static Util::Config * config
Definition: io.h:82
unsigned long keyNum
The current page number.
Definition: io.h:21
std::map< unsigned long, IPC::sharedPage > metaPages
For each track, holds the page that describes which dataPages are mapped.
Definition: io.h:49
std::map< unsigned long, negotiationState > trackState
State of the negotiation for tracks.
Definition: io.h:47
IPC::sharedPage encryptionPage
Definition: io.h:60
Recording to file.
Definition: input.cpp:13
std::map< unsigned long, IPC::sharedPage > curPage
For each track, holds the page that is currently being written.
Definition: io.h:51
negotiationProxy()
Definition: io.h:31
unsigned long long int curOffset
The current write offset in the page.
Definition: io.h:24
Accepted Track.
Definition: io.h:15
unsigned long lastKeyTime
The last key time encountered on this track.
Definition: io.h:26
DTSCPageData()
Definition: io.h:19
Declined Track.
Definition: io.h:14
unsigned long pageNum
Definition: io.h:20
IPC::sharedClient userClient
Shared memory used for connection to Mixer process.
Definition: io.h:53
Encryption::verimatrixData vmData
Definition: io.h:58
std::string streamName
Definition: io.h:88
The client part of a server/client model for shared memory.
Definition: shared_memory.h:212
Deals with parsing configuration from commandline options.
Definition: config.h:18
std::map< int, unsigned long long int > iVecs
Definition: io.h:59
std::string streamName
Name of the stream to connect to.
Definition: io.h:55
std::map< unsigned long, std::map< unsigned long, DTSCPageData > > pagesByTrack
Holds the data for all pages of a track. Based on unmapped tids.
Definition: io.h:43
unsigned long partNum
The number of parts in this page.
Definition: io.h:22
std::map< unsigned long, unsigned long > trackOffset
Offset of data on user page.
Definition: io.h:46
unsigned long long int firstTime
The first timestamp of the page.
Definition: io.h:25
unsigned long long int dataSize
The full size this page should be.
Definition: io.h:23
bool encrypt
Definition: io.h:57
New track, just sent negotiation request.
Definition: io.h:12
A class for handling shared memory pages.
Definition: shared_memory.h:160
DTSC::Meta myMeta
Stores either the input or output metadata.
Definition: io.h:93
DTSC::Packet thisPacket
Definition: io.h:86
DTSC::Packets can currently be three types: DTSC_HEAD packets are the "DTSC" header string...
Definition: dtsc.h:100
bool standAlone
Definition: io.h:81
negotiationProxy nProxy
Definition: io.h:84