Commit 27490f1c authored by jcacerec's avatar jcacerec
Browse files

ready for 1.0.5 release

parent 1b8e2bac
---
1.0.5
- (added) Compatibility with JamLink boxes (at 48KHz and 64 buffer size)
- (added) Option for packet without header
- (added) Compatibility with JamLink boxes (restricted at the moment to 48KHz, 64 buffer size and 1 channel)
- (added) New port structure that allows the communication between a public server and a local client
- (added) Option for packets without header
- (added) Option to change default client name
- (fixed) General optimizations and code cleanup
......
......@@ -55,14 +55,14 @@ using std::cout; using std::endl;
//*******************************************************************************
JackTrip::JackTrip(jacktripModeT JacktripMode,
dataProtocolT DataProtocolType,
int NumChans,
int BufferQueueLength,
unsigned int redundancy,
JackAudioInterface::audioBitResolutionT AudioBitResolution,
DataProtocol::packetHeaderTypeT PacketHeaderType,
underrunModeT UnderRunMode,
int receiver_bind_port, int sender_peer_port,
int sender_bind_port, int receiver_peer_port) :
int NumChans,
int BufferQueueLength,
unsigned int redundancy,
JackAudioInterface::audioBitResolutionT AudioBitResolution,
DataProtocol::packetHeaderTypeT PacketHeaderType,
underrunModeT UnderRunMode,
int receiver_bind_port, int sender_bind_port,
int receiver_peer_port, int sender_peer_port) :
mJackTripMode(JacktripMode),
mDataProtocol(DataProtocolType),
mPacketHeaderType(PacketHeaderType),
......@@ -228,9 +228,6 @@ void JackTrip::start()
break;
}
cout << "mSenderPeerPort === " << mSenderPeerPort << endl;
cout << "mReceiverPeerPort === " << mReceiverPeerPort << endl;
// Start Threads
mJackAudio->startProcess();
for (int i = 0; i < mProcessPlugins.size(); ++i) {
......@@ -300,7 +297,7 @@ void JackTrip::serverStart()
// Get the client address when it connects
cout << "Waiting for Connection From Client..." << endl;
QHostAddress peerHostAddress;
uint16_t port;
uint16_t peer_port;
QUdpSocket UdpSockTemp;// Create socket to wait for client
// Bind the socket
......@@ -313,7 +310,7 @@ void JackTrip::serverStart()
while ( !UdpSockTemp.hasPendingDatagrams() ) { QThread::usleep(100000); }
char buf[1];
// set client address
UdpSockTemp.readDatagram(buf, 1, &peerHostAddress, &port);
UdpSockTemp.readDatagram(buf, 1, &peerHostAddress, &peer_port);
UdpSockTemp.close(); // close the socket
mPeerAddress = peerHostAddress.toString();
......@@ -325,9 +322,14 @@ void JackTrip::serverStart()
mDataProtocolSender->setPeerAddress( mPeerAddress.toLatin1().constData() );
mDataProtocolReceiver->setPeerAddress( mPeerAddress.toLatin1().constData() );
// We reply to the same port the peer sent the packets
mDataProtocolSender->setPeerPort(port);
mDataProtocolReceiver->setPeerPort(port);
setPeerPorts(port);
// This way we can go through NAT
// Because of the NAT traversal scheme, the portn need to be
// "symetric", e.g.:
// from Client to Server : src = 4474, dest = 4464
// from Server to Client : src = 4464, dest = 4474
mDataProtocolSender->setPeerPort(peer_port);
mDataProtocolReceiver->setPeerPort(peer_port);
setPeerPorts(peer_port);
}
//*******************************************************************************
......
......@@ -104,9 +104,9 @@ public:
DataProtocol::DEFAULT,
underrunModeT UnderRunMode = WAVETABLE,
int receiver_bind_port = gDefaultPort,
int sender_peer_port = gDefaultPort,
int sender_bind_port = gDefaultPort,
int receiver_peer_port = gDefaultPort);
int receiver_peer_port = gDefaultPort,
int sender_peer_port = gDefaultPort);
/// \brief The class destructor
virtual ~JackTrip();
......
......@@ -215,10 +215,20 @@ void JamLinkHeader::fillHeaderCommonFromAudio()
throw std::logic_error("JamLink only support ONE channel. Run JackTrip using only one channel");
}
mHeader.Common = (ETX_MONO | ETX_16BIT | ETX_XTND) + 64;
// Sampling Rate
int rate_type = mJackTrip->getSampleRateType();
if ( rate_type != JackAudioInterface::SR48 ) {
throw std::logic_error("ERROR: JamLink only support 48kHz for communication with JackTrip at the moment.");
}
// Check Buffer Size
int buf_size = mJackTrip->getBufferSizeInSamples();
if ( buf_size != 64 )
{
throw std::logic_error("ERROR: JamLink only support 64 buffer size for communication with JackTrip at the moment.");
}
mHeader.Common = (ETX_MONO | ETX_16BIT | ETX_XTND) + 64;
switch (rate_type)
{
case JackAudioInterface::SR48 :
......
......@@ -328,14 +328,6 @@ void Settings::startJackTrip()
cout << "Running in JamLink Mode..." << endl;
cout << gPrintSeparator << std::endl;
mJackTrip->setPacketHeaderType(DataProtocol::JAMLINK);
// JamLinks only receive in port gDefaultPort (4464), so we set that number here
//mJackTrip->setPeerPorts(gDefaultPort);
//mJackTrip->setPeerPorts(35981);
// Also, because of the NAT traversal scheme, the portn need to be
// "symetric", e.g.:
// from JackTrip to JamLink : src = 4474, dest = 4464
// from JamLinl to JackTrip : src = 4464, dest = 4474
mJackTrip->setBindPorts(mPortNum);
}
// Set in EmptyHeader Mode
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment