add audio connection to final part of connection steps

This commit is contained in:
Stephen Birarda 2015-05-26 10:44:45 -07:00
parent f28ade1075
commit f9251471da
4 changed files with 18 additions and 5 deletions

View file

@ -875,7 +875,7 @@ void AudioClient::handleAudioInput() {
_stats.sentPacket();
// qDebug() << "Sending audio packet at" << usecTimestampNow();
nodeList->flagTimeForConnectionStep(NodeList::ConnectionStep::SendFirstAudioPacket);
int packetBytes = currentPacketPtr - audioDataPacket;
nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer);
@ -923,6 +923,8 @@ void AudioClient::sendMuteEnvironmentPacket() {
}
void AudioClient::addReceivedAudioToStream(const QByteArray& audioByteArray) {
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::ReceiveFirstAudioPacket);
if (_audioOutput) {
// Audio output must exist and be correctly set up if we're going to process received audio
_receivedAudioStream.parseData(audioByteArray);

View file

@ -106,8 +106,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl) {
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::LookupAddress,
usecTimestampNow());
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::LookupAddress);
// there are 4 possible lookup strings

View file

@ -636,6 +636,10 @@ void NodeList::pingInactiveNodes() {
if (!node->getActiveSocket()) {
// we don't have an active link to this node, ping it to set that up
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()) {
sendingNode->activateSymmetricSocket();
}
if (sendingNode->getType() == NodeType::AudioMixer) {
flagTimeForConnectionStep(NodeList::ConnectionStep::SetAudioMixerSocket);
}
}
void NodeList::flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep) {

View file

@ -60,7 +60,11 @@ public:
SetDomainHostname,
SetDomainSocket,
SendFirstDSCheckIn,
ReceiveFirstDSList
ReceiveFirstDSList,
SendFirstAudioPing,
SetAudioMixerSocket,
SendFirstAudioPacket,
ReceiveFirstAudioPacket
};
};
@ -116,7 +120,7 @@ private:
void sendDSPathQuery(const QString& newPath);
void flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep, qint64 timestamp);
void flagTimeForConnectionStep(NodeList::ConnectionStep::Value connectionStep, quint64 timestamp);
NodeType_t _ownerType;
NodeSet _nodeTypesOfInterest;