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

data channel

parent b4bdf6cb
No related branches found
No related tags found
No related merge requests found
...@@ -121,8 +121,9 @@ void Receiver::_processState(const StreamPacket &spkt, const Packet &pkt) { ...@@ -121,8 +121,9 @@ void Receiver::_processState(const StreamPacket &spkt, const Packet &pkt) {
} }
void Receiver::_processData(const StreamPacket &spkt, const Packet &pkt) { void Receiver::_processData(const StreamPacket &spkt, const Packet &pkt) {
InternalVideoStates &frame = _getVideoFrame(spkt); //InternalVideoStates &frame = _getVideoFrame(spkt);
frame.frame.createRawData(spkt.channel, pkt.data); auto &frame = builder_[spkt.streamID].get(spkt.timestamp, spkt.frame_number);
frame.createRawData(spkt.channel, pkt.data);
} }
void Receiver::_processAudio(const StreamPacket &spkt, const Packet &pkt) { void Receiver::_processAudio(const StreamPacket &spkt, const Packet &pkt) {
......
...@@ -141,7 +141,26 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) { ...@@ -141,7 +141,26 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) {
if (frame.hasChanged(Channel::Configuration)) injectConfig(stream_, fs, i); if (frame.hasChanged(Channel::Configuration)) injectConfig(stream_, fs, i);
} }
for (auto c : frame.getChannels()) { // FIXME: Allow data channel selection rather than always send
for (auto c : frame.getDataChannels()) {
StreamPacket spkt;
spkt.version = 4;
spkt.timestamp = fs.timestamp;
spkt.streamID = 0; //fs.id;
spkt.frame_number = i;
spkt.channel = c;
ftl::codecs::Packet pkt;
pkt.codec = ftl::codecs::codec_t::MSGPACK;
pkt.definition = ftl::codecs::definition_t::Any;
pkt.frame_count = 1;
pkt.flags = 0;
pkt.bitrate = 0;
pkt.data = frame.getRawData(c);
stream_->post(spkt, pkt);
}
for (auto c : frame.getChannels()) {
if (selected.has(c)) { if (selected.has(c)) {
// FIXME: Sends high res colour, but receive end currently broken // FIXME: Sends high res colour, but receive end currently broken
//auto cc = (c == Channel::Colour && frame.hasChannel(Channel::ColourHighRes)) ? Channel::ColourHighRes : Channel::Colour; //auto cc = (c == Channel::Colour && frame.hasChannel(Channel::ColourHighRes)) ? Channel::ColourHighRes : Channel::Colour;
...@@ -174,27 +193,9 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) { ...@@ -174,27 +193,9 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) {
} else { } else {
available += c; available += c;
} }
}
// FIXME: Allow data channel selection rather than always send
for (auto c : frame.getDataChannels()) {
StreamPacket spkt;
spkt.version = 4;
spkt.timestamp = fs.timestamp;
spkt.streamID = 0; //fs.id;
spkt.frame_number = i;
spkt.channel = c;
ftl::codecs::Packet pkt;
pkt.codec = ftl::codecs::codec_t::MSGPACK;
pkt.definition = ftl::codecs::definition_t::Any;
pkt.frame_count = 1;
pkt.flags = 0;
pkt.bitrate = 0;
pkt.data = frame.getRawData(c);
stream_->post(spkt, pkt);
} }
}
}
for (auto c : available) { for (auto c : available) {
// Not selected so send an empty packet... // Not selected so send an empty packet...
......
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