Merge remote-tracking branch 'origin/resiprocate_upgrade'
This commit is contained in:
commit
9ef74113b3
|
|
@ -482,7 +482,7 @@ void AgentImpl::processWaitForEvent(JsonCpp::Value &request, JsonCpp::Value &ans
|
|||
}
|
||||
|
||||
#if defined(USE_PVQA_LIBRARY)
|
||||
static JsonCpp::Value CsvReportToJson(const std::string& report)
|
||||
/*static JsonCpp::Value CsvReportToJson(const std::string& report)
|
||||
{
|
||||
JsonCpp::Value detectorValues;
|
||||
std::istringstream iss(report);
|
||||
|
|
@ -514,7 +514,7 @@ static JsonCpp::Value CsvReportToJson(const std::string& report)
|
|||
}
|
||||
}
|
||||
return detectorValues;
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
|
||||
void AgentImpl::processGetMediaStats(JsonCpp::Value& request, JsonCpp::Value& answer)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
|
||||
using namespace Audio;
|
||||
|
||||
#define SHRT_MAX 32767 /* maximum (signed) short value */
|
||||
#ifndef SHRT_MAX
|
||||
# define SHRT_MAX 32767 /* maximum (signed) short value */
|
||||
#endif
|
||||
|
||||
AgcFilter::AgcFilter(int channels)
|
||||
{
|
||||
static const float DefaultLevel = 0.8f;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ bool WavFileReader::open(const std::tstring& filename)
|
|||
THROW_READERROR;
|
||||
|
||||
// Read the file size
|
||||
unsigned int filesize = 0;
|
||||
uint32_t filesize = 0;
|
||||
if (fread(&filesize, 4, 1, mHandle) < 1)
|
||||
THROW_READERROR;
|
||||
|
||||
|
|
@ -117,20 +117,19 @@ bool WavFileReader::open(const std::tstring& filename)
|
|||
if (strcmp(wavefmt, "WAVEfmt ") != 0)
|
||||
THROW_READERROR;
|
||||
|
||||
unsigned fmtSize = 0;
|
||||
uint32_t fmtSize = 0;
|
||||
if (fread(&fmtSize, 4, 1, mHandle) < 1)
|
||||
THROW_READERROR;
|
||||
|
||||
unsigned fmtStart = ftell(mHandle);
|
||||
uint32_t fmtStart = ftell(mHandle);
|
||||
|
||||
unsigned short formattag = 0;
|
||||
uint16_t formattag = 0;
|
||||
if (fread(&formattag, 2, 1, mHandle) < 1)
|
||||
THROW_READERROR;
|
||||
|
||||
if (formattag != 1/*WAVE_FORMAT_PCM*/)
|
||||
THROW_READERROR;
|
||||
|
||||
mChannels = 0;
|
||||
if (fread(&mChannels, 2, 1, mHandle) < 1)
|
||||
THROW_READERROR;
|
||||
|
||||
|
|
@ -220,8 +219,8 @@ size_t WavFileReader::read(short* buffer, size_t samples)
|
|||
unsigned filePosition = ftell(mHandle);
|
||||
|
||||
// Check how much data we can read
|
||||
unsigned fileAvailable = mDataLength + mDataOffset - filePosition;
|
||||
requiredBytes = (int)fileAvailable < requiredBytes ? (int)fileAvailable : requiredBytes;
|
||||
size_t fileAvailable = mDataLength + mDataOffset - filePosition;
|
||||
requiredBytes = fileAvailable < requiredBytes ? fileAvailable : requiredBytes;
|
||||
}
|
||||
|
||||
size_t readBytes = fread(temp, 1, requiredBytes, mHandle);
|
||||
|
|
@ -282,7 +281,7 @@ std::tstring WavFileReader::filename() const
|
|||
return mFileName;
|
||||
}
|
||||
|
||||
unsigned WavFileReader::size() const
|
||||
size_t WavFileReader::size() const
|
||||
{
|
||||
LOCK;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ namespace Audio
|
|||
{
|
||||
protected:
|
||||
FILE* mHandle;
|
||||
short mChannels;
|
||||
short mBits;
|
||||
uint16_t mChannels;
|
||||
uint16_t mBits;
|
||||
int mSamplerate;
|
||||
std::tstring mFileName;
|
||||
mutable std::recursive_mutex
|
||||
mFileMtx;
|
||||
unsigned mDataOffset;
|
||||
unsigned mDataLength;
|
||||
size_t mDataOffset;
|
||||
size_t mDataLength;
|
||||
Resampler mResampler;
|
||||
unsigned mLastError;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ namespace Audio
|
|||
size_t readRaw(short* buffer, size_t samples);
|
||||
|
||||
std::tstring filename() const;
|
||||
unsigned size() const;
|
||||
size_t size() const;
|
||||
|
||||
unsigned lastError() const;
|
||||
};
|
||||
|
|
@ -66,8 +66,8 @@ namespace Audio
|
|||
FILE* mHandle; /// Handle of audio file.
|
||||
std::tstring mFileName; /// Path to requested audio file.
|
||||
std::recursive_mutex mFileMtx; /// Mutex to protect this instance.
|
||||
int mWritten; /// Amount of written data (in bytes)
|
||||
int mLengthOffset; /// Position of length field.
|
||||
size_t mWritten; /// Amount of written data (in bytes)
|
||||
size_t mLengthOffset; /// Position of length field.
|
||||
int mRate,
|
||||
mChannels;
|
||||
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ void Account::onSuccess(resip::ClientRegistrationHandle h, const resip::SipMessa
|
|||
}
|
||||
|
||||
mUsedTransport = response.getReceivedTransportTuple().getType();
|
||||
bool streamTransport = mUsedTransport == resip::TCP || mUsedTransport == resip::TLS;
|
||||
//bool streamTransport = mUsedTransport == resip::TCP || mUsedTransport == resip::TLS;
|
||||
|
||||
// Retry registration for stream based transport too
|
||||
if ( (hostChanged || portChanged) && mRegistrationState == RegistrationState::Registering /*&& !streamTransport*/ && mConfig->at(CONFIG_EXTERNALIP).asBool())
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ void AudioProvider::updateSdpOffer(resip::SdpContents::Session::Medium& sdp, Sdp
|
|||
{
|
||||
case msSendonly: attr = "recvonly"; break;
|
||||
case msInactive: attr = "recvonly"; break;
|
||||
case msRecvonly:
|
||||
case msSendRecv: break; // Do nothing here
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -1085,7 +1085,7 @@ void UserAgent::onOffer(resip::InviteSessionHandle h, const resip::SipMessage& m
|
|||
if (sdp.session().exists("ice-ufrag"))
|
||||
iceUfrag = sdp.session().getValues("ice-ufrag").front().c_str();
|
||||
|
||||
ice::Stack& ice = *s->mIceStack;
|
||||
//ice::Stack& ice = *s->mIceStack;
|
||||
|
||||
uint64_t version = sdp.session().origin().getVersion();
|
||||
std::string remoteIp = sdp.session().connection().getAddress().c_str();
|
||||
|
|
@ -1591,7 +1591,7 @@ VariantMap& UserAgent::config()
|
|||
return mConfig;
|
||||
}
|
||||
|
||||
static void splitToHeaders(resip::Data& content, std::vector<resip::Data>& output)
|
||||
/*static void splitToHeaders(resip::Data& content, std::vector<resip::Data>& output)
|
||||
{
|
||||
resip::Data::size_type startLine = 0, endLine = content.find("\r\n");
|
||||
while (endLine != resip::Data::npos)
|
||||
|
|
@ -1603,9 +1603,9 @@ static void splitToHeaders(resip::Data& content, std::vector<resip::Data>& outpu
|
|||
}
|
||||
if (0 == startLine)
|
||||
output.push_back(content);
|
||||
}
|
||||
}*/
|
||||
|
||||
static bool parseHeader(resip::Data& input, resip::Data& name, resip::Data& value)
|
||||
/*static bool parseHeader(resip::Data& input, resip::Data& name, resip::Data& value)
|
||||
{
|
||||
resip::Data::size_type p = input.find(":");
|
||||
if (p == resip::Data::npos)
|
||||
|
|
@ -1626,7 +1626,7 @@ static bool parseHeader(resip::Data& input, resip::Data& name, resip::Data& valu
|
|||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
void UserAgent::onSipMessage(int flow, const char* msg, unsigned int length, const sockaddr* addr, unsigned int addrlen)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -536,12 +536,11 @@ void Session::onReceivedData(PDatagramSocket socket, InternetAddress& src, const
|
|||
{
|
||||
// Try to process incoming data by ICE stack
|
||||
int component = -1, stream = -1;
|
||||
bool processed;
|
||||
if (mIceStack->findStreamAndComponent(socket->family(), socket->localport(), &stream, &component))
|
||||
{
|
||||
ice::ByteBuffer buffer(receivedPtr, receivedSize);
|
||||
buffer.setRemoteAddress(src);
|
||||
processed = mIceStack->processIncomingData(stream, component, buffer);
|
||||
/*bool processed = */mIceStack->processIncomingData(stream, component, buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1208,7 +1208,7 @@ static const uint16_t byte_crc10_table[256] = {
|
|||
/* Update the data block's CRC-10 remainder one byte at a time */
|
||||
uint16_t update_crc10_by_bytes(uint16_t crc10_accum, const uint8_t *data_blk_ptr, int data_blk_size)
|
||||
{
|
||||
register int i;
|
||||
/*register*/ int i;
|
||||
|
||||
for (i = 0; i < data_blk_size; i++) {
|
||||
crc10_accum = ((crc10_accum << 8) & 0x3ff)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void DatagramSocket::sendDatagram(InternetAddress &dest, const void *packetData,
|
|||
if (mHandle == INVALID_SOCKET)
|
||||
return;
|
||||
|
||||
int sent = ::sendto(mHandle, (const char*)packetData, packetSize, 0, dest.genericsockaddr(), dest.sockaddrLen());
|
||||
/*int sent = */::sendto(mHandle, (const char*)packetData, packetSize, 0, dest.genericsockaddr(), dest.sockaddrLen());
|
||||
}
|
||||
|
||||
unsigned DatagramSocket::recvDatagram(InternetAddress &src, void *packetBuffer, unsigned packetCapacity)
|
||||
|
|
|
|||
|
|
@ -315,10 +315,10 @@ static int hex2code(char s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int hex2code(const char* s)
|
||||
/*static int hex2code(const char* s)
|
||||
{
|
||||
return (hex2code(s[0]) << 4) + hex2code(s[1]);
|
||||
}
|
||||
}*/
|
||||
|
||||
std::string strx::fromHex2String(const std::string& s)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -599,10 +599,10 @@ int AmrWbCodec::encode(const void* input, int inputBytes, void* output, int outp
|
|||
return 0;
|
||||
|
||||
// Declare the data input pointer
|
||||
const short *dataIn = (const short *)input;
|
||||
// const short *dataIn = (const short *)input;
|
||||
|
||||
// Declare the data output pointer
|
||||
unsigned char *dataOut = (unsigned char *)output;
|
||||
// unsigned char *dataOut = (unsigned char *)output;
|
||||
|
||||
// Find how much RTP frames will be generated
|
||||
unsigned int frames = inputBytes / pcmLength();
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ int G729Codec::channels()
|
|||
return 1;
|
||||
}
|
||||
|
||||
static const int SamplesPerFrame = 80;
|
||||
// static const int SamplesPerFrame = 80;
|
||||
int G729Codec::encode(const void* input, int inputBytes, void* output, int outputCapacity)
|
||||
{
|
||||
// Create encoder if it is not done yet
|
||||
|
|
|
|||
|
|
@ -227,8 +227,7 @@ int EVSCodec::decode(const void* input, int input_length, void* output, int outp
|
|||
else
|
||||
buffer = std::string(reinterpret_cast<const char*>(input), input_length);
|
||||
}
|
||||
else
|
||||
// Skip CMR byte
|
||||
else // Skip CMR byte
|
||||
buffer = std::string(reinterpret_cast<const char*>(input) + 1, input_length-1);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue