1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

qrtplib: restored new operator

This commit is contained in:
f4exb 2018-02-27 02:44:27 +01:00
parent ed2f348bfa
commit 8c1293e213
23 changed files with 69 additions and 69 deletions

View File

@ -154,22 +154,22 @@ int RTCPCompoundPacket::ParseData(uint8_t *data, size_t datalen)
switch (rtcphdr->packettype)
{
case RTP_RTCPTYPE_SR:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPSRPACKET) RTCPSRPacket(data,length);
p = new RTCPSRPacket(data,length);
break;
case RTP_RTCPTYPE_RR:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPRRPACKET) RTCPRRPacket(data,length);
p = new RTCPRRPacket(data,length);
break;
case RTP_RTCPTYPE_SDES:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPSDESPACKET) RTCPSDESPacket(data,length);
p = new RTCPSDESPacket(data,length);
break;
case RTP_RTCPTYPE_BYE:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPBYEPACKET) RTCPBYEPacket(data,length);
p = new RTCPBYEPacket(data,length);
break;
case RTP_RTCPTYPE_APP:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPAPPPACKET) RTCPAPPPacket(data,length);
p = new RTCPAPPPacket(data,length);
break;
default:
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPUNKNOWNPACKET) RTCPUnknownPacket(data,length);
p = new RTCPUnknownPacket(data,length);
}
if (p == 0)

View File

@ -231,7 +231,7 @@ int RTCPCompoundPacketBuilder::AddReportBlock(uint32_t ssrc,uint8_t fractionlost
if ((totalothersize+reportsizewithextrablock) > maximumpacketsize)
return ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT;
uint8_t *buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPRECEIVERREPORT) uint8_t[sizeof(RTCPReceiverReport)];
uint8_t *buf = new uint8_t[sizeof(RTCPReceiverReport)];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
@ -324,7 +324,7 @@ int RTCPCompoundPacketBuilder::AddSDESNormalItem(RTCPSDESPacket::ItemType t,cons
uint8_t *buf;
size_t len;
buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPSDESBLOCK) uint8_t[sizeof(RTCPSDESHeader)+(size_t)itemlength];
buf = new uint8_t[sizeof(RTCPSDESHeader)+(size_t)itemlength];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
len = sizeof(RTCPSDESHeader)+(size_t)itemlength;
@ -366,7 +366,7 @@ int RTCPCompoundPacketBuilder::AddSDESPrivateItem(const void *prefixdata,uint8_t
uint8_t *buf;
size_t len;
buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPSDESBLOCK) uint8_t[sizeof(RTCPSDESHeader)+itemlength];
buf = new uint8_t[sizeof(RTCPSDESHeader)+itemlength];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
len = sizeof(RTCPSDESHeader)+(size_t)itemlength;
@ -423,7 +423,7 @@ int RTCPCompoundPacketBuilder::AddBYEPacket(uint32_t *ssrcs,uint8_t numssrcs,con
uint8_t *buf;
size_t numwords;
buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPBYEPACKET) uint8_t[packsize];
buf = new uint8_t[packsize];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
@ -485,7 +485,7 @@ int RTCPCompoundPacketBuilder::AddAPPPacket(uint8_t subtype,uint32_t ssrc,const
uint8_t *buf;
buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPAPPPACKET) uint8_t[packsize];
buf = new uint8_t[packsize];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
@ -533,7 +533,7 @@ int RTCPCompoundPacketBuilder::AddUnknownPacket(uint8_t payload_type, uint8_t su
if ((totalotherbytes + packsize) > maximumpacketsize)
return ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT;
uint8_t *buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPUNKNOWNPACKET) uint8_t[packsize];
uint8_t *buf = new uint8_t[packsize];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
@ -577,7 +577,7 @@ int RTCPCompoundPacketBuilder::EndBuild()
if (!external)
{
buf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPCOMPOUNDPACKET) uint8_t[len];
buf = new uint8_t[len];
if (buf == 0)
return ERR_RTP_OUTOFMEM;
}
@ -632,9 +632,9 @@ int RTCPCompoundPacketBuilder::EndBuild()
// add entry in parent's list
if (hdr->packettype == RTP_RTCPTYPE_SR)
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPSRPACKET) RTCPSRPacket(curbuf,offset);
p = new RTCPSRPacket(curbuf,offset);
else
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPRRPACKET) RTCPRRPacket(curbuf,offset);
p = new RTCPRRPacket(curbuf,offset);
if (p == 0)
{
if (!external)
@ -708,7 +708,7 @@ int RTCPCompoundPacketBuilder::EndBuild()
hdr->count = sourcecount;
hdr->length = qToBigEndian((uint16_t)(numwords-1));
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPSDESPACKET) RTCPSDESPacket(curbuf,offset);
p = new RTCPSDESPacket(curbuf,offset);
if (p == 0)
{
if (!external)
@ -733,7 +733,7 @@ int RTCPCompoundPacketBuilder::EndBuild()
{
memcpy(curbuf,(*it).packetdata,(*it).packetlength);
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPAPPPACKET) RTCPAPPPacket(curbuf,(*it).packetlength);
p = new RTCPAPPPacket(curbuf,(*it).packetlength);
if (p == 0)
{
if (!external)
@ -758,7 +758,7 @@ int RTCPCompoundPacketBuilder::EndBuild()
{
memcpy(curbuf,(*it).packetdata,(*it).packetlength);
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPUNKNOWNPACKET) RTCPUnknownPacket(curbuf,(*it).packetlength);
p = new RTCPUnknownPacket(curbuf,(*it).packetlength);
if (p == 0)
{
if (!external)
@ -783,7 +783,7 @@ int RTCPCompoundPacketBuilder::EndBuild()
{
memcpy(curbuf,(*it).packetdata,(*it).packetlength);
p = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPBYEPACKET) RTCPBYEPacket(curbuf,(*it).packetlength);
p = new RTCPBYEPacket(curbuf,(*it).packetlength);
if (p == 0)
{
if (!external)

View File

@ -286,7 +286,7 @@ private:
int AddSSRC(uint32_t ssrc)
{
SDESSource *s = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_SDESSOURCE) SDESSource(ssrc,GetMemoryManager());
SDESSource *s = new SDESSource(ssrc,GetMemoryManager());
if (s == 0)
return ERR_RTP_OUTOFMEM;
sdessources.push_back(s);

View File

@ -111,7 +111,7 @@ int RTCPPacketBuilder::BuildNextPacket(RTCPCompoundPacket **pack)
*pack = 0;
rtcpcomppack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPCOMPOUNDPACKETBUILDER) RTCPCompoundPacketBuilder(GetMemoryManager());
rtcpcomppack = new RTCPCompoundPacketBuilder(GetMemoryManager());
if (rtcpcomppack == 0)
return ERR_RTP_OUTOFMEM;
@ -634,7 +634,7 @@ int RTCPPacketBuilder::BuildBYEPacket(RTCPCompoundPacket **pack,const void *reas
*pack = 0;
rtcpcomppack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPCOMPOUNDPACKETBUILDER) RTCPCompoundPacketBuilder(GetMemoryManager());
rtcpcomppack = new RTCPCompoundPacketBuilder(GetMemoryManager());
if (rtcpcomppack == 0)
return ERR_RTP_OUTOFMEM;

View File

@ -84,7 +84,7 @@ int RTCPSDESInfo::SetPrivateValue(const uint8_t *prefix,size_t prefixlen,const u
int status;
item = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_SDESPRIVATEITEM) SDESPrivateItem(GetMemoryManager());
item = new SDESPrivateItem(GetMemoryManager());
if (item == 0)
return ERR_RTP_OUTOFMEM;
if ((status = item->SetPrefix(prefix,prefixlen)) < 0)

View File

@ -170,7 +170,7 @@ private:
else
{
len = (len>RTCP_SDES_MAXITEMLENGTH)?RTCP_SDES_MAXITEMLENGTH:len;
uint8_t *str2 = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_SDESITEM) uint8_t[len];
uint8_t *str2 = new uint8_t[len];
if (str2 == 0)
return ERR_RTP_OUTOFMEM;
memcpy(str2,s,len);

View File

@ -74,7 +74,7 @@ bool RTPByteAddress::IsFromSameHost(const RTPAddress *addr) const
RTPAddress *RTPByteAddress::CreateCopy(RTPMemoryManager *mgr) const
{
JRTPLIB_UNUSED(mgr); // possibly unused
RTPByteAddress *a = RTPNew(mgr, RTPMEM_TYPE_CLASS_RTPADDRESS) RTPByteAddress(hostaddress, addresslength, port);
RTPByteAddress *a = new RTPByteAddress(hostaddress, addresslength, port);
return a;
}

View File

@ -77,7 +77,7 @@
#define RTP_SUPPORT_SENDAPP
#define RTP_SUPPORT_MEMORYMANAGEMENT
// No #define RTP_SUPPORT_MEMORYMANAGEMENT
// No support for sending unknown RTCP packets

View File

@ -167,7 +167,7 @@ RTPTransmissionInfo *RTPExternalTransmitter::GetTransmissionInfo()
return 0;
MAINMUTEX_LOCK
RTPTransmissionInfo *tinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMISSIONINFO) RTPExternalTransmissionInfo(&packetinjector);
RTPTransmissionInfo *tinf = new RTPExternalTransmissionInfo(&packetinjector);
MAINMUTEX_UNLOCK
return tinf;
}
@ -204,7 +204,7 @@ int RTPExternalTransmitter::GetLocalHostName(uint8_t *buffer,size_t *bufferlengt
name[1023] = 0; // ensure null-termination
localhostnamelength = strlen(name);
localhostname = RTPNew(GetMemoryManager(),RTPMEM_TYPE_OTHER) uint8_t [localhostnamelength+1];
localhostname = new uint8_t [localhostnamelength+1];
memcpy(localhostname, name, localhostnamelength);
localhostname[localhostnamelength] = 0;
@ -575,7 +575,7 @@ void RTPExternalTransmitter::InjectRTP(const void *data, size_t len, const RTPAd
uint8_t *datacopy;
datacopy = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET) uint8_t[len];
datacopy = new uint8_t[len];
if (datacopy == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -586,7 +586,7 @@ void RTPExternalTransmitter::InjectRTP(const void *data, size_t len, const RTPAd
RTPTime curtime = RTPTime::CurrentTime();
RTPRawPacket *pack;
pack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(datacopy,len,addr,curtime,true,GetMemoryManager());
pack = new RTPRawPacket(datacopy,len,addr,curtime,true,GetMemoryManager());
if (pack == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -622,7 +622,7 @@ void RTPExternalTransmitter::InjectRTCP(const void *data, size_t len, const RTPA
uint8_t *datacopy;
datacopy = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET) uint8_t[len];
datacopy = new uint8_t[len];
if (datacopy == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -633,7 +633,7 @@ void RTPExternalTransmitter::InjectRTCP(const void *data, size_t len, const RTPA
RTPTime curtime = RTPTime::CurrentTime();
RTPRawPacket *pack;
pack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(datacopy,len,addr,curtime,false,GetMemoryManager());
pack = new RTPRawPacket(datacopy,len,addr,curtime,false,GetMemoryManager());
if (pack == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -677,7 +677,7 @@ void RTPExternalTransmitter::InjectRTPorRTCP(const void *data, size_t len, const
rtp = false;
}
datacopy = RTPNew(GetMemoryManager(),(rtp)?RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET:RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET) uint8_t[len];
datacopy = new uint8_t[len];
if (datacopy == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -688,7 +688,7 @@ void RTPExternalTransmitter::InjectRTPorRTCP(const void *data, size_t len, const
RTPTime curtime = RTPTime::CurrentTime();
RTPRawPacket *pack;
pack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(datacopy,len,addr,curtime,rtp,GetMemoryManager());
pack = new RTPRawPacket(datacopy,len,addr,curtime,rtp,GetMemoryManager());
if (pack == 0)
{
RTPDelete(addr,GetMemoryManager());

View File

@ -265,7 +265,7 @@ inline int RTPHashTable<Element,GetIndex,hashsize>::AddElement(const Element &el
// Okay, the key doesn't exist, so we can add the new element in the hash table
newelem = RTPNew(GetMemoryManager(),memorytype) HashElement(elem,index);
newelem = new HashElement(elem,index);
if (newelem == 0)
return ERR_RTP_OUTOFMEM;

View File

@ -280,7 +280,7 @@ int RTPInternalSourceData::ProcessBYEPacket(const uint8_t *reason,size_t reasonl
}
byetime = receivetime;
byereason = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTCPBYEREASON) uint8_t[reasonlen];
byereason = new uint8_t[reasonlen];
if (byereason == 0)
return ERR_RTP_OUTOFMEM;
memcpy(byereason,reason,reasonlen);

View File

@ -65,7 +65,7 @@ bool RTPIPv4Address::IsFromSameHost(const RTPAddress *addr) const
RTPAddress *RTPIPv4Address::CreateCopy(RTPMemoryManager *mgr) const
{
JRTPLIB_UNUSED(mgr); // possibly unused
RTPIPv4Address *a = RTPNew(mgr,RTPMEM_TYPE_CLASS_RTPADDRESS) RTPIPv4Address(ip,port);
RTPIPv4Address *a = new RTPIPv4Address(ip,port);
return a;
}

View File

@ -268,7 +268,7 @@ inline int RTPKeyHashTable<Key,Element,GetIndex,hashsize>::AddElement(const Key
// Okay, the key doesn't exist, so we can add the new element in the hash table
newelem = RTPNew(GetMemoryManager(),memorytype) HashElement(k,elem,index);
newelem = new HashElement(k,elem,index);
if (newelem == 0)
return ERR_RTP_OUTOFMEM;

View File

@ -235,7 +235,7 @@ inline void RTPDelete(ClassName *obj, RTPMemoryManager *mgr)
#else
#define RTPNew(a,b) new
//#define RTPNew(a,b) new
#define RTPDelete(a,b) delete a
#define RTPDeleteByteArray(a,b) delete [] a;

View File

@ -244,7 +244,7 @@ int RTPPacket::BuildPacket(uint8_t payloadtype,const void *payloaddata,size_t pa
if (buffer == 0)
{
packet = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTPPACKET) uint8_t [packetlength];
packet = new uint8_t [packetlength];
if (packet == 0)
{
packetlength = 0;

View File

@ -61,7 +61,7 @@ int RTPPacketBuilder::Init(size_t max)
return ERR_RTP_PACKBUILD_INVALIDMAXPACKETSIZE;
maxpacksize = max;
buffer = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTPPACKETBUILDERBUFFER) uint8_t [max];
buffer = new uint8_t [max];
if (buffer == 0)
return ERR_RTP_OUTOFMEM;
packetlength = 0;
@ -92,7 +92,7 @@ int RTPPacketBuilder::SetMaximumPacketSize(size_t max)
if (max <= 0)
return ERR_RTP_PACKBUILD_INVALIDMAXPACKETSIZE;
newbuf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_BUFFER_RTPPACKETBUILDERBUFFER) uint8_t[max];
newbuf = new uint8_t[max];
if (newbuf == 0)
return ERR_RTP_OUTOFMEM;

View File

@ -134,7 +134,7 @@ inline void RTPRawPacket::DeleteData()
inline uint8_t *RTPRawPacket::AllocateBytes(bool isrtp, int recvlen) const
{
JRTPLIB_UNUSED(isrtp); // possibly unused
return RTPNew(GetMemoryManager(),(isrtp)?RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET:RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET) uint8_t[recvlen];
return new uint8_t[recvlen];
}
inline void RTPRawPacket::SetData(uint8_t *data, size_t datalen)

View File

@ -118,10 +118,10 @@ int RTPSession::Create(const RTPSessionParams &sessparams,const RTPTransmissionP
switch(protocol)
{
case RTPTransmitter::IPv4UDPProto:
rtptrans = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMITTER) RTPUDPv4Transmitter(GetMemoryManager());
rtptrans = new RTPUDPv4Transmitter(GetMemoryManager());
break;
case RTPTransmitter::ExternalProto:
rtptrans = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMITTER) RTPExternalTransmitter(GetMemoryManager());
rtptrans = new RTPExternalTransmitter(GetMemoryManager());
break;
case RTPTransmitter::UserDefinedProto:
rtptrans = NewUserDefinedTransmitter();
@ -129,7 +129,7 @@ int RTPSession::Create(const RTPSessionParams &sessparams,const RTPTransmissionP
return ERR_RTP_SESSION_USERDEFINEDTRANSMITTERNULL;
break;
case RTPTransmitter::TCPProto:
rtptrans = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMITTER) RTPTCPTransmitter(GetMemoryManager());
rtptrans = new RTPTCPTransmitter(GetMemoryManager());
break;
default:
return ERR_RTP_SESSION_UNSUPPORTEDTRANSMISSIONPROTOCOL;
@ -677,7 +677,7 @@ int RTPSession::SendUnknownPacket(bool sr, uint8_t payload_type, uint8_t subtype
uint32_t ssrc = packetbuilder.GetSSRC();
BUILDER_UNLOCK
RTCPCompoundPacketBuilder* rtcpcomppack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTCPCOMPOUNDPACKETBUILDER) RTCPCompoundPacketBuilder(GetMemoryManager());
RTCPCompoundPacketBuilder* rtcpcomppack = new RTCPCompoundPacketBuilder(GetMemoryManager());
if (rtcpcomppack == 0)
{
RTPDelete(rtcpcomppack,GetMemoryManager());

View File

@ -173,7 +173,7 @@ int RTPSources::ProcessRawPacket(RTPRawPacket *rawpack,RTPTransmitter *rtptrans[
RTPPacket *rtppack;
// First, we'll see if the packet can be parsed
rtppack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPPACKET) RTPPacket(*rawpack,GetMemoryManager());
rtppack = new RTPPacket(*rawpack,GetMemoryManager());
if (rtppack == 0)
return ERR_RTP_OUTOFMEM;
if ((status = rtppack->GetCreationError()) < 0)
@ -821,9 +821,9 @@ int RTPSources::ObtainSourceDataInstance(uint32_t ssrc,RTPInternalSourceData **s
if (sourcelist.GotoElement(ssrc) < 0) // No entry for this source
{
#ifdef RTP_SUPPORT_PROBATION
srcdat2 = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPINTERNALSOURCEDATA) RTPInternalSourceData(ssrc,probationtype,GetMemoryManager());
srcdat2 = new RTPInternalSourceData(ssrc,probationtype,GetMemoryManager());
#else
srcdat2 = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPINTERNALSOURCEDATA) RTPInternalSourceData(ssrc,RTPSources::NoProbation,GetMemoryManager());
srcdat2 = new RTPInternalSourceData(ssrc,RTPSources::NoProbation,GetMemoryManager());
#endif // RTP_SUPPORT_PROBATION
if (srcdat2 == 0)
return ERR_RTP_OUTOFMEM;

View File

@ -60,7 +60,7 @@ bool RTPTCPAddress::IsFromSameHost(const RTPAddress *addr) const
RTPAddress *RTPTCPAddress::CreateCopy(RTPMemoryManager *mgr) const
{
JRTPLIB_UNUSED(mgr); // possibly unused
RTPTCPAddress *a = RTPNew(mgr,RTPMEM_TYPE_CLASS_RTPADDRESS) RTPTCPAddress(m_socket);
RTPTCPAddress *a = new RTPTCPAddress(m_socket);
return a;
}

View File

@ -173,7 +173,7 @@ RTPTransmissionInfo *RTPTCPTransmitter::GetTransmissionInfo()
return 0;
MAINMUTEX_LOCK
RTPTransmissionInfo *tinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMISSIONINFO) RTPTCPTransmissionInfo();
RTPTransmissionInfo *tinf = new RTPTCPTransmissionInfo();
MAINMUTEX_UNLOCK
return tinf;
}
@ -703,7 +703,7 @@ int RTPTCPTransmitter::PollSocket(SocketType sock, SocketData &sdata)
int dataLength = sdata.m_dataLength;
sdata.Reset();
RTPTCPAddress *pAddr = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPADDRESS) RTPTCPAddress(sock);
RTPTCPAddress *pAddr = new RTPTCPAddress(sock);
if (pAddr == 0)
return ERR_RTP_OUTOFMEM;
@ -717,7 +717,7 @@ int RTPTCPTransmitter::PollSocket(SocketType sock, SocketData &sdata)
isrtp = false;
}
RTPRawPacket *pPack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(pBuf, dataLength, pAddr, curtime, isrtp, GetMemoryManager());
RTPRawPacket *pPack = new RTPRawPacket(pBuf, dataLength, pAddr, curtime, isrtp, GetMemoryManager());
if (pPack == 0)
{
RTPDelete(pAddr,GetMemoryManager());
@ -865,7 +865,7 @@ int RTPTCPTransmitter::SocketData::ProcessAvailableBytes(SocketType sock, int av
l = 1;
// We don't yet know if it's an RTP or RTCP packet, so we'll stick to RTP
m_pDataBuffer = RTPNew(pMgr, RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET) uint8_t[l];
m_pDataBuffer = new uint8_t[l];
if (m_pDataBuffer == 0)
return ERR_RTP_OUTOFMEM;
}

View File

@ -559,7 +559,7 @@ RTPTransmissionInfo *RTPUDPv4Transmitter::GetTransmissionInfo()
return 0;
MAINMUTEX_LOCK
RTPTransmissionInfo *tinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMISSIONINFO) RTPUDPv4TransmissionInfo(localIPs,rtpsock,rtcpsock,m_rtpPort,m_rtcpPort);
RTPTransmissionInfo *tinf = new RTPUDPv4TransmissionInfo(localIPs,rtpsock,rtcpsock,m_rtpPort,m_rtcpPort);
MAINMUTEX_UNLOCK
return tinf;
}
@ -657,7 +657,7 @@ int RTPUDPv4Transmitter::GetLocalHostName(uint8_t *buffer,size_t *bufferlength)
{
found = true;
localhostnamelength = (*it).length();
localhostname = RTPNew(GetMemoryManager(),RTPMEM_TYPE_OTHER) uint8_t [localhostnamelength+1];
localhostname = new uint8_t [localhostnamelength+1];
if (localhostname == 0)
{
MAINMUTEX_UNLOCK
@ -682,7 +682,7 @@ int RTPUDPv4Transmitter::GetLocalHostName(uint8_t *buffer,size_t *bufferlength)
len = strlen(str);
localhostnamelength = len;
localhostname = RTPNew(GetMemoryManager(),RTPMEM_TYPE_OTHER) uint8_t [localhostnamelength + 1];
localhostname = new uint8_t [localhostnamelength + 1];
if (localhostname == 0)
{
MAINMUTEX_UNLOCK
@ -1487,10 +1487,10 @@ int RTPUDPv4Transmitter::PollSocket(bool rtp)
RTPIPv4Address *addr;
uint8_t *datacopy;
addr = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPADDRESS) RTPIPv4Address(ntohl(srcaddr.sin_addr.s_addr),ntohs(srcaddr.sin_port));
addr = new RTPIPv4Address(ntohl(srcaddr.sin_addr.s_addr),ntohs(srcaddr.sin_port));
if (addr == 0)
return ERR_RTP_OUTOFMEM;
datacopy = RTPNew(GetMemoryManager(),(rtp)?RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET:RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET) uint8_t[recvlen];
datacopy = new uint8_t[recvlen];
if (datacopy == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -1513,7 +1513,7 @@ int RTPUDPv4Transmitter::PollSocket(bool rtp)
}
}
pack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(datacopy,recvlen,addr,curtime,isrtp,GetMemoryManager());
pack = new RTPRawPacket(datacopy,recvlen,addr,curtime,isrtp,GetMemoryManager());
if (pack == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -1560,7 +1560,7 @@ int RTPUDPv4Transmitter::ProcessAddAcceptIgnoreEntry(uint32_t ip,uint16_t port)
PortInfo *portinf;
int status;
portinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_ACCEPTIGNOREPORTINFO) PortInfo();
portinf = new PortInfo();
if (port == 0) // select all ports
portinf->all = true;
else

View File

@ -577,7 +577,7 @@ RTPTransmissionInfo *RTPUDPv4TransmitterNoBind::GetTransmissionInfo()
return 0;
MAINMUTEX_LOCK
RTPTransmissionInfo *tinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPTRANSMISSIONINFO) RTPUDPv4TransmissionNoBindInfo(localIPs,rtpsock,rtcpsock,m_rtpPort,m_rtcpPort);
RTPTransmissionInfo *tinf = new RTPUDPv4TransmissionNoBindInfo(localIPs,rtpsock,rtcpsock,m_rtpPort,m_rtcpPort);
MAINMUTEX_UNLOCK
return tinf;
}
@ -675,7 +675,7 @@ int RTPUDPv4TransmitterNoBind::GetLocalHostName(uint8_t *buffer, size_t *bufferl
{
found = true;
localhostnamelength = (*it).length();
localhostname = RTPNew(GetMemoryManager(),RTPMEM_TYPE_OTHER) uint8_t [localhostnamelength+1];
localhostname = new uint8_t [localhostnamelength+1];
if (localhostname == 0)
{
MAINMUTEX_UNLOCK
@ -700,7 +700,7 @@ int RTPUDPv4TransmitterNoBind::GetLocalHostName(uint8_t *buffer, size_t *bufferl
len = strlen(str);
localhostnamelength = len;
localhostname = RTPNew(GetMemoryManager(),RTPMEM_TYPE_OTHER) uint8_t [localhostnamelength + 1];
localhostname = new uint8_t [localhostnamelength + 1];
if (localhostname == 0)
{
MAINMUTEX_UNLOCK
@ -1505,10 +1505,10 @@ int RTPUDPv4TransmitterNoBind::PollSocket(bool rtp)
RTPIPv4Address *addr;
uint8_t *datacopy;
addr = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPADDRESS) RTPIPv4Address(ntohl(srcaddr.sin_addr.s_addr),ntohs(srcaddr.sin_port));
addr = new RTPIPv4Address(ntohl(srcaddr.sin_addr.s_addr),ntohs(srcaddr.sin_port));
if (addr == 0)
return ERR_RTP_OUTOFMEM;
datacopy = RTPNew(GetMemoryManager(),(rtp)?RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET:RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET) uint8_t[recvlen];
datacopy = new uint8_t[recvlen];
if (datacopy == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -1531,7 +1531,7 @@ int RTPUDPv4TransmitterNoBind::PollSocket(bool rtp)
}
}
pack = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_RTPRAWPACKET) RTPRawPacket(datacopy,recvlen,addr,curtime,isrtp,GetMemoryManager());
pack = new RTPRawPacket(datacopy,recvlen,addr,curtime,isrtp,GetMemoryManager());
if (pack == 0)
{
RTPDelete(addr,GetMemoryManager());
@ -1578,7 +1578,7 @@ int RTPUDPv4TransmitterNoBind::ProcessAddAcceptIgnoreEntry(uint32_t ip,uint16_t
PortInfo *portinf;
int status;
portinf = RTPNew(GetMemoryManager(),RTPMEM_TYPE_CLASS_ACCEPTIGNOREPORTINFO) PortInfo();
portinf = new PortInfo();
if (port == 0) // select all ports
portinf->all = true;
else