Skip to content
Snippets Groups Projects

Implements #203 skipping p-frames

Merged Nicolas Pope requested to merge feature/203/pframeskip into master
2 files
+ 11
1
Compare changes
  • Side-by-side
  • Inline
Files
2
#include "file_source.hpp"
#include <ftl/timer.hpp>
using ftl::rgbd::detail::FileSource;
using ftl::codecs::codec_t;
@@ -23,6 +25,8 @@ FileSource::FileSource(ftl::rgbd::Source *s, ftl::codecs::Reader *r, int sid) :
decoders_[1] = nullptr;
cache_read_ = -1;
cache_write_ = 0;
realtime_ = host_->value("realtime", true);
timestamp_ = r->getStartTime();
r->onPacket(sid, [this](const ftl::codecs::StreamPacket &spkt, ftl::codecs::Packet &pkt) {
if (pkt.codec == codec_t::POSE) {
@@ -66,7 +70,11 @@ void FileSource::_removeChannel(int channel) {
}
bool FileSource::capture(int64_t ts) {
timestamp_ = ts;
if (realtime_) {
timestamp_ = ts;
} else {
timestamp_ += ftl::timer::getInterval();
}
return true;
}
Loading