use replicant nodes for audio packet replication

This commit is contained in:
Stephen Birarda 2017-06-12 11:13:43 -07:00
parent 7bfce55559
commit c7b3b79a23

View file

@ -108,7 +108,7 @@ void AudioMixerClientData::processPackets() {
void AudioMixerClientData::replicatePacket(ReceivedMessage& message) {
auto nodeList = DependencyManager::get<NodeList>();
if (!nodeList->getMirrorSocket().isNull()) {
PacketType mirroredType;
if (message.getType() == PacketType::MicrophoneAudioNoEcho) {
@ -130,8 +130,12 @@ void AudioMixerClientData::replicatePacket(ReceivedMessage& message) {
packet->write(message.getSourceID().toRfc4122());
packet->write(message.getMessage());
nodeList->sendPacket(std::move(packet), nodeList->getMirrorSocket());
}
// enumerate the replicant audio mixers and send them the replicated version of this packet
nodeList->eachMatchingNode([&](const SharedNodePointer& node)->bool {
return node->getType() == NodeType::ReplicantAudioMixer;
}, [&](const SharedNodePointer& node) {
nodeList->sendUnreliablePacket(*packet, node->getPublicSocket());
});
}
void AudioMixerClientData::negotiateAudioFormat(ReceivedMessage& message, const SharedNodePointer& node) {