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

Allow stream frameset id

parent f42a0d30
No related branches found
No related tags found
No related merge requests found
Pipeline #19582 passed
...@@ -112,7 +112,7 @@ class Muxer : public Stream { ...@@ -112,7 +112,7 @@ class Muxer : public Stream {
explicit Muxer(nlohmann::json &config); explicit Muxer(nlohmann::json &config);
virtual ~Muxer(); virtual ~Muxer();
void add(Stream *); void add(Stream *, int fsid=0);
bool onPacket(const StreamCallback &) override; bool onPacket(const StreamCallback &) override;
......
...@@ -310,6 +310,7 @@ void Receiver::setStream(ftl::stream::Stream *s) { ...@@ -310,6 +310,7 @@ void Receiver::setStream(ftl::stream::Stream *s) {
//LOG(INFO) << "PACKET: " << spkt.timestamp << ", " << (int)spkt.channel << ", " << (int)pkt.codec << ", " << (int)pkt.definition; //LOG(INFO) << "PACKET: " << spkt.timestamp << ", " << (int)spkt.channel << ", " << (int)pkt.codec << ", " << (int)pkt.definition;
// TODO: Allow for multiple framesets // TODO: Allow for multiple framesets
if (spkt.frameSetID() > 0) LOG(INFO) << "Frameset " << spkt.frameSetID() << " received";
if (spkt.frameSetID() > 0) return; if (spkt.frameSetID() > 0) return;
// Too many frames, so ignore. // Too many frames, so ignore.
......
...@@ -49,18 +49,18 @@ Muxer::~Muxer() { ...@@ -49,18 +49,18 @@ Muxer::~Muxer() {
} }
void Muxer::add(Stream *s) { void Muxer::add(Stream *s, int fsid) {
UNIQUE_LOCK(mutex_,lk); UNIQUE_LOCK(mutex_,lk);
auto &se = streams_.emplace_back(); auto &se = streams_.emplace_back();
int i = streams_.size()-1; int i = streams_.size()-1;
se.stream = s; se.stream = s;
s->onPacket([this,s,i](const ftl::codecs::StreamPacket &spkt, const ftl::codecs::Packet &pkt) { s->onPacket([this,s,i,fsid](const ftl::codecs::StreamPacket &spkt, const ftl::codecs::Packet &pkt) {
//SHARED_LOCK(mutex_, lk); //SHARED_LOCK(mutex_, lk);
ftl::codecs::StreamPacket spkt2 = spkt; ftl::codecs::StreamPacket spkt2 = spkt;
spkt2.streamID = 0; spkt2.streamID = fsid;
if (spkt2.frame_number < 255) { if (spkt2.frame_number < 255) {
int id = _lookup(i, spkt.frame_number); int id = _lookup(i, spkt.frame_number);
......
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