MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / startStreaming

Method startStreaming

src/output/StreamThreadBase.cpp:98–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96// =========================================================================
97
98bool StreamThreadBase::startStreaming(const int clientID) {
99 _clientID = clientID;
100 const int streamID = _stream.getStreamID();
101 const StreamClient &client = _stream.getStreamClient(clientID);
102
103 doStartStreaming(clientID);
104
105 _cseq = 0x0000;
106 _writeIndex = 0;
107 _readIndex = 0;
108 _tsBuffer[_writeIndex].reset();
109
110 if (!startThread()) {
111 SI_LOG_ERROR("Stream: %d, Start %s Start stream to %s:%d ERROR", streamID, _protocol.c_str(),
112 client.getIPAddressOfStream().c_str(), getStreamSocketPort(clientID));
113 return false;
114 }
115 // Set priority above normal for this Thread
116 setPriority(Priority::AboveNormal);
117
118 // set begin timestamp
119 _t1 = std::chrono::steady_clock::now();
120
121 _state = State::Running;
122 SI_LOG_INFO("Stream: %d, Start %s stream to %s:%d", streamID, _protocol.c_str(),
123 client.getIPAddressOfStream().c_str(), getStreamSocketPort(clientID));
124
125 return true;
126}
127
128bool StreamThreadBase::pauseStreaming(const int clientID) {
129 bool paused = true;

Callers 3

updateMethod · 0.45
doStartStreamingMethod · 0.45
doStartStreamingMethod · 0.45

Calls 3

getIPAddressOfStreamMethod · 0.80
getStreamIDMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected