- work to move Sevana specific parts to corresponding project (PVQA server and PVQA RTP library)
This commit is contained in:
parent
c3c59ddf03
commit
17e17d3d79
|
|
@ -184,80 +184,3 @@ void RtpDump::flush()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// -------------- MediaStreamId --------------------
|
|
||||||
bool MediaStreamId::operator < (const MediaStreamId& right) const
|
|
||||||
{
|
|
||||||
if (mSsrcIsId)
|
|
||||||
return std::tie(mSSRC, mSource, mDestination) < std::tie(right.mSSRC, right.mSource, right.mDestination);
|
|
||||||
else
|
|
||||||
return std::tie(mSource, mDestination) < std::tie(right.mSource, right.mDestination);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MediaStreamId::operator == (const MediaStreamId& right) const
|
|
||||||
{
|
|
||||||
if (mSsrcIsId)
|
|
||||||
return std::tie(mSSRC, mSource, mDestination) == std::tie(right.mSSRC, right.mSource, right.mDestination);
|
|
||||||
else
|
|
||||||
return std::tie(mSource, mDestination) == std::tie(right.mSource, right.mDestination);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string MediaStreamId::toString() const
|
|
||||||
{
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << "src: " << mSource.toStdString() <<
|
|
||||||
" dst: " << mDestination.toStdString() <<
|
|
||||||
" ssrc: " << StringHelper::toHex(mSSRC);
|
|
||||||
return oss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void writeToJson(const MediaStreamId& id, std::ostringstream& oss)
|
|
||||||
{
|
|
||||||
oss << " \"src\": \"" << id.mSource.toStdString() << "\"," << std::endl
|
|
||||||
<< " \"dst\": \"" << id.mDestination.toStdString() << "\"," << std::endl
|
|
||||||
<< " \"ssrc\": \"" << StringHelper::toHex(id.mSSRC) << "\"," << std::endl
|
|
||||||
#if !defined(USE_NULL_UUID)
|
|
||||||
<< " \"link_id\": \"" << id.mLinkId.toString() << "\"" << std::endl
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string MediaStreamId::getDetectDescription() const
|
|
||||||
{
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << "{\"event\": \"stream_detected\"," << std::endl;
|
|
||||||
writeToJson(*this, oss);
|
|
||||||
oss << "}";
|
|
||||||
|
|
||||||
return oss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string MediaStreamId::getFinishDescription() const
|
|
||||||
{
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << "{" << std::endl
|
|
||||||
<< " \"event\": \"stream_finished\", " << std::endl;
|
|
||||||
writeToJson(*this, oss);
|
|
||||||
oss << "}";
|
|
||||||
|
|
||||||
return oss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
MediaStreamId& MediaStreamId::operator = (const MediaStreamId& src)
|
|
||||||
{
|
|
||||||
this->mDestination = src.mDestination;
|
|
||||||
this->mSource = src.mSource;
|
|
||||||
this->mLinkId = src.mLinkId;
|
|
||||||
this->mSSRC = src.mSSRC;
|
|
||||||
this->mSsrcIsId = src.mSsrcIsId;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& operator << (std::ostream& output, const MediaStreamId& id)
|
|
||||||
{
|
|
||||||
return (output << id.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,22 +72,4 @@ public:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct MediaStreamId
|
|
||||||
{
|
|
||||||
InternetAddress mSource;
|
|
||||||
InternetAddress mDestination;
|
|
||||||
uint32_t mSSRC = 0;
|
|
||||||
bool mSsrcIsId = true;
|
|
||||||
Uuid mLinkId;
|
|
||||||
bool operator < (const MediaStreamId& s2) const;
|
|
||||||
bool operator == (const MediaStreamId& right) const;
|
|
||||||
|
|
||||||
std::string toString() const;
|
|
||||||
std::string getDetectDescription() const;
|
|
||||||
std::string getFinishDescription() const;
|
|
||||||
MediaStreamId& operator = (const MediaStreamId& src);
|
|
||||||
};
|
|
||||||
|
|
||||||
std::ostream& operator << (std::ostream& output, const MediaStreamId& id);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ void JitterStatistics::process(jrtplib::RTPPacket* packet, int rate)
|
||||||
Statistics::Statistics()
|
Statistics::Statistics()
|
||||||
:mReceived(0), mSent(0), mReceivedRtp(0), mSentRtp(0),
|
:mReceived(0), mSent(0), mReceivedRtp(0), mSentRtp(0),
|
||||||
mReceivedRtcp(0), mSentRtcp(0), mDuplicatedRtp(0), mOldRtp(0), mIllegalRtp(0),
|
mReceivedRtcp(0), mSentRtcp(0), mDuplicatedRtp(0), mOldRtp(0), mIllegalRtp(0),
|
||||||
mPacketLoss(0), mJitter(0.0), mAudioTime(0), mSsrc(0), mPacketDropped(0)
|
mPacketLoss(0), mJitter(0.0), mAudioTime(0), mSsrc(0), mPacketDropped(0), mDecodedAudio(0)
|
||||||
{
|
{
|
||||||
mBitrateSwitchCounter = 0;
|
mBitrateSwitchCounter = 0;
|
||||||
memset(mLoss, 0, sizeof mLoss);
|
memset(mLoss, 0, sizeof mLoss);
|
||||||
|
|
@ -95,7 +95,7 @@ void Statistics::reset()
|
||||||
mJitter = 0.0;
|
mJitter = 0.0;
|
||||||
mAudioTime = 0;
|
mAudioTime = 0;
|
||||||
mPacketDropped = 0;
|
mPacketDropped = 0;
|
||||||
|
mDecodedAudio = 0;
|
||||||
memset(mLoss, 0, sizeof mLoss);
|
memset(mLoss, 0, sizeof mLoss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,7 +179,7 @@ Statistics& Statistics::operator += (const Statistics& src)
|
||||||
mPacketLoss += src.mPacketLoss;
|
mPacketLoss += src.mPacketLoss;
|
||||||
mPacketDropped += src.mPacketDropped;
|
mPacketDropped += src.mPacketDropped;
|
||||||
mAudioTime += src.mAudioTime;
|
mAudioTime += src.mAudioTime;
|
||||||
|
mDecodedAudio += src.mDecodedAudio;
|
||||||
|
|
||||||
for (auto codecStat: src.mCodecCount)
|
for (auto codecStat: src.mCodecCount)
|
||||||
{
|
{
|
||||||
|
|
@ -230,6 +230,7 @@ Statistics& Statistics::operator -= (const Statistics& src)
|
||||||
mOldRtp -= src.mOldRtp;
|
mOldRtp -= src.mOldRtp;
|
||||||
mPacketLoss -= src.mPacketLoss;
|
mPacketLoss -= src.mPacketLoss;
|
||||||
mPacketDropped -= src.mPacketDropped;
|
mPacketDropped -= src.mPacketDropped;
|
||||||
|
mDecodedAudio -= src.mDecodedAudio;
|
||||||
|
|
||||||
mAudioTime -= src.mAudioTime;
|
mAudioTime -= src.mAudioTime;
|
||||||
for (auto codecStat: src.mCodecCount)
|
for (auto codecStat: src.mCodecCount)
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ public:
|
||||||
mPacketDropped, // Number of dropped packets (due to time unsync when playing)б
|
mPacketDropped, // Number of dropped packets (due to time unsync when playing)б
|
||||||
mIllegalRtp; // Number of rtp packets with bad payload type
|
mIllegalRtp; // Number of rtp packets with bad payload type
|
||||||
|
|
||||||
|
size_t mDecodedAudio; // Size of decoded audio bytes
|
||||||
|
|
||||||
TestResult<float> mDecodingInterval, // Average interval on call to packet decode
|
TestResult<float> mDecodingInterval, // Average interval on call to packet decode
|
||||||
mDecodeRequested, // Average amount of requested audio frames to play
|
mDecodeRequested, // Average amount of requested audio frames to play
|
||||||
mPacketInterval; // Average interval between packet adding to jitter buffer
|
mPacketInterval; // Average interval between packet adding to jitter buffer
|
||||||
|
|
@ -98,10 +100,10 @@ public:
|
||||||
Statistics& operator -= (const Statistics& src);
|
Statistics& operator -= (const Statistics& src);
|
||||||
|
|
||||||
float mNetworkMos = 0.0;
|
float mNetworkMos = 0.0;
|
||||||
#if defined(USE_PVQA_LIBRARY) && !defined(PVQA_SERVER)
|
// #if defined(USE_PVQA_LIBRARY) && !defined(PVQA_SERVER)
|
||||||
float mPvqaMos = 0.0;
|
// float mPvqaMos = 0.0;
|
||||||
std::string mPvqaReport;
|
//std::string mPvqaReport;
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -91,4 +91,4 @@ set(JRTPLIB_SOURCES
|
||||||
rtpexternaltransmitter.cpp)
|
rtpexternaltransmitter.cpp)
|
||||||
|
|
||||||
add_library(jrtplib STATIC ${JRTPLIB_SOURCES})
|
add_library(jrtplib STATIC ${JRTPLIB_SOURCES})
|
||||||
|
target_include_directories(jrtplib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ public:
|
||||||
|
|
||||||
/** Returns the payload length. */
|
/** Returns the payload length. */
|
||||||
size_t GetPayloadLength() const { return payloadlength; }
|
size_t GetPayloadLength() const { return payloadlength; }
|
||||||
void SetPayloadLength(size_t l) { payloadlength = l; }
|
void SetPayloadLength(size_t l) { payloadlength = l; }
|
||||||
|
|
||||||
/** If a header extension is present, this function returns the extension identifier. */
|
/** If a header extension is present, this function returns the extension identifier. */
|
||||||
uint16_t GetExtensionID() const { return extid; }
|
uint16_t GetExtensionID() const { return extid; }
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ set (SPEEXDSP_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(speexdsp ${SPEEXDSP_SOURCES})
|
add_library(speexdsp ${SPEEXDSP_SOURCES})
|
||||||
target_compile_definitions(speexdsp PUBLIC -DUSE_KISS_FFT -DFIXED_POINT -DHAVE_STDINT_H)
|
target_compile_definitions(speexdsp PUBLIC -DUSE_KISS_FFT -DFLOATING_POINT -DHAVE_STDINT_H)
|
||||||
|
|
||||||
target_include_directories(speexdsp PUBLIC
|
target_include_directories(speexdsp PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/libspeexdsp
|
${CMAKE_CURRENT_SOURCE_DIR}/libspeexdsp
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue