| 96 | // ========================================================================= |
| 97 | |
| 98 | bool 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 | |
| 128 | bool StreamThreadBase::pauseStreaming(const int clientID) { |
| 129 | bool paused = true; |
no test coverage detected