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

WIP Allow render all framesets by default

parent 3f0e4962
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
...@@ -194,6 +194,8 @@ class Peer { ...@@ -194,6 +194,8 @@ class Peer {
void rawClose() { _badClose(false); } void rawClose() { _badClose(false); }
inline void noReconnect() { can_reconnect_ = false; }
public: public:
static const int kMaxMessage = 10*1024*1024; // 10Mb currently static const int kMaxMessage = 10*1024*1024; // 10Mb currently
......
...@@ -28,6 +28,7 @@ class Source : public ftl::Configurable, public ftl::data::DiscreteSource { ...@@ -28,6 +28,7 @@ class Source : public ftl::Configurable, public ftl::data::DiscreteSource {
ftl::data::FrameSetPtr input_; ftl::data::FrameSetPtr input_;
std::unique_ptr<ftl::render::CUDARender> renderer_; std::unique_ptr<ftl::render::CUDARender> renderer_;
ftl::Configurable *intrinsics_; ftl::Configurable *intrinsics_;
uint32_t my_id_;
}; };
} }
......
...@@ -358,7 +358,7 @@ void Feed::autoConnect() { ...@@ -358,7 +358,7 @@ void Feed::autoConnect() {
auto &known_hosts = getConfig()["known_hosts"]; auto &known_hosts = getConfig()["known_hosts"];
for (auto &h : known_hosts.items()) { for (auto &h : known_hosts.items()) {
net_->connect(h.key()); net_->connect(h.key())->noReconnect();
} }
}); });
} }
......
...@@ -10,7 +10,7 @@ using ftl::rgbd::Capability; ...@@ -10,7 +10,7 @@ using ftl::rgbd::Capability;
Source::Source(nlohmann::json &config, ftl::stream::Feed *feed) Source::Source(nlohmann::json &config, ftl::stream::Feed *feed)
: ftl::Configurable(config), feed_(feed) { : ftl::Configurable(config), feed_(feed), my_id_(0) {
restore("device:render", { restore("device:render", {
"renderer", "renderer",
"source", "source",
...@@ -33,6 +33,14 @@ Source::Source(nlohmann::json &config, ftl::stream::Feed *feed) ...@@ -33,6 +33,14 @@ Source::Source(nlohmann::json &config, ftl::stream::Feed *feed)
std::atomic_store(&input_, fs); std::atomic_store(&input_, fs);
return true; return true;
}); });
} else {
filter_ = feed_->filter({Channel::Colour, Channel::Depth});
filter_->on([this](const ftl::data::FrameSetPtr &fs) {
if (fs->frameset() == my_id_) return true; // Never render self
std::atomic_store(&input_, fs);
return true;
});
} }
on("source", [this](const ftl::config::Event &e) { on("source", [this](const ftl::config::Event &e) {
...@@ -62,6 +70,8 @@ bool Source::capture(int64_t ts) { ...@@ -62,6 +70,8 @@ bool Source::capture(int64_t ts) {
bool Source::retrieve(ftl::data::Frame &frame_out) { bool Source::retrieve(ftl::data::Frame &frame_out) {
auto input = std::atomic_load(&input_); auto input = std::atomic_load(&input_);
my_id_ = frame_out.frameset();
if (input) { if (input) {
ftl::rgbd::Frame &rgbdframe = frame_out.cast<ftl::rgbd::Frame>(); ftl::rgbd::Frame &rgbdframe = frame_out.cast<ftl::rgbd::Frame>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment