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

Remove LIVE capability from ftl files

parent cd4510c7
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28283 failed
......@@ -46,6 +46,7 @@ struct Packet {
};
static constexpr unsigned int kStreamCap_Static = 0x01;
static constexpr unsigned int kStreamCap_Recorded = 0x02;
/** V4 packets have no stream flags field */
struct StreamPacketV4 {
......
......@@ -266,7 +266,7 @@ bool File::tick(int64_t ts) {
// Adjust timestamp
// FIXME: A potential bug where multiple times are merged into one?
std::get<0>(data).timestamp = (((std::get<0>(data).timestamp) - first_ts_) / interval_) * interval_ + timestart_;
std::get<0>(data).hint_capability = (is_video_) ? 0 : ftl::codecs::kStreamCap_Static;
std::get<0>(data).hint_capability = ((is_video_) ? 0 : ftl::codecs::kStreamCap_Static) | ftl::codecs::kStreamCap_Recorded;
// Maintain availability of channels.
available(0) += std::get<0>(data).channel;
......
......@@ -2,6 +2,7 @@
#include <ftl/codecs/depth_convert_cuda.hpp>
#include <ftl/profiler.hpp>
#include <ftl/audio/software_decoder.hpp>
#include <ftl/rgbd/capabilities.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/highgui.hpp>
......@@ -23,7 +24,7 @@ using ftl::stream::parsePose;
using ftl::stream::parseConfig;
using ftl::stream::injectCalibration;
using ftl::stream::injectPose;
using ftl::codecs::definition_t;
using ftl::rgbd::Capability;
Receiver::Receiver(nlohmann::json &config, ftl::data::Pool *p) : ftl::Configurable(config), stream_(nullptr), pool_(p) {
timestamp_ = 0;
......@@ -163,7 +164,23 @@ void Receiver::_processData(const StreamPacket &spkt, const Packet &pkt) {
auto &build = builder(spkt.streamID);
auto fs = build.get(spkt.timestamp, spkt.frame_number);
auto &f = (spkt.frame_number == 255) ? **fs : fs->frames[spkt.frame_number];
// Remove LIVE capability if stream hints it is recorded
if (spkt.channel == Channel::Capabilities && (spkt.hint_capability & ftl::codecs::kStreamCap_Recorded)) {
std::any data;
ftl::data::decode_type<std::unordered_set<Capability>>(data, pkt.data);
auto &cap = *std::any_cast<std::unordered_set<Capability>>(&data);
if (cap.count(Capability::LIVE)) {
cap.erase(Capability::LIVE);
}
f.informChange(spkt.channel, build.changeType(), data);
} else {
f.informChange(spkt.channel, build.changeType(), pkt);
}
// TODO: Adjust metadata also for recorded streams
if (spkt.flags & ftl::codecs::kFlagCompleted) {
//UNIQUE_LOCK(vidstate.mutex, lk);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment