- more cleanups - use uuid library on the rtphone level + formatting fixed

This commit is contained in:
Dmytro Bogovych 2024-10-14 07:25:57 +03:00
parent 5e6b4bb929
commit 4cff4a0988
3 changed files with 16 additions and 10 deletions

View File

@ -15,3 +15,4 @@ set_property(TARGET helper_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<C
# Private include directories # Private include directories
target_include_directories(helper_lib PUBLIC ../../libs/ ../../engine ../ .) target_include_directories(helper_lib PUBLIC ../../libs/ ../../engine ../ .)
target_compile_definitions(helper_lib PRIVATE -D_CRT_SECURE_NO_WARNINGS -D_UNICODE) target_compile_definitions(helper_lib PRIVATE -D_CRT_SECURE_NO_WARNINGS -D_UNICODE)
target_link_libraries(helper_lib PUBLIC uuid)

View File

@ -331,6 +331,7 @@ AudioReceiver::AudioReceiver(const CodecList::Settings& settings, MT::Statistics
mResampler48.start(AUDIO_CHANNELS, 48000, AUDIO_SAMPLERATE); mResampler48.start(AUDIO_CHANNELS, 48000, AUDIO_SAMPLERATE);
// Init codecs // Init codecs
mCodecList.setSettings(settings);
mCodecList.fillCodecMap(mCodecMap); mCodecList.fillCodecMap(mCodecMap);
#if defined(DUMP_DECODED) #if defined(DUMP_DECODED)
@ -442,14 +443,14 @@ bool AudioReceiver::add(const std::shared_ptr<jrtplib::RTPPacket>& p, Codec** co
if (payloadLength >= 1 && payloadLength <= 6 && (ptype == 0 || ptype == 8)) if (payloadLength >= 1 && payloadLength <= 6 && (ptype == 0 || ptype == 8))
time_length = mLastPacketTimeLength ? mLastPacketTimeLength : 20; time_length = mLastPacketTimeLength ? mLastPacketTimeLength : 20;
else else
// Check if packet is too short from time length side // Check if packet is too short from time length side
if (time_length < 2) if (time_length < 2)
{ {
// It will cause statistics to report about bad RTP packet // It will cause statistics to report about bad RTP packet
// I have to replay last packet payload here to avoid report about lost packet // I have to replay last packet payload here to avoid report about lost packet
mBuffer.add(p, time_length, codecIter->second->samplerate()); mBuffer.add(p, time_length, codecIter->second->samplerate());
return false; return false;
} }
// Queue packet to buffer // Queue packet to buffer
auto packet = mBuffer.add(p, time_length, codecIter->second->samplerate()).get(); auto packet = mBuffer.add(p, time_length, codecIter->second->samplerate()).get();

View File

@ -1,4 +1,5 @@
#include <math.h> #include <math.h>
#include <iostream>
#include "MT_Statistics.h" #include "MT_Statistics.h"
#include "audio/Audio_Interface.h" #include "audio/Audio_Interface.h"
@ -55,8 +56,11 @@ void JitterStatistics::process(jrtplib::RTPPacket* packet, int rate)
mReceiveTime = receiveTime; mReceiveTime = receiveTime;
mReceiveTimestamp = timestamp; mReceiveTimestamp = timestamp;
// And mJitter are in seconds again // And mJitter are in milliseconds again
mJitter.process(mLastJitter.value() / float(rate)); float jitter_s = mLastJitter.value() / (float(rate));
// std::cout << "Jitter (in seconds): " << std::dec << jitter_s << std::endl;
mJitter.process(jitter_s);
} }
} }