mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
add audio connection to final part of connection steps
This commit is contained in:
parent
f28ade1075
commit
f9251471da
4 changed files with 18 additions and 5 deletions
|
@ -875,7 +875,7 @@ void AudioClient::handleAudioInput() {
|
||||||
|
|
||||||
_stats.sentPacket();
|
_stats.sentPacket();
|
||||||
|
|
||||||
// qDebug() << "Sending audio packet at" << usecTimestampNow();
|
nodeList->flagTimeForConnectionStep(NodeList::ConnectionStep::SendFirstAudioPacket);
|
||||||
|
|
||||||
int packetBytes = currentPacketPtr - audioDataPacket;
|
int packetBytes = currentPacketPtr - audioDataPacket;
|
||||||
nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer);
|
nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer);
|
||||||
|
@ -923,6 +923,8 @@ void AudioClient::sendMuteEnvironmentPacket() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioClient::addReceivedAudioToStream(const QByteArray& audioByteArray) {
|
void AudioClient::addReceivedAudioToStream(const QByteArray& audioByteArray) {
|
||||||
|
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::ReceiveFirstAudioPacket);
|
||||||
|
|
||||||
if (_audioOutput) {
|
if (_audioOutput) {
|
||||||
// Audio output must exist and be correctly set up if we're going to process received audio
|
// Audio output must exist and be correctly set up if we're going to process received audio
|
||||||
_receivedAudioStream.parseData(audioByteArray);
|
_receivedAudioStream.parseData(audioByteArray);
|
||||||
|
|
|
@ -106,8 +106,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl) {
|
||||||
|
|
||||||
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
|
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
|
||||||
|
|
||||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::LookupAddress,
|
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::LookupAddress);
|
||||||
usecTimestampNow());
|
|
||||||
|
|
||||||
// there are 4 possible lookup strings
|
// there are 4 possible lookup strings
|
||||||
|
|
||||||
|
|
|
@ -636,6 +636,10 @@ void NodeList::pingInactiveNodes() {
|
||||||
if (!node->getActiveSocket()) {
|
if (!node->getActiveSocket()) {
|
||||||
// we don't have an active link to this node, ping it to set that up
|
// we don't have an active link to this node, ping it to set that up
|
||||||
pingPunchForInactiveNode(node);
|
pingPunchForInactiveNode(node);
|
||||||
|
|
||||||
|
if (node->getType() == NodeType::AudioMixer) {
|
||||||
|
flagTimeForConnectionStep(NodeList::ConnectionStep::SendFirstAudioPing);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -657,6 +661,10 @@ void NodeList::activateSocketFromNodeCommunication(const QByteArray& packet, con
|
||||||
} else if (pingType == PingType::Symmetric && !sendingNode->getActiveSocket()) {
|
} else if (pingType == PingType::Symmetric && !sendingNode->getActiveSocket()) {
|
||||||
sendingNode->activateSymmetricSocket();
|
sendingNode->activateSymmetricSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sendingNode->getType() == NodeType::AudioMixer) {
|
||||||
|
flagTimeForConnectionStep(NodeList::ConnectionStep::SetAudioMixerSocket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeList::flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep) {
|
void NodeList::flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep) {
|
||||||
|
|
|
@ -60,7 +60,11 @@ public:
|
||||||
SetDomainHostname,
|
SetDomainHostname,
|
||||||
SetDomainSocket,
|
SetDomainSocket,
|
||||||
SendFirstDSCheckIn,
|
SendFirstDSCheckIn,
|
||||||
ReceiveFirstDSList
|
ReceiveFirstDSList,
|
||||||
|
SendFirstAudioPing,
|
||||||
|
SetAudioMixerSocket,
|
||||||
|
SendFirstAudioPacket,
|
||||||
|
ReceiveFirstAudioPacket
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -116,7 +120,7 @@ private:
|
||||||
|
|
||||||
void sendDSPathQuery(const QString& newPath);
|
void sendDSPathQuery(const QString& newPath);
|
||||||
|
|
||||||
void flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep, qint64 timestamp);
|
void flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep, quint64 timestamp);
|
||||||
|
|
||||||
NodeType_t _ownerType;
|
NodeType_t _ownerType;
|
||||||
NodeSet _nodeTypesOfInterest;
|
NodeSet _nodeTypesOfInterest;
|
||||||
|
|
Loading…
Reference in a new issue