diff --git a/reflector/BMProtocol.cpp b/reflector/BMProtocol.cpp index 6c57bc1..13a2c09 100644 --- a/reflector/BMProtocol.cpp +++ b/reflector/BMProtocol.cpp @@ -198,52 +198,46 @@ void CBMProtocol::HandleQueue(void) // get the packet auto packet = m_Queue.pop(); - // check if origin of packet is local - // if not, do not stream it out as it will cause - // network loop between linked XLX peers - if ( packet->IsLocalOrigin() ) + // encode it + CBuffer buffer; + if ( EncodeDvPacket(*packet, buffer) ) { - // encode it - CBuffer buffer; - if ( EncodeDvPacket(*packet, buffer) ) + // encode revision dependent version + CBuffer bufferLegacy = buffer; + if ( packet->IsDvFrame() && (bufferLegacy.size() == 45) ) { - // encode revision dependent version - CBuffer bufferLegacy = buffer; - if ( packet->IsDvFrame() && (bufferLegacy.size() == 45) ) - { - bufferLegacy.resize(27); - } + bufferLegacy.resize(27); + } - // and push it to all our clients linked to the module and who are not streaming in - CClients *clients = g_Reflector.GetClients(); - auto it = clients->begin(); - std::shared_ptrclient = nullptr; - while ( (client = clients->FindNextClient(EProtocol::bm, it)) != nullptr ) + // and push it to all our clients linked to the module and who are not streaming in + CClients *clients = g_Reflector.GetClients(); + auto it = clients->begin(); + std::shared_ptrclient = nullptr; + while ( (client = clients->FindNextClient(EProtocol::bm, it)) != nullptr ) + { + // is this client busy ? + if ( !client->IsAMaster() && (client->GetReflectorModule() == packet->GetPacketModule()) ) { - // is this client busy ? - if ( !client->IsAMaster() && (client->GetReflectorModule() == packet->GetPacketModule()) ) + // no, send the packet + // this is protocol revision dependent + switch ( client->GetProtocolRevision() ) { - // no, send the packet - // this is protocol revision dependent - switch ( client->GetProtocolRevision() ) - { - case EProtoRev::original: - case EProtoRev::revised: - Send(bufferLegacy, client->GetIp()); - break; - case EProtoRev::ambe: - default: + case EProtoRev::original: + case EProtoRev::revised: + Send(bufferLegacy, client->GetIp()); + break; + case EProtoRev::ambe: + default: #ifdef TRANSCODED_MODULES - Send(buffer, client->GetIp()); + Send(buffer, client->GetIp()); #else - Send(bufferLegacy, client->GetIp()); + Send(bufferLegacy, client->GetIp()); #endif - break; - } + break; } } - g_Reflector.ReleaseClients(); } + g_Reflector.ReleaseClients(); } } m_Queue.Unlock(); @@ -351,9 +345,6 @@ void CBMProtocol::OnDvHeaderPacketIn(std::unique_ptr &Header, c // todo: verify Packet.GetModuleId() is in authorized list of XLX of origin // todo: do the same for DVFrame and DVLAstFrame packets - // tag packet as remote peer origin - Header->SetRemotePeerOrigin(); - // find the stream auto stream = GetStream(Header->GetStreamId()); if ( stream ) @@ -389,15 +380,6 @@ void CBMProtocol::OnDvHeaderPacketIn(std::unique_ptr &Header, c } } -void CBMProtocol::OnDvFramePacketIn(std::unique_ptr &DvFrame, const CIp *Ip) -{ - // tag packet as remote peer origin - DvFrame->SetRemotePeerOrigin(); - - // anc call base class - CProtocol::OnDvFramePacketIn(DvFrame, Ip); -} - //////////////////////////////////////////////////////////////////////////////////////// // packet decoding helpers diff --git a/reflector/BMProtocol.h b/reflector/BMProtocol.h index 06b3905..fa36b2d 100644 --- a/reflector/BMProtocol.h +++ b/reflector/BMProtocol.h @@ -49,7 +49,6 @@ protected: // stream helpers void OnDvHeaderPacketIn(std::unique_ptr &, const CIp &); - void OnDvFramePacketIn(std::unique_ptr &, const CIp * = nullptr); // packet decoding helpers bool IsValidDvHeaderPacket(const CBuffer &, std::unique_ptr &);