diff --git a/components/rgbd-sources/src/group.cpp b/components/rgbd-sources/src/group.cpp index 29c4ef38d221e113d25c2564d3b39310ca032189..1d700e10856192dca7eca6a2bc9544e3b887af16 100644 --- a/components/rgbd-sources/src/group.cpp +++ b/components/rgbd-sources/src/group.cpp @@ -191,7 +191,7 @@ void Group::sync(std::function<bool(ftl::rgbd::FrameSet &)> cb) { // The buffers are invalid after callback so mark stale fs->stale = true; } else { - DLOG(INFO) << "NO FRAME FOUND: " << last_ts_ - latency_*mspf_; + //LOG(INFO) << "NO FRAME FOUND: " << last_ts_ - latency_*mspf_; } } @@ -232,11 +232,12 @@ ftl::rgbd::FrameSet *Group::_getFrameset(int f) { } void Group::_addFrameset(int64_t timestamp) { - int count = (framesets_[head_].timestamp == -1) ? 1 : (timestamp - framesets_[head_].timestamp) / mspf_; + int count = (framesets_[head_].timestamp == -1) ? 200 : (timestamp - framesets_[head_].timestamp) / mspf_; + //LOG(INFO) << "Massive timestamp difference: " << count; // Allow for massive timestamp changes (Windows clock adjust) // Only add a single frameset for large changes - if (count < -kFrameBufferSize || count >= kFrameBufferSize-1) { + if (count < -int(kFrameBufferSize) || count >= kFrameBufferSize-1) { head_ = (head_+1) % kFrameBufferSize; if (!framesets_[head_].mtx.try_lock()) { diff --git a/components/rgbd-sources/src/net.cpp b/components/rgbd-sources/src/net.cpp index e0e5ff11dd69d29f0de456c7b8f05fce3bdc7d23..3cab6c86d5e6cf45dc1a22a0643e2e58c4f3cd73 100644 --- a/components/rgbd-sources/src/net.cpp +++ b/components/rgbd-sources/src/net.cpp @@ -185,7 +185,7 @@ void NetSource::_recvChunk(int64_t ts, int chunk, bool delta, const vector<unsig auto start = std::chrono::high_resolution_clock::now(); int64_t now = std::chrono::time_point_cast<std::chrono::milliseconds>(start).time_since_epoch().count(); - //if (now-ts < 10) LOG(INFO) << ts << " - Chunk Latency = " << (now - ts) << " - " << ftl::pool.q_size(); + //LOG(INFO) << ts << " - Chunk Latency (" << chunk_count_ << ") = " << (now - ts) << " - " << ftl::pool.q_size(); //if (now - ts > 160) { // LOG(INFO) << "OLD PACKET: " << host_->getURI() << " (" << chunk << ") - " << ts << " (" << (now - ts) << ")"; //} @@ -238,7 +238,7 @@ void NetSource::_recvChunk(int64_t ts, int chunk, bool delta, const vector<unsig timestamp_ = frame.timestamp; if (frame.timestamp >= 0 && frame.chunk_count == chunk_count_) { - //LOG(INFO) << "Frame finished"; + //LOG(INFO) << "Frame finished: " << frame.timestamp; auto cb = host_->callback(); if (cb) { cb(frame.timestamp, frame.channel1, frame.channel2); diff --git a/components/rgbd-sources/src/streamer.cpp b/components/rgbd-sources/src/streamer.cpp index 2837da31b81055cda8497617c5e89570137a1463..7a47a207f7e9d3b3f5d0617b39818adeceed2c42 100644 --- a/components/rgbd-sources/src/streamer.cpp +++ b/components/rgbd-sources/src/streamer.cpp @@ -377,7 +377,7 @@ void Streamer::_encodeAndTransmit(StreamSource *src, const cv::Mat &rgb, const c (*c).txcount = (*c).txmax; } else { ++(*c).txcount; - //LOG(INFO) << "SENT CHUNK : " << frame_no_*mspf_ << "-" << chunk; + //LOG(INFO) << "SENT CHUNK : " << frame_no_ << "-" << chunk; } } catch(...) { (*c).txcount = (*c).txmax;