\brief GetFirstDetectedFrame \return
| 172 | /// \return |
| 173 | /// |
| 174 | frame_ptr GetFirstDetectedFrame() |
| 175 | { |
| 176 | #if SHOW_QUE_LOG |
| 177 | QUE_LOG << "GetFirstDetectedFrame start" << std::endl; |
| 178 | #endif |
| 179 | std::unique_lock<std::mutex> lock(m_mutex); |
| 180 | queue_t::iterator it = SearchUntracked(); |
| 181 | while (it == m_que.end()) |
| 182 | { |
| 183 | if (m_break.load()) |
| 184 | break; |
| 185 | |
| 186 | m_cond.wait(lock); |
| 187 | it = SearchUntracked(); |
| 188 | //PrintQue(); |
| 189 | } |
| 190 | if (!m_break.load()) |
| 191 | { |
| 192 | frame_ptr frameInfo = *it; |
| 193 | assert(frameInfo->m_inTracker.load() == FrameInfo::StateNotProcessed); |
| 194 | assert(frameInfo->m_inDetector.load() != FrameInfo::StateInProcess && frameInfo->m_inDetector.load() != FrameInfo::StateNotProcessed); |
| 195 | frameInfo->m_inTracker.store(FrameInfo::StateInProcess); |
| 196 | #if SHOW_QUE_LOG |
| 197 | QUE_LOG << "GetFirstDetectedFrame end: " << frameInfo->m_dt << ", frameInd " << frameInfo->m_frameInd << std::endl; |
| 198 | #endif |
| 199 | return frameInfo; |
| 200 | } |
| 201 | return nullptr; |
| 202 | } |
| 203 | |
| 204 | /// |
| 205 | /// \brief GetFirstProcessedFrame |
no test coverage detected