* @brief Recomputes the cached latest-frame capture flag (control script or API server active); * drops the retained chunks when every consumer is gone so FrameReader slots unpin. */
| 527 | * drops the retained chunks when every consumer is gone so FrameReader slots unpin. |
| 528 | */ |
| 529 | void DataModel::FrameBuilder::refreshLatestFrameCapture() |
| 530 | { |
| 531 | const bool wasEnabled = m_captureLatestFrame; |
| 532 | |
| 533 | m_captureLatestFrame = |
| 534 | DataModel::ControlScript::instance().running() || API::Server::instance().enabled(); |
| 535 | |
| 536 | if (wasEnabled && !m_captureLatestFrame) { |
| 537 | m_latestFrames.clear(); |
| 538 | m_latestFrameSourceId = -1; |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | //-------------------------------------------------------------------------------------------------- |
| 543 | // Project model sync |