Skip to content
Snippets Groups Projects
Commit 80172c7a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow non-realtime mode

parent 3ee7933b
No related branches found
No related tags found
1 merge request!130Implements #203 skipping p-frames
Pipeline #15340 passed
This commit is part of merge request !130. Comments created here will be created in the context of that merge request.
#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;
}
......
......@@ -41,6 +41,8 @@ class FileSource : public detail::Source {
ftl::codecs::Decoder *decoders_[2];
bool realtime_;
void _removeChannel(int channel);
void _createDecoder(int ix, const ftl::codecs::Packet &pkt);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment