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

Fix for missing calib and iframe problem

parent 35cb3d88
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28475 failed
......@@ -21,7 +21,8 @@ enum class Capability : int {
TOUCH, // Touch related feedback supported
VR, // Is a VR device, so provides own active pose etc
LIVE, // Live, not recorded (removed from ftl file sources)
FUSED // Reconstruction has been performed
FUSED, // Reconstruction has been performed
STREAMED // Means it came from a stream and not device
};
std::string capabilityName(Capability);
......
......@@ -66,6 +66,8 @@ class Receiver : public ftl::Configurable, public ftl::data::Generator {
cv::cuda::GpuMat surface[32];
MUTEX mutex;
ftl::codecs::Channels<0> completed;
int width=0;
int height=0;
};
struct InternalAudioStates {
......
......@@ -183,12 +183,20 @@ void Receiver::_processData(const StreamPacket &spkt, const Packet &pkt) {
if (cap.count(Capability::LIVE)) {
cap.erase(Capability::LIVE);
}
cap.emplace(Capability::STREAMED);
f.informChange(spkt.channel, build.changeType(), data);
} else {
f.informChange(spkt.channel, build.changeType(), pkt);
}
if (spkt.channel == Channel::Calibration) {
const auto &calibration = std::get<0>(f.get<std::tuple<ftl::rgbd::Camera, ftl::codecs::Channel, int>>(Channel::Calibration));
InternalVideoStates &ividstate = _getVideoFrame(spkt);
ividstate.width = calibration.width;
ividstate.height = calibration.height;
}
// TODO: Adjust metadata also for recorded streams
if (spkt.flags & ftl::codecs::kFlagCompleted) {
......@@ -288,15 +296,20 @@ void Receiver::_processVideo(const StreamPacket &spkt, const Packet &pkt) {
auto &build = builder(spkt.streamID);
auto fs = build.get(spkt.timestamp, spkt.frame_number+pkt.frame_count-1); // TODO: This is a hack
if (!fs->frames[spkt.frame_number].has(Channel::Calibration)) {
LOG(WARNING) << "No calibration, skipping frame";
//if (!fs->frames[spkt.frame_number].has(Channel::Calibration)) {
// LOG(WARNING) << "No calibration, skipping frame: " << spkt.timestamp;
// return;
//}
//const auto &calibration = std::get<0>(fs->frames[spkt.frame_number].get<std::tuple<ftl::rgbd::Camera, ftl::codecs::Channel, int>>(Channel::Calibration));
int width = ividstate.width; //calibration.width;
int height = ividstate.height; //calibration.height;
if (width == 0 || height == 0) {
LOG(WARNING) << "No calibration, skipping frame: " << spkt.timestamp;
return;
}
const auto &calibration = std::get<0>(fs->frames[spkt.frame_number].get<std::tuple<ftl::rgbd::Camera, ftl::codecs::Channel, int>>(Channel::Calibration));
int width = calibration.width;
int height = calibration.height;
//LOG(INFO) << " CODEC = " << (int)pkt.codec << " " << (int)pkt.flags << " " << (int)spkt.channel;
//LOG(INFO) << "Decode surface: " << (width*tx) << "x" << (height*ty);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment