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

For for not selecting colour channe

parent c233e366
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #27484 failed
......@@ -118,23 +118,19 @@ static void run(ftl::Configurable *root) {
ftl::stream::Receiver *gen = ftl::create<ftl::stream::Receiver>(root, "receiver", &pool);
gen->setStream(stream);
//sender->onRequest([stream](const ftl::codecs::StreamPacket &spkt, const ftl::codecs::Packet &pkt) {
// if (spkt.channel == Channel::Colour) {
// stream->reset();
// }
//});
int count = 0;
for (auto &s : stream_uris) {
LOG(INFO) << " --- found stream: " << s;
auto *nstream = ftl::create<ftl::stream::Net>(stream, std::string("netstream")+std::to_string(count), net);
nstream->set("uri", s);
//nstream->select(0, {Channel::Colour}, true);
stream->add(nstream);
++count;
}
generators.push_back(gen);
stream->begin();
stream->select(0, Channel::Colour + Channel::Depth, true);
}
for (auto *g : generators) {
......
......@@ -63,10 +63,11 @@ bool Net::post(const ftl::codecs::StreamPacket &spkt, const ftl::codecs::Packet
// Check if the channel has been requested recently enough. If not then disable it.
if (host_ && pkt.data.size() > 0 && spkt.frame_number == 0 && static_cast<int>(spkt.channel) >= 0 && static_cast<int>(spkt.channel) < 32) {
if (reqtally_[static_cast<int>(spkt.channel)] == 0) {
--reqtally_[static_cast<int>(spkt.channel)];
auto sel = selected(0);
sel -= spkt.channel;
select(0, sel);
LOG(INFO) << "Unselect Channel: " << (int)spkt.channel;
LOG(INFO) << "Unselect Channel: " << (int)spkt.channel << " (" << (int)spkt.streamID << ")";
} else {
--reqtally_[static_cast<int>(spkt.channel)];
}
......@@ -185,9 +186,10 @@ bool Net::begin() {
if (tally_ <= 5) {
// Yes, so send new requests
if (size() > 0) {
auto sel = selected(0);
const auto &sel = selected(0);
for (auto c : sel) {
LOG(INFO) << "DO I SEND REQ";
_sendRequest(c, kAllFramesets, kAllFrames, 30, 0);
}
}
......@@ -213,6 +215,7 @@ bool Net::begin() {
} else {
select(spkt.frameSetID(), selected(spkt.frameSetID()) + spkt.channel);
}
LOG(INFO) << "GOT REQUEST";
_processRequest(p, pkt);
} else {
// FIXME: Allow availability to change...
......@@ -266,7 +269,7 @@ void Net::reset() {
bool Net::_sendRequest(Channel c, uint8_t frameset, uint8_t frames, uint8_t count, uint8_t bitrate) {
if (!active_ || host_) return false;
//LOG(INFO) << "SENDING REQUEST FOR " << (int)c;
LOG(INFO) << "SENDING REQUEST FOR " << (int)c;
Packet pkt = {
codec_t::Any, // TODO: Allow specific codec requests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment