SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <udpsourceudphandler.h>
Inherits QObject.
Classes | |
class | MsgUDPAddressAndPort |
Public Slots | |
void | dataReadyRead () |
Public Member Functions | |
UDPSourceUDPHandler () | |
virtual | ~UDPSourceUDPHandler () |
void | start () |
void | stop () |
void | configureUDPLink (const QString &address, quint16 port) |
void | resetReadIndex () |
void | resizeBuffer (float sampleRate) |
void | readSample (qint16 &t) |
audio mono More... | |
void | readSample (AudioSample &a) |
audio stereo More... | |
void | readSample (Sample &s) |
I/Q stream. More... | |
void | setAutoRWBalance (bool autoRWBalance) |
void | setFeedbackMessageQueue (MessageQueue *messageQueue) |
int32_t | getBufferGauge () const |
Static Public Attributes | |
static const int | m_udpBlockSize = 512 |
static const int | m_minNbUDPFrames = 256 |
Private Slots | |
void | handleMessages () |
Private Member Functions | |
typedef | char (udpBlk_t)[m_udpBlockSize] |
void | moveData (char *blk) |
void | advanceReadPointer (int nbBytes) |
void | applyUDPLink (const QString &address, quint16 port) |
bool | handleMessage (const Message &message) |
Private Attributes | |
QUdpSocket * | m_dataSocket |
QHostAddress | m_dataAddress |
QHostAddress | m_remoteAddress |
quint16 | m_dataPort |
quint16 | m_remotePort |
bool | m_dataConnected |
udpBlk_t * | m_udpBuf |
char | m_udpDump [m_udpBlockSize+8192] |
int | m_udpDumpIndex |
int | m_nbUDPFrames |
int | m_nbAllocatedUDPFrames |
int | m_writeFrameIndex |
int | m_readFrameIndex |
int | m_readIndex |
int | m_rwDelta |
float | m_d |
bool | m_autoRWBalance |
MessageQueue * | m_feedbackMessageQueue |
MessageQueue | m_inputMessageQueue |
Definition at line 31 of file udpsourceudphandler.h.
UDPSourceUDPHandler::UDPSourceUDPHandler | ( | ) |
Definition at line 28 of file udpsourceudphandler.cpp.
|
virtual |
|
private |
Definition at line 184 of file udpsourceudphandler.cpp.
References UDPSourceMessages::MsgSampleRateCorrection::create(), m_autoRWBalance, m_d, m_feedbackMessageQueue, m_nbUDPFrames, m_readFrameIndex, m_readIndex, m_rwDelta, m_udpBlockSize, m_writeFrameIndex, MessageQueue::push(), and resetReadIndex().
Referenced by UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort(), and readSample().
|
private |
Definition at line 233 of file udpsourceudphandler.cpp.
References m_dataAddress, m_dataPort, resetReadIndex(), start(), and stop().
Referenced by handleMessage(), and UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort().
|
private |
Referenced by UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort().
void UDPSourceUDPHandler::configureUDPLink | ( | const QString & | address, |
quint16 | port | ||
) |
Definition at line 227 of file udpsourceudphandler.cpp.
References UDPSourceUDPHandler::MsgUDPAddressAndPort::create(), m_inputMessageQueue, and MessageQueue::push().
Referenced by UDPSource::applySettings().
|
slot |
Definition at line 99 of file udpsourceudphandler.cpp.
References m_dataConnected, m_dataSocket, m_remoteAddress, m_remotePort, m_udpBlockSize, m_udpDump, m_udpDumpIndex, and moveData().
Referenced by start(), and stop().
|
inline |
Get buffer gauge value in % of buffer size ([-50:50]) [-50:0] : write leads or read lags [0:50] : read leads or write lags
Definition at line 55 of file udpsourceudphandler.h.
References m_nbUDPFrames, and m_rwDelta.
Referenced by UDPSource::getBufferGauge().
|
private |
Definition at line 289 of file udpsourceudphandler.cpp.
References applyUDPLink(), UDPSourceUDPHandler::MsgUDPAddressAndPort::getAddress(), UDPSourceUDPHandler::MsgUDPAddressAndPort::getPort(), and Message::match().
Referenced by handleMessages(), and UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort().
|
privateslot |
Definition at line 276 of file udpsourceudphandler.cpp.
References handleMessage(), m_inputMessageQueue, and MessageQueue::pop().
|
private |
Definition at line 132 of file udpsourceudphandler.cpp.
References m_nbUDPFrames, m_udpBlockSize, m_udpBuf, and m_writeFrameIndex.
Referenced by dataReadyRead(), and UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort().
void UDPSourceUDPHandler::readSample | ( | qint16 & | t | ) |
audio mono
Definition at line 143 of file udpsourceudphandler.cpp.
References advanceReadPointer(), m_readFrameIndex, m_readIndex, m_udpBuf, and m_writeFrameIndex.
Referenced by UDPSource::modulateSample(), and UDPSource::readMonoSample().
void UDPSourceUDPHandler::readSample | ( | AudioSample & | a | ) |
audio stereo
Definition at line 156 of file udpsourceudphandler.cpp.
References advanceReadPointer(), AudioSample::l, m_readFrameIndex, m_readIndex, m_udpBuf, m_writeFrameIndex, and AudioSample::r.
void UDPSourceUDPHandler::readSample | ( | Sample & | s | ) |
I/Q stream.
Definition at line 170 of file udpsourceudphandler.cpp.
References advanceReadPointer(), Sample::m_imag, m_readFrameIndex, m_readIndex, Sample::m_real, m_udpBuf, and m_writeFrameIndex.
void UDPSourceUDPHandler::resetReadIndex | ( | ) |
Definition at line 250 of file udpsourceudphandler.cpp.
References m_d, m_nbUDPFrames, m_readFrameIndex, m_readIndex, m_rwDelta, and m_writeFrameIndex.
Referenced by advanceReadPointer(), UDPSource::applySettings(), applyUDPLink(), UDPSource::handleMessage(), and resizeBuffer().
void UDPSourceUDPHandler::resizeBuffer | ( | float | sampleRate | ) |
Definition at line 258 of file udpsourceudphandler.cpp.
References m_minNbUDPFrames, m_nbAllocatedUDPFrames, m_nbUDPFrames, m_udpBuf, m_writeFrameIndex, leansdr::max(), and resetReadIndex().
Referenced by UDPSource::applySettings().
|
inline |
Definition at line 48 of file udpsourceudphandler.h.
References m_autoRWBalance.
Referenced by UDPSource::applySettings().
|
inline |
Definition at line 49 of file udpsourceudphandler.h.
References m_feedbackMessageQueue.
Referenced by UDPSource::UDPSource().
void UDPSourceUDPHandler::start | ( | ) |
Definition at line 56 of file udpsourceudphandler.cpp.
References dataReadyRead(), m_dataAddress, m_dataConnected, m_dataPort, and m_dataSocket.
Referenced by applyUDPLink(), and UDPSource::start().
void UDPSourceUDPHandler::stop | ( | ) |
Definition at line 82 of file udpsourceudphandler.cpp.
References dataReadyRead(), m_dataConnected, and m_dataSocket.
Referenced by applyUDPLink(), and UDPSource::stop().
|
private |
Definition at line 114 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), and setAutoRWBalance().
|
private |
Definition at line 113 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), and resetReadIndex().
|
private |
Definition at line 99 of file udpsourceudphandler.h.
Referenced by applyUDPLink(), and start().
|
private |
Definition at line 103 of file udpsourceudphandler.h.
Referenced by dataReadyRead(), start(), and stop().
|
private |
Definition at line 101 of file udpsourceudphandler.h.
Referenced by applyUDPLink(), and start().
|
private |
Definition at line 98 of file udpsourceudphandler.h.
Referenced by dataReadyRead(), start(), and stop().
|
private |
Definition at line 115 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), and setFeedbackMessageQueue().
|
private |
Definition at line 116 of file udpsourceudphandler.h.
Referenced by configureUDPLink(), and handleMessages().
|
static |
Definition at line 62 of file udpsourceudphandler.h.
Referenced by resizeBuffer().
|
private |
Definition at line 108 of file udpsourceudphandler.h.
Referenced by resizeBuffer().
|
private |
Definition at line 107 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), getBufferGauge(), moveData(), resetReadIndex(), and resizeBuffer().
|
private |
Definition at line 110 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), readSample(), and resetReadIndex().
|
private |
Definition at line 111 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), readSample(), and resetReadIndex().
|
private |
Definition at line 100 of file udpsourceudphandler.h.
Referenced by dataReadyRead().
|
private |
Definition at line 102 of file udpsourceudphandler.h.
Referenced by dataReadyRead().
|
private |
Definition at line 112 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), getBufferGauge(), and resetReadIndex().
|
static |
Definition at line 61 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), dataReadyRead(), moveData(), and UDPSourceUDPHandler::MsgUDPAddressAndPort::MsgUDPAddressAndPort().
|
private |
Definition at line 104 of file udpsourceudphandler.h.
Referenced by moveData(), readSample(), resizeBuffer(), and ~UDPSourceUDPHandler().
|
private |
Definition at line 105 of file udpsourceudphandler.h.
Referenced by dataReadyRead().
|
private |
Definition at line 106 of file udpsourceudphandler.h.
Referenced by dataReadyRead().
|
private |
Definition at line 109 of file udpsourceudphandler.h.
Referenced by advanceReadPointer(), moveData(), readSample(), resetReadIndex(), and resizeBuffer().