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 <rtpudptransmitter.h>
Signals | |
void | NewDataAvailable () |
Public Member Functions | |
RTPUDPTransmitter () | |
virtual | ~RTPUDPTransmitter () |
virtual int | Init () |
virtual int | Create (std::size_t maxpacksize, const RTPTransmissionParams *transparams) |
virtual int | BindSockets () |
void | moveToThread (QThread *thread) |
virtual void | Destroy () |
virtual RTPTransmissionInfo * | GetTransmissionInfo () |
virtual void | DeleteTransmissionInfo (RTPTransmissionInfo *inf) |
virtual bool | ComesFromThisTransmitter (const RTPAddress &addr) |
virtual std::size_t | GetHeaderOverhead () |
virtual int | SendRTPData (const void *data, std::size_t len) |
virtual int | SendRTCPData (const void *data, std::size_t len) |
virtual int | AddDestination (const RTPAddress &addr) |
virtual int | DeleteDestination (const RTPAddress &addr) |
virtual void | ClearDestinations () |
virtual bool | SupportsMulticasting () |
virtual int | JoinMulticastGroup (const RTPAddress &addr) |
virtual int | LeaveMulticastGroup (const RTPAddress &addr) |
virtual int | SetReceiveMode (RTPTransmitter::ReceiveMode m) |
virtual int | AddToIgnoreList (const RTPAddress &addr) |
virtual int | DeleteFromIgnoreList (const RTPAddress &addr) |
virtual void | ClearIgnoreList () |
virtual int | AddToAcceptList (const RTPAddress &addr) |
virtual int | DeleteFromAcceptList (const RTPAddress &addr) |
virtual void | ClearAcceptList () |
virtual int | SetMaximumPacketSize (std::size_t s) |
virtual RTPRawPacket * | GetNextPacket () |
Public Member Functions inherited from qrtplib::RTPTransmitter | |
virtual | ~RTPTransmitter () |
Private Slots | |
void | readRTPPendingDatagrams () |
void | readRTCPPendingDatagrams () |
Private Member Functions | |
bool | ShouldAcceptData (const RTPAddress &address) |
Private Attributes | |
bool | m_init |
bool | m_created |
bool | m_waitingfordata |
QUdpSocket * | m_rtpsock |
QUdpSocket * | m_rtcpsock |
bool | m_deletesocketswhendone |
QHostAddress | m_localIP |
from parameters bind IP More... | |
QNetworkInterface | m_multicastInterface |
from parameters multicast interface More... | |
uint16_t | m_rtpPort |
uint16_t | m_rtcpPort |
RTPTransmitter::ReceiveMode | m_receivemode |
std::size_t | m_maxpacksize |
char | m_rtpBuffer [m_absoluteMaxPackSize] |
char | m_rtcpBuffer [m_absoluteMaxPackSize] |
std::list< RTPAddress > | m_destinations |
std::list< RTPAddress > | m_acceptList |
std::list< RTPAddress > | m_ignoreList |
QQueue< RTPRawPacket * > | m_rawPacketQueue |
QMutex | m_rawPacketQueueLock |
Static Private Attributes | |
static const std::size_t | m_absoluteMaxPackSize = 65535 |
Additional Inherited Members | |
Public Types inherited from qrtplib::RTPTransmitter | |
enum | TransmissionProtocol { IPv4UDPProto, IPv6UDPProto, TCPProto, ExternalProto, UserDefinedProto } |
enum | ReceiveMode { AcceptAll, AcceptSome, IgnoreSome } |
Protected Member Functions inherited from qrtplib::RTPTransmitter | |
RTPTransmitter () | |
An UDP transmission component. This class inherits the RTPTransmitter interface and implements a transmission component which uses UDP to send and receive RTP and RTCP data. The component's parameters are described by the class RTPUDPTransmissionParams. The GetTransmissionInfo member function returns an instance of type RTPUDPTransmissionInfo.
Definition at line 301 of file rtpudptransmitter.h.
qrtplib::RTPUDPTransmitter::RTPUDPTransmitter | ( | ) |
Definition at line 44 of file rtpudptransmitter.cpp.
References qrtplib::RTPTransmitter::AcceptAll, m_absoluteMaxPackSize, m_created, m_deletesocketswhendone, m_init, m_maxpacksize, m_receivemode, m_rtcpBuffer, m_rtcpPort, m_rtcpsock, m_rtpBuffer, m_rtpPort, m_rtpsock, and m_waitingfordata.
|
virtual |
Definition at line 61 of file rtpudptransmitter.cpp.
References Destroy().
|
virtual |
Adds the address specified by addr
to the list of destinations.
Implements qrtplib::RTPTransmitter.
Definition at line 291 of file rtpudptransmitter.cpp.
References m_destinations.
|
virtual |
Adds addr
to the list of addresses to accept.
Implements qrtplib::RTPTransmitter.
Definition at line 410 of file rtpudptransmitter.cpp.
References m_acceptList.
|
virtual |
Adds addr
to the list of addresses to ignore.
Implements qrtplib::RTPTransmitter.
Definition at line 393 of file rtpudptransmitter.cpp.
References m_ignoreList.
|
virtual |
Bind the RTP and RTCP sockets to ports that were set at creation time
Implements qrtplib::RTPTransmitter.
Definition at line 170 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_CANTBINDRTCPSOCKET, ERR_RTP_UDPV4TRANS_CANTBINDRTPSOCKET, m_localIP, m_rtcpPort, m_rtcpsock, m_rtpPort, m_rtpsock, readRTCPPendingDatagrams(), and readRTPPendingDatagrams().
|
virtual |
Clears the list of addresses to accept.
Implements qrtplib::RTPTransmitter.
Definition at line 422 of file rtpudptransmitter.cpp.
References m_acceptList.
|
virtual |
Clears the list of destinations.
Implements qrtplib::RTPTransmitter.
Definition at line 303 of file rtpudptransmitter.cpp.
References m_destinations.
|
virtual |
Clears the list of addresses to ignore.
Implements qrtplib::RTPTransmitter.
Definition at line 405 of file rtpudptransmitter.cpp.
References m_ignoreList.
|
virtual |
Returns true
if the address specified by addr
is one of the addresses of the transmitter.
Implements qrtplib::RTPTransmitter.
Definition at line 233 of file rtpudptransmitter.cpp.
References qrtplib::RTPAddress::getAddress(), qrtplib::RTPAddress::getPort(), qrtplib::RTPAddress::getRtcpsendport(), m_localIP, m_rtcpPort, and m_rtpPort.
|
virtual |
Prepares the component to be used. Prepares the component to be used. The parameter maxpacksize
specifies the maximum size a packet can have: if the packet is larger it will not be transmitted. The transparams
parameter specifies a pointer to an RTPTransmissionParams instance. This is also an abstract class and each actual component will define its own parameters by inheriting a class from RTPTransmissionParams. If transparams
is NULL, the default transmission parameters for the component will be used.
Implements qrtplib::RTPTransmitter.
Definition at line 76 of file rtpudptransmitter.cpp.
References qrtplib::RTPTransmitter::AcceptAll, ERR_RTP_UDPV4TRANS_ALREADYCREATED, ERR_RTP_UDPV4TRANS_ILLEGALPARAMETERS, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV4TRANS_PORTBASENOTEVEN, ERR_RTP_UDPV4TRANS_SPECIFIEDSIZETOOBIG, qrtplib::RTPUDPTransmissionParams::GetAllowOddPortbase(), qrtplib::RTPUDPTransmissionParams::GetBindIP(), qrtplib::RTPUDPTransmissionParams::GetForcedRTCPPort(), qrtplib::RTPUDPTransmissionParams::GetMulticastInterface(), qrtplib::RTPUDPTransmissionParams::GetPortbase(), qrtplib::RTPUDPTransmissionParams::GetRTCPMultiplexing(), qrtplib::RTPUDPTransmissionParams::GetRTCPReceiveBufferSize(), qrtplib::RTPUDPTransmissionParams::GetRTPReceiveBufferSize(), qrtplib::RTPTransmissionParams::GetTransmissionProtocol(), qrtplib::RTPUDPTransmissionParams::GetUseExistingSockets(), qrtplib::RTPTransmitter::IPv4UDPProto, m_absoluteMaxPackSize, m_created, m_deletesocketswhendone, m_init, m_localIP, m_maxpacksize, m_multicastInterface, m_receivemode, m_rtcpPort, m_rtcpsock, m_rtpPort, m_rtpsock, and m_waitingfordata.
Referenced by RTPSink::RTPSink().
|
virtual |
Deletes the address specified by addr
from the list of destinations.
Implements qrtplib::RTPTransmitter.
Definition at line 297 of file rtpudptransmitter.cpp.
References m_destinations.
|
virtual |
Deletes addr
from the list of addresses to accept.
Implements qrtplib::RTPTransmitter.
Definition at line 416 of file rtpudptransmitter.cpp.
References m_acceptList.
|
virtual |
Deletes addr
from the list of addresses to accept.
Implements qrtplib::RTPTransmitter.
Definition at line 399 of file rtpudptransmitter.cpp.
References m_ignoreList.
|
virtual |
Deallocates the information returned by RTPTransmitter::GetTransmissionInfo . Deallocates the information returned by RTPTransmitter::GetTransmissionInfo .
Implements qrtplib::RTPTransmitter.
Definition at line 224 of file rtpudptransmitter.cpp.
References m_init.
|
virtual |
By calling this function, buffers are cleared and the component cannot be used anymore. By calling this function, buffers are cleared and the component cannot be used anymore. Only when the Create function is called again can the component be used again.
Implements qrtplib::RTPTransmitter.
Definition at line 190 of file rtpudptransmitter.cpp.
References m_created, m_deletesocketswhendone, m_init, m_rtcpsock, and m_rtpsock.
Referenced by ~RTPUDPTransmitter().
|
inlinevirtual |
Returns the amount of bytes that will be added to the RTP packet by the underlying layers (excluding the link layer).
Implements qrtplib::RTPTransmitter.
Definition at line 317 of file rtpudptransmitter.h.
References RTPUDPTRANS_HEADERSIZE.
|
virtual |
Returns the raw data of a received RTP packet in an RTPRawPacket instance.
Implements qrtplib::RTPTransmitter.
Definition at line 445 of file rtpudptransmitter.cpp.
References m_rawPacketQueue, and m_rawPacketQueueLock.
|
virtual |
Returns additional information about the transmitter. This function returns an instance of a subclass of RTPTransmissionInfo which will give some additional information about the transmitter (a list of local IP addresses for example). Currently, either an instance of RTPUDPv4TransmissionInfo or RTPUDPv6TransmissionInfo is returned, depending on the type of the transmitter. The user has to deallocate the returned instance when it is no longer needed, which can be done using RTPTransmitter::DeleteTransmissionInfo.
Implements qrtplib::RTPTransmitter.
Definition at line 213 of file rtpudptransmitter.cpp.
References m_init, m_localIP, m_rtcpPort, m_rtcpsock, m_rtpPort, and m_rtpsock.
|
virtual |
This function must be called before the transmission component can be used.
Implements qrtplib::RTPTransmitter.
Definition at line 66 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_ALREADYINIT, and m_init.
Referenced by RTPSink::RTPSink().
|
virtual |
Joins the multicast group specified by addr
.
Implements qrtplib::RTPTransmitter.
Definition at line 321 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_COULDNTJOINMULTICASTGROUP, ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV6TRANS_NOMULTICASTSUPPORT, qrtplib::RTPAddress::getAddress(), m_created, m_init, m_multicastInterface, m_rtcpsock, m_rtpsock, and SupportsMulticasting().
|
virtual |
Leaves the multicast group specified by addr
.
Implements qrtplib::RTPTransmitter.
Definition at line 352 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV6TRANS_NOMULTICASTSUPPORT, qrtplib::RTPAddress::getAddress(), m_created, m_init, m_rtcpsock, m_rtpsock, and SupportsMulticasting().
void qrtplib::RTPUDPTransmitter::moveToThread | ( | QThread * | thread | ) |
|
signal |
Referenced by readRTCPPendingDatagrams(), and readRTPPendingDatagrams().
|
privateslot |
Definition at line 502 of file rtpudptransmitter.cpp.
References qrtplib::RTPTime::CurrentTime(), m_rawPacketQueue, m_rawPacketQueueLock, m_rtcpBuffer, m_rtcpsock, NewDataAvailable(), qrtplib::RTPAddress::setAddress(), qrtplib::RTPAddress::setPort(), and ShouldAcceptData().
Referenced by BindSockets().
|
privateslot |
Definition at line 456 of file rtpudptransmitter.cpp.
References qrtplib::RTPTime::CurrentTime(), m_rawPacketQueue, m_rawPacketQueueLock, m_rtcpsock, m_rtpBuffer, m_rtpsock, NewDataAvailable(), qrtplib::RTCPCommonHeader::packettype, qrtplib::RTPAddress::setAddress(), qrtplib::RTPAddress::setPort(), and ShouldAcceptData().
Referenced by BindSockets().
|
virtual |
Send a packet with length len
containing data
to all RTCP addresses of the current destination list.
Implements qrtplib::RTPTransmitter.
Definition at line 267 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV4TRANS_SPECIFIEDSIZETOOBIG, m_created, m_destinations, m_init, m_maxpacksize, and m_rtcpsock.
|
virtual |
Send a packet with length len
containing data
to all RTP addresses of the current destination list.
Implements qrtplib::RTPTransmitter.
Definition at line 242 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV4TRANS_SPECIFIEDSIZETOOBIG, m_created, m_destinations, m_init, m_maxpacksize, and m_rtpsock.
|
virtual |
Sets the maximum packet size which the transmitter should allow to s
.
Implements qrtplib::RTPTransmitter.
Definition at line 427 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, ERR_RTP_UDPV4TRANS_SPECIFIEDSIZETOOBIG, m_absoluteMaxPackSize, m_created, m_init, and m_maxpacksize.
|
virtual |
Sets the receive mode. Sets the receive mode to m
, which is one of the following: RTPTransmitter::AcceptAll, RTPTransmitter::AcceptSome or RTPTransmitter::IgnoreSome. Note that if the receive mode is changed, all information about the addresses to ignore to accept is lost.
Implements qrtplib::RTPTransmitter.
Definition at line 376 of file rtpudptransmitter.cpp.
References ERR_RTP_UDPV4TRANS_NOTCREATED, ERR_RTP_UDPV4TRANS_NOTINIT, m_created, m_init, and m_receivemode.
|
private |
Definition at line 533 of file rtpudptransmitter.cpp.
References qrtplib::RTPTransmitter::AcceptAll, qrtplib::RTPTransmitter::AcceptSome, m_acceptList, m_ignoreList, and m_receivemode.
Referenced by readRTCPPendingDatagrams(), and readRTPPendingDatagrams().
|
virtual |
Returns true
if the transmission component supports multicasting.
Implements qrtplib::RTPTransmitter.
Definition at line 308 of file rtpudptransmitter.cpp.
References m_multicastInterface, m_rtcpsock, and m_rtpsock.
Referenced by JoinMulticastGroup(), and LeaveMulticastGroup().
|
staticprivate |
Definition at line 357 of file rtpudptransmitter.h.
Referenced by Create(), RTPUDPTransmitter(), and SetMaximumPacketSize().
|
private |
Definition at line 362 of file rtpudptransmitter.h.
Referenced by AddToAcceptList(), ClearAcceptList(), DeleteFromAcceptList(), and ShouldAcceptData().
|
private |
Definition at line 347 of file rtpudptransmitter.h.
Referenced by Create(), Destroy(), JoinMulticastGroup(), LeaveMulticastGroup(), RTPUDPTransmitter(), SendRTCPData(), SendRTPData(), SetMaximumPacketSize(), and SetReceiveMode().
|
private |
Definition at line 350 of file rtpudptransmitter.h.
Referenced by Create(), Destroy(), and RTPUDPTransmitter().
|
private |
Definition at line 361 of file rtpudptransmitter.h.
Referenced by AddDestination(), ClearDestinations(), DeleteDestination(), SendRTCPData(), and SendRTPData().
|
private |
Definition at line 363 of file rtpudptransmitter.h.
Referenced by AddToIgnoreList(), ClearIgnoreList(), DeleteFromIgnoreList(), and ShouldAcceptData().
|
private |
Definition at line 346 of file rtpudptransmitter.h.
Referenced by Create(), DeleteTransmissionInfo(), Destroy(), GetTransmissionInfo(), Init(), JoinMulticastGroup(), LeaveMulticastGroup(), RTPUDPTransmitter(), SendRTCPData(), SendRTPData(), SetMaximumPacketSize(), and SetReceiveMode().
|
private |
from parameters bind IP
Definition at line 351 of file rtpudptransmitter.h.
Referenced by BindSockets(), ComesFromThisTransmitter(), Create(), and GetTransmissionInfo().
|
private |
Definition at line 356 of file rtpudptransmitter.h.
Referenced by Create(), RTPUDPTransmitter(), SendRTCPData(), SendRTPData(), and SetMaximumPacketSize().
|
private |
from parameters multicast interface
Definition at line 352 of file rtpudptransmitter.h.
Referenced by Create(), JoinMulticastGroup(), and SupportsMulticasting().
|
private |
Definition at line 364 of file rtpudptransmitter.h.
Referenced by GetNextPacket(), readRTCPPendingDatagrams(), and readRTPPendingDatagrams().
|
private |
Definition at line 365 of file rtpudptransmitter.h.
Referenced by GetNextPacket(), readRTCPPendingDatagrams(), and readRTPPendingDatagrams().
|
private |
Definition at line 354 of file rtpudptransmitter.h.
Referenced by Create(), RTPUDPTransmitter(), SetReceiveMode(), and ShouldAcceptData().
|
private |
Definition at line 359 of file rtpudptransmitter.h.
Referenced by readRTCPPendingDatagrams(), and RTPUDPTransmitter().
|
private |
Definition at line 353 of file rtpudptransmitter.h.
Referenced by BindSockets(), ComesFromThisTransmitter(), Create(), GetTransmissionInfo(), and RTPUDPTransmitter().
|
private |
Definition at line 349 of file rtpudptransmitter.h.
Referenced by BindSockets(), Create(), Destroy(), GetTransmissionInfo(), JoinMulticastGroup(), LeaveMulticastGroup(), readRTCPPendingDatagrams(), readRTPPendingDatagrams(), RTPUDPTransmitter(), SendRTCPData(), and SupportsMulticasting().
|
private |
Definition at line 358 of file rtpudptransmitter.h.
Referenced by readRTPPendingDatagrams(), and RTPUDPTransmitter().
|
private |
Definition at line 353 of file rtpudptransmitter.h.
Referenced by BindSockets(), ComesFromThisTransmitter(), Create(), GetTransmissionInfo(), and RTPUDPTransmitter().
|
private |
Definition at line 349 of file rtpudptransmitter.h.
Referenced by BindSockets(), Create(), Destroy(), GetTransmissionInfo(), JoinMulticastGroup(), LeaveMulticastGroup(), readRTPPendingDatagrams(), RTPUDPTransmitter(), SendRTPData(), and SupportsMulticasting().
|
private |
Definition at line 348 of file rtpudptransmitter.h.
Referenced by Create(), and RTPUDPTransmitter().