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

Send all persistent data on inject

parent 7284c79c
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -86,6 +86,8 @@ class Sender : public ftl::Configurable {
cv::Rect _generateROI(const ftl::rgbd::FrameSet &fs, ftl::codecs::Channel c, int offset, bool stereo);
float _selectFloatMax(ftl::codecs::Channel c);
ftl::audio::Encoder *_getAudioEncoder(int fsid, int sid, ftl::codecs::Channel c, ftl::codecs::Packet &pkt);
void _sendPersistent(ftl::data::Frame &frame);
};
}
......
......@@ -106,6 +106,15 @@ static void mergeNALUnits(const std::list<ftl::codecs::Packet> &pkts, ftl::codec
}
}
void Sender::_sendPersistent(ftl::data::Frame &frame) {
auto *session = frame.parent();
if (session) {
for (auto c : session->channels()) {
Sender::post(frame, c);
}
}
}
void Sender::post(ftl::data::FrameSet &fs, ftl::codecs::Channel c, bool noencode) {
if (!stream_) return;
......@@ -123,7 +132,7 @@ void Sender::post(ftl::data::FrameSet &fs, ftl::codecs::Channel c, bool noencode
bool do_iframe = injection_timestamp_ == fs.timestamp();
// FIXME: Not ideal
if (do_iframe) do_inject = true;
//if (do_iframe) do_inject = true;
FTL_Profile("SenderPost", 0.02);
......@@ -149,15 +158,17 @@ void Sender::post(ftl::data::FrameSet &fs, ftl::codecs::Channel c, bool noencode
bool needs_encoding = true;
for (size_t i=0; i<fs.frames.size(); ++i) {
const auto &frame = fs.frames[i];
auto &frame = fs.frames[i];
if (!frame.hasOwn(c)) continue;
// TODO: Send entire persistent session on inject
if (do_inject) {
_sendPersistent(frame);
//LOG(INFO) << "Force inject calibration";
if (frame.has(Channel::Calibration)) injectCalibration(stream_, fs, i);
if (frame.has(Channel::Calibration2)) injectCalibration(stream_, fs, i, true);
if (frame.has(Channel::Pose)) injectPose(stream_, fs, i);
//if (frame.has(Channel::Calibration)) injectCalibration(stream_, fs, i);
//if (frame.has(Channel::Calibration2)) injectCalibration(stream_, fs, i, true);
//if (frame.has(Channel::Pose)) injectPose(stream_, fs, i);
//injectConfig(stream_, fs, i);
} else {
//if (frame.changed(Channel::Pose)) injectPose(stream_, fs, i);
......
......@@ -328,6 +328,8 @@ class Frame {
inline Pool *pool() const { return pool_; }
inline Session *parent() const { return parent_; }
inline FrameMode mode() const { return mode_; }
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment