33 #ifndef QRTPLIB_RTPUDPTRANSMITTER_H_ 34 #define QRTPLIB_RTPUDPTRANSMITTER_H_ 40 #include <QHostAddress> 41 #include <QNetworkInterface> 48 #define RTPUDPV4TRANS_HASHSIZE 8317 49 #define RTPUDPV4TRANS_DEFAULTPORTBASE 5000 50 #define RTPUDPV4TRANS_RTPRECEIVEBUFFER 32768 51 #define RTPUDPV4TRANS_RTCPRECEIVEBUFFER 32768 52 #define RTPUDPV4TRANS_RTPTRANSMITBUFFER 32768 53 #define RTPUDPV4TRANS_RTCPTRANSMITBUFFER 32768 68 m_bindAddress = bindAddress;
73 m_mcastInterface = mcastInterface;
93 return m_mcastInterface;
135 m_allowoddportbase = f;
142 m_forcedrtcpport = rtcpport;
150 m_rtpsock = rtpsocket;
151 m_rtcpsock = rtcpsocket;
152 m_useexistingsockets =
true;
158 return m_rtpsendbufsz;
164 return m_rtprecvbufsz;
170 return m_rtcpsendbufsz;
176 return m_rtcprecvbufsz;
188 return m_allowoddportbase;
194 return m_forcedrtcpport;
201 if (!m_useexistingsockets) {
205 *rtpsocket = m_rtpsock;
206 *rtcpsocket = m_rtcpsock;
246 QHostAddress localIP,
248 QUdpSocket *rtcpsock,
254 m_rtpsocket = rtpsock;
255 m_rtcpsocket = rtcpsock;
257 m_rtcpPort = rtcpport;
293 #define RTPUDPTRANS_HEADERSIZE (20+8) 310 virtual int BindSockets();
311 void moveToThread(QThread *thread);
312 virtual void Destroy();
316 virtual bool ComesFromThisTransmitter(
const RTPAddress& addr);
322 virtual int SendRTPData(
const void *data, std::size_t len);
323 virtual int SendRTCPData(
const void *data, std::size_t len);
325 virtual int AddDestination(
const RTPAddress &addr);
326 virtual int DeleteDestination(
const RTPAddress &addr);
327 virtual void ClearDestinations();
329 virtual bool SupportsMulticasting();
330 virtual int JoinMulticastGroup(
const RTPAddress &addr);
331 virtual int LeaveMulticastGroup(
const RTPAddress &addr);
334 virtual int AddToIgnoreList(
const RTPAddress &addr);
335 virtual int DeleteFromIgnoreList(
const RTPAddress &addr);
336 virtual void ClearIgnoreList();
337 virtual int AddToAcceptList(
const RTPAddress &addr);
338 virtual int DeleteFromAcceptList(
const RTPAddress &addr);
339 virtual void ClearAcceptList();
340 virtual int SetMaximumPacketSize(std::size_t s);
357 static const std::size_t m_absoluteMaxPackSize = 65535;
358 char m_rtpBuffer[m_absoluteMaxPackSize];
359 char m_rtcpBuffer[m_absoluteMaxPackSize];
367 bool ShouldAcceptData(
const RTPAddress& address);
370 void readRTPPendingDatagrams();
371 void readRTCPPendingDatagrams();
374 void NewDataAvailable();
void SetRTPReceiveBufferSize(int s)
int GetRTCPReceiveBufferSize() const
virtual std::size_t GetHeaderOverhead()
int GetRTPSendBufferSize() const
QNetworkInterface m_mcastInterface
std::list< RTPAddress > m_destinations
std::list< RTPAddress > m_ignoreList
QQueue< RTPRawPacket * > m_rawPacketQueue
uint16_t GetForcedRTCPPort() const
void SetRTCPSendBufferSize(int s)
bool GetUseExistingSockets(QUdpSocket **rtpsocket, QUdpSocket **rtcpsocket) const
#define RTPUDPV4TRANS_RTCPTRANSMITBUFFER
RTPTransmitter::ReceiveMode m_receivemode
int GetRTPReceiveBufferSize() const
RTPUDPTransmissionParams()
QUdpSocket * GetRTPSocket() const
#define RTPUDPV4TRANS_DEFAULTPORTBASE
void SetRTCPMultiplexing(bool f)
QNetworkInterface m_multicastInterface
from parameters multicast interface
#define RTPUDPV4TRANS_RTCPRECEIVEBUFFER
#define RTPUDPV4TRANS_RTPRECEIVEBUFFER
QHostAddress m_bindAddress
uint16_t m_forcedrtcpport
QUdpSocket * GetRTCPSocket() const
QHostAddress m_localIP
from parameters bind IP
uint16_t GetRTCPPort() const
void SetPortbase(uint16_t pbase)
uint16_t GetPortbase() const
bool m_useexistingsockets
bool GetRTCPMultiplexing() const
void SetBindIP(const QHostAddress &bindAddress)
QNetworkInterface GetMulticastInterface() const
~RTPUDPTransmissionInfo()
bool m_deletesocketswhendone
QMutex m_rawPacketQueueLock
void SetAllowOddPortbase(bool f)
std::list< RTPAddress > m_acceptList
void SetRTPSendBufferSize(int s)
void SetMulticastInterface(const QNetworkInterface &mcastInterface)
std::size_t m_maxpacksize
#define RTPUDPTRANS_HEADERSIZE
RTPUDPTransmissionInfo(QHostAddress localIP, QUdpSocket *rtpsock, QUdpSocket *rtcpsock, uint16_t rtpport, uint16_t rtcpport)
void SetUseExistingSockets(QUdpSocket *rtpsocket, QUdpSocket *rtcpsocket)
int GetRTCPSendBufferSize() const
QHostAddress GetBindIP() const
#define RTPUDPV4TRANS_RTPTRANSMITBUFFER
void SetRTCPReceiveBufferSize(int s)
bool GetAllowOddPortbase() const
uint16_t GetRTPPort() const
void SetForcedRTCPPort(uint16_t rtcpport)