- cleanups in types
This commit is contained in:
parent
4b4e488230
commit
287ae827af
|
|
@ -35,18 +35,18 @@ namespace Audio
|
|||
:mRate(rate), mChannels(channels)
|
||||
{}
|
||||
|
||||
int samplesFromSize(int length) const
|
||||
size_t samplesFromSize(size_t length) const
|
||||
{
|
||||
return length / 2 / mChannels;
|
||||
}
|
||||
|
||||
// Returns milliseconds
|
||||
float timeFromSize(int length) const
|
||||
float timeFromSize(size_t length) const
|
||||
{
|
||||
return float(samplesFromSize(length) / (mRate / 1000.0));
|
||||
}
|
||||
|
||||
float sizeFromTime(int milliseconds) const
|
||||
float sizeFromTime(size_t milliseconds) const
|
||||
{
|
||||
return float((milliseconds * mRate) / 500.0 * mChannels);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,34 +466,34 @@ void Session::getSessionInfo(Session::InfoOptions options, VariantMap& info)
|
|||
info[SessionInfo_PvqaReport] = s.mPvqaReport;
|
||||
}
|
||||
#endif
|
||||
info[SessionInfo_NetworkMos] = (float)s.calculateMos(4.14);
|
||||
info[SessionInfo_NetworkMos] = static_cast<float>(s.calculateMos(4.14));
|
||||
info[SessionInfo_AudioCodec] = s.mCodecName;
|
||||
|
||||
stat += s;
|
||||
}
|
||||
}
|
||||
|
||||
info[SessionInfo_ReceivedTraffic] = (int)stat.mReceived;
|
||||
info[SessionInfo_SentTraffic] = (int)stat.mSent;
|
||||
info[SessionInfo_ReceivedRtp] = stat.mReceivedRtp;
|
||||
info[SessionInfo_ReceivedRtcp] = stat.mReceivedRtcp;
|
||||
info[SessionInfo_LostRtp] = stat.mPacketLoss;
|
||||
info[SessionInfo_SentRtp] = stat.mSentRtp;
|
||||
info[SessionInfo_SentRtcp] = stat.mSentRtcp;
|
||||
info[SessionInfo_ReceivedTraffic] = static_cast<int>(stat.mReceived);
|
||||
info[SessionInfo_SentTraffic] = static_cast<int>(stat.mSent);
|
||||
info[SessionInfo_ReceivedRtp] = static_cast<int>(stat.mReceivedRtp);
|
||||
info[SessionInfo_ReceivedRtcp] = static_cast<int>(stat.mReceivedRtcp);
|
||||
info[SessionInfo_LostRtp] = static_cast<int>(stat.mPacketLoss);
|
||||
info[SessionInfo_SentRtp] = static_cast<int>(stat.mSentRtp);
|
||||
info[SessionInfo_SentRtcp] = static_cast<int>(stat.mSentRtcp);
|
||||
if (stat.mFirstRtpTime)
|
||||
info[SessionInfo_Duration] = (int)std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - *(stat.mFirstRtpTime)).count();
|
||||
info[SessionInfo_Duration] = static_cast<int>(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - *(stat.mFirstRtpTime)).count());
|
||||
else
|
||||
info[SessionInfo_Duration] = 0;
|
||||
|
||||
if (stat.mReceivedRtp)
|
||||
info[SessionInfo_PacketLoss] = (stat.mPacketLoss * 1000) / stat.mReceivedRtp;
|
||||
info[SessionInfo_PacketLoss] = static_cast<int>((stat.mPacketLoss * 1000) / stat.mReceivedRtp);
|
||||
|
||||
if (media)
|
||||
info[SessionInfo_AudioPeer] = mIceStack->remoteAddress(media->iceInfo().mStreamId, media->iceInfo().mComponentId.mRtp).toStdString();
|
||||
|
||||
info[SessionInfo_Jitter] = stat.mJitter;
|
||||
if (stat.mRttDelay.isInitialized())
|
||||
info[SessionInfo_Rtt] = (float)stat.mRttDelay.getCurrent() * 1000;
|
||||
info[SessionInfo_Rtt] = static_cast<float>(stat.mRttDelay.getCurrent() * 1000);
|
||||
#if defined(USE_AMR_CODEC)
|
||||
info[SessionInfo_BitrateSwitchCounter] = stat.mBitrateSwitchCounter;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -102,19 +102,19 @@ protected:
|
|||
class Statistics
|
||||
{
|
||||
public:
|
||||
int mReceived, // Received traffic in bytes
|
||||
mSent, // Sent traffic in bytes
|
||||
mReceivedRtp, // Number of received rtp packets
|
||||
mSentRtp, // Number of sent rtp packets
|
||||
mReceivedRtcp, // Number of received rtcp packets
|
||||
mSentRtcp, // Number of sent rtcp packets
|
||||
mDuplicatedRtp, // Number of received duplicated rtp packets
|
||||
mOldRtp, // Number of late rtp packets
|
||||
mPacketLoss, // Number of lost packets
|
||||
mIllegalRtp; // Number of rtp packets with bad payload type
|
||||
int mLoss[128]; // Every item is number of loss of corresping length
|
||||
int mAudioTime; // Decoded/found time in milliseconds
|
||||
uint16_t mSsrc; // Last known SSRC ID in a RTP stream
|
||||
size_t mReceived, // Received traffic in bytes
|
||||
mSent, // Sent traffic in bytes
|
||||
mReceivedRtp, // Number of received rtp packets
|
||||
mSentRtp, // Number of sent rtp packets
|
||||
mReceivedRtcp, // Number of received rtcp packets
|
||||
mSentRtcp, // Number of sent rtcp packets
|
||||
mDuplicatedRtp, // Number of received duplicated rtp packets
|
||||
mOldRtp, // Number of late rtp packets
|
||||
mPacketLoss, // Number of lost packets
|
||||
mIllegalRtp; // Number of rtp packets with bad payload type
|
||||
int mLoss[128]; // Every item is number of loss of corresping length
|
||||
size_t mAudioTime; // Decoded/found time in milliseconds
|
||||
uint16_t mSsrc; // Last known SSRC ID in a RTP stream
|
||||
ice::NetworkAddress mRemotePeer; // Last known remote RTP address
|
||||
|
||||
// AMR codec bitrate switch counter
|
||||
|
|
|
|||
Loading…
Reference in New Issue