Skip to content
Snippets Groups Projects
Commit c7c9efa0 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

fix channel aggregation

parent 903f2032
No related branches found
No related tags found
No related merge requests found
Pipeline #19784 passed
......@@ -33,6 +33,8 @@ class Camera {
int width() const { return width_; }
int height() const { return height_; }
int getFramesetId() const { return fsid_; }
void setPose(const Eigen::Matrix4d &p);
void mouseMovement(int rx, int ry, int button);
......
......@@ -81,7 +81,7 @@ SourceWindow::SourceWindow(ftl::gui::Screen *screen)
cycle_ = 0;
receiver_->onFrameSet([this](ftl::rgbd::FrameSet &fs) {
// Request the channels required by current camera configuration
interceptor_->select(fs.id, _aggregateChannels());
interceptor_->select(fs.id, _aggregateChannels(fs.id));
/*if (fs.id > 0) {
LOG(INFO) << "Got frameset: " << fs.id;
......@@ -201,14 +201,16 @@ void SourceWindow::stopRecordingVideo() {
}
}
ftl::codecs::Channels<0> SourceWindow::_aggregateChannels() {
ftl::codecs::Channels<0> SourceWindow::_aggregateChannels(int id) {
ftl::codecs::Channels<0> cs = ftl::codecs::Channels<0>(Channel::Colour);
for (auto cam : cameras_) {
if (cam.second.camera->isVirtual()) {
cs += Channel::Depth;
} else {
if (cam.second.camera->getChannel() != Channel::None) {
cs += cam.second.camera->getChannel();
if (cam.second.camera->getFramesetId() == id) {
if (cam.second.camera->isVirtual()) {
cs += Channel::Depth;
} else {
if (cam.second.camera->getChannel() != Channel::None) {
cs += cam.second.camera->getChannel();
}
}
}
}
......
......@@ -79,7 +79,7 @@ class SourceWindow : public nanogui::Window {
void _updateCameras(const std::vector<std::string> &netcams);
void _createDefaultCameras(ftl::rgbd::FrameSet &fs, bool makevirtual);
ftl::codecs::Channels<0> _aggregateChannels();
ftl::codecs::Channels<0> _aggregateChannels(int id);
void _checkFrameSets(int id);
};
......
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