Fix some chromium-style warnings in webrtc/test/
BUG=163 R=phoglund@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1907004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4428 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
a6f56acc53
commit
e6c3966530
@ -28,21 +28,21 @@ class VoiceChannelTransport : public UdpTransportData {
|
|||||||
virtual ~VoiceChannelTransport();
|
virtual ~VoiceChannelTransport();
|
||||||
|
|
||||||
// Start implementation of UdpTransportData.
|
// Start implementation of UdpTransportData.
|
||||||
void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
virtual void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
||||||
const int32_t packet_length,
|
const int32_t packet_length,
|
||||||
const char* /*from_ip*/,
|
const char* /*from_ip*/,
|
||||||
const uint16_t /*from_port*/);
|
const uint16_t /*from_port*/) OVERRIDE;
|
||||||
|
|
||||||
void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
virtual void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
||||||
const int32_t packet_length,
|
const int32_t packet_length,
|
||||||
const char* /*from_ip*/,
|
const char* /*from_ip*/,
|
||||||
const uint16_t /*from_port*/);
|
const uint16_t /*from_port*/) OVERRIDE;
|
||||||
// End implementation of UdpTransportData.
|
// End implementation of UdpTransportData.
|
||||||
|
|
||||||
// Specifies the ports to receive RTP packets on.
|
// Specifies the ports to receive RTP packets on.
|
||||||
int SetLocalReceiver(uint16_t rtp_port);
|
int SetLocalReceiver(uint16_t rtp_port);
|
||||||
|
|
||||||
// Specifies the destination port and IP address for a specified channel.
|
// Specifies the destination port and IP address for a specified channel.
|
||||||
int SetSendDestination(const char* ip_address, uint16_t rtp_port);
|
int SetSendDestination(const char* ip_address, uint16_t rtp_port);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -59,21 +59,21 @@ class VideoChannelTransport : public UdpTransportData {
|
|||||||
virtual ~VideoChannelTransport();
|
virtual ~VideoChannelTransport();
|
||||||
|
|
||||||
// Start implementation of UdpTransportData.
|
// Start implementation of UdpTransportData.
|
||||||
void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
virtual void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
||||||
const int32_t packet_length,
|
const int32_t packet_length,
|
||||||
const char* /*from_ip*/,
|
const char* /*from_ip*/,
|
||||||
const uint16_t /*from_port*/);
|
const uint16_t /*from_port*/) OVERRIDE;
|
||||||
|
|
||||||
void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
virtual void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
||||||
const int32_t packet_length,
|
const int32_t packet_length,
|
||||||
const char* /*from_ip*/,
|
const char* /*from_ip*/,
|
||||||
const uint16_t /*from_port*/);
|
const uint16_t /*from_port*/) OVERRIDE;
|
||||||
// End implementation of UdpTransportData.
|
// End implementation of UdpTransportData.
|
||||||
|
|
||||||
// Specifies the ports to receive RTP packets on.
|
// Specifies the ports to receive RTP packets on.
|
||||||
int SetLocalReceiver(uint16_t rtp_port);
|
int SetLocalReceiver(uint16_t rtp_port);
|
||||||
|
|
||||||
// Specifies the destination port and IP address for a specified channel.
|
// Specifies the destination port and IP address for a specified channel.
|
||||||
int SetSendDestination(const char* ip_address, uint16_t rtp_port);
|
int SetSendDestination(const char* ip_address, uint16_t rtp_port);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -36,15 +36,15 @@ public:
|
|||||||
UdpSocketManagerPosix();
|
UdpSocketManagerPosix();
|
||||||
virtual ~UdpSocketManagerPosix();
|
virtual ~UdpSocketManagerPosix();
|
||||||
|
|
||||||
virtual bool Init(int32_t id, uint8_t& numOfWorkThreads);
|
virtual bool Init(int32_t id, uint8_t& numOfWorkThreads) OVERRIDE;
|
||||||
|
|
||||||
virtual int32_t ChangeUniqueId(const int32_t id);
|
virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
|
||||||
|
|
||||||
virtual bool Start();
|
virtual bool Start() OVERRIDE;
|
||||||
virtual bool Stop();
|
virtual bool Stop() OVERRIDE;
|
||||||
|
|
||||||
virtual bool AddSocket(UdpSocketWrapper* s);
|
virtual bool AddSocket(UdpSocketWrapper* s) OVERRIDE;
|
||||||
virtual bool RemoveSocket(UdpSocketWrapper* s);
|
virtual bool RemoveSocket(UdpSocketWrapper* s) OVERRIDE;
|
||||||
private:
|
private:
|
||||||
int32_t _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper* _critSect;
|
CriticalSectionWrapper* _critSect;
|
||||||
|
@ -173,11 +173,25 @@ int32_t UdpSocketPosix::SendTo(const int8_t* buf, int32_t len,
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SOCKET UdpSocketPosix::GetFd() { return _socket; }
|
||||||
|
int32_t UdpSocketPosix::GetError() { return _error; }
|
||||||
|
|
||||||
bool UdpSocketPosix::ValidHandle()
|
bool UdpSocketPosix::ValidHandle()
|
||||||
{
|
{
|
||||||
return _socket != INVALID_SOCKET;
|
return _socket != INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UdpSocketPosix::SetQos(int32_t /*serviceType*/,
|
||||||
|
int32_t /*tokenRate*/,
|
||||||
|
int32_t /*bucketSize*/,
|
||||||
|
int32_t /*peekBandwith*/,
|
||||||
|
int32_t /*minPolicedSize*/,
|
||||||
|
int32_t /*maxSduSize*/,
|
||||||
|
const SocketAddress& /*stRemName*/,
|
||||||
|
int32_t /*overrideDSCP*/) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void UdpSocketPosix::HasIncoming()
|
void UdpSocketPosix::HasIncoming()
|
||||||
{
|
{
|
||||||
// replace 2048 with a mcro define and figure out
|
// replace 2048 with a mcro define and figure out
|
||||||
@ -221,6 +235,8 @@ void UdpSocketPosix::HasIncoming()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UdpSocketPosix::WantsIncoming() { return _wantsIncoming; }
|
||||||
|
|
||||||
void UdpSocketPosix::CloseBlocking()
|
void UdpSocketPosix::CloseBlocking()
|
||||||
{
|
{
|
||||||
_cs->Enter();
|
_cs->Enter();
|
||||||
|
@ -33,28 +33,29 @@ public:
|
|||||||
|
|
||||||
virtual ~UdpSocketPosix();
|
virtual ~UdpSocketPosix();
|
||||||
|
|
||||||
virtual int32_t ChangeUniqueId(const int32_t id);
|
virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
|
||||||
|
|
||||||
virtual bool SetCallback(CallbackObj obj, IncomingSocketCallback cb);
|
virtual bool SetCallback(CallbackObj obj,
|
||||||
|
IncomingSocketCallback cb) OVERRIDE;
|
||||||
|
|
||||||
virtual bool Bind(const SocketAddress& name);
|
virtual bool Bind(const SocketAddress& name) OVERRIDE;
|
||||||
|
|
||||||
virtual bool SetSockopt(int32_t level, int32_t optname,
|
virtual bool SetSockopt(int32_t level, int32_t optname,
|
||||||
const int8_t* optval, int32_t optlen);
|
const int8_t* optval, int32_t optlen) OVERRIDE;
|
||||||
|
|
||||||
virtual int32_t SetTOS(const int32_t serviceType);
|
virtual int32_t SetTOS(const int32_t serviceType) OVERRIDE;
|
||||||
|
|
||||||
virtual int32_t SendTo(const int8_t* buf, int32_t len,
|
virtual int32_t SendTo(const int8_t* buf, int32_t len,
|
||||||
const SocketAddress& to);
|
const SocketAddress& to) OVERRIDE;
|
||||||
|
|
||||||
// Deletes socket in addition to closing it.
|
// Deletes socket in addition to closing it.
|
||||||
// TODO (hellner): make destructor protected.
|
// TODO (hellner): make destructor protected.
|
||||||
virtual void CloseBlocking();
|
virtual void CloseBlocking() OVERRIDE;
|
||||||
|
|
||||||
virtual SOCKET GetFd() {return _socket;}
|
virtual SOCKET GetFd();
|
||||||
virtual int32_t GetError() {return _error;}
|
virtual int32_t GetError();
|
||||||
|
|
||||||
virtual bool ValidHandle();
|
virtual bool ValidHandle() OVERRIDE;
|
||||||
|
|
||||||
virtual bool SetQos(int32_t /*serviceType*/,
|
virtual bool SetQos(int32_t /*serviceType*/,
|
||||||
int32_t /*tokenRate*/,
|
int32_t /*tokenRate*/,
|
||||||
@ -63,11 +64,11 @@ public:
|
|||||||
int32_t /*minPolicedSize*/,
|
int32_t /*minPolicedSize*/,
|
||||||
int32_t /*maxSduSize*/,
|
int32_t /*maxSduSize*/,
|
||||||
const SocketAddress& /*stRemName*/,
|
const SocketAddress& /*stRemName*/,
|
||||||
int32_t /*overrideDSCP*/) {return false;}
|
int32_t /*overrideDSCP*/) OVERRIDE;
|
||||||
|
|
||||||
bool CleanUp();
|
bool CleanUp();
|
||||||
void HasIncoming();
|
void HasIncoming();
|
||||||
bool WantsIncoming() {return _wantsIncoming;}
|
bool WantsIncoming();
|
||||||
void ReadyForDeletion();
|
void ReadyForDeletion();
|
||||||
private:
|
private:
|
||||||
friend class UdpSocketManagerPosix;
|
friend class UdpSocketManagerPosix;
|
||||||
|
@ -141,11 +141,19 @@ bool UdpSocketWrapper::StartReceiving()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UdpSocketWrapper::StartReceiving(const uint32_t /*receiveBuffers*/) {
|
||||||
|
return StartReceiving();
|
||||||
|
}
|
||||||
|
|
||||||
bool UdpSocketWrapper::StopReceiving()
|
bool UdpSocketWrapper::StopReceiving()
|
||||||
{
|
{
|
||||||
_wantsIncoming = false;
|
_wantsIncoming = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t UdpSocketWrapper::SetPCP(const int32_t /*pcp*/) { return -1; }
|
||||||
|
|
||||||
|
uint32_t UdpSocketWrapper::ReceiveBuffers() { return 0; }
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -62,8 +62,7 @@ public:
|
|||||||
|
|
||||||
// Start receiving UDP data.
|
// Start receiving UDP data.
|
||||||
virtual bool StartReceiving();
|
virtual bool StartReceiving();
|
||||||
virtual inline bool StartReceiving(const uint32_t /*receiveBuffers*/)
|
virtual bool StartReceiving(const uint32_t /*receiveBuffers*/);
|
||||||
{return StartReceiving();}
|
|
||||||
// Stop receiving UDP data.
|
// Stop receiving UDP data.
|
||||||
virtual bool StopReceiving();
|
virtual bool StopReceiving();
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ public:
|
|||||||
virtual int32_t SetTOS(const int32_t serviceType) = 0;
|
virtual int32_t SetTOS(const int32_t serviceType) = 0;
|
||||||
|
|
||||||
// Set 802.1Q PCP field (802.1p) for outgoing VLAN traffic.
|
// Set 802.1Q PCP field (802.1p) for outgoing VLAN traffic.
|
||||||
virtual int32_t SetPCP(const int32_t /*pcp*/) {return -1;}
|
virtual int32_t SetPCP(const int32_t /*pcp*/);
|
||||||
|
|
||||||
// Send buf of length len to the address specified by to.
|
// Send buf of length len to the address specified by to.
|
||||||
virtual int32_t SendTo(const int8_t* buf, int32_t len,
|
virtual int32_t SendTo(const int8_t* buf, int32_t len,
|
||||||
@ -95,7 +94,7 @@ public:
|
|||||||
const SocketAddress &stRemName,
|
const SocketAddress &stRemName,
|
||||||
int32_t overrideDSCP = 0) = 0;
|
int32_t overrideDSCP = 0) = 0;
|
||||||
|
|
||||||
virtual uint32_t ReceiveBuffers() {return 0;};
|
virtual uint32_t ReceiveBuffers();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Creating the socket is done via CreateSocket().
|
// Creating the socket is done via CreateSocket().
|
||||||
|
@ -68,12 +68,12 @@ namespace test {
|
|||||||
|
|
||||||
class SocketFactory : public UdpTransportImpl::SocketFactoryInterface {
|
class SocketFactory : public UdpTransportImpl::SocketFactoryInterface {
|
||||||
public:
|
public:
|
||||||
UdpSocketWrapper* CreateSocket(const int32_t id,
|
virtual UdpSocketWrapper* CreateSocket(const int32_t id,
|
||||||
UdpSocketManager* mgr,
|
UdpSocketManager* mgr,
|
||||||
CallbackObj obj,
|
CallbackObj obj,
|
||||||
IncomingSocketCallback cb,
|
IncomingSocketCallback cb,
|
||||||
bool ipV6Enable,
|
bool ipV6Enable,
|
||||||
bool disableGQOS) {
|
bool disableGQOS) OVERRIDE {
|
||||||
return UdpSocketWrapper::CreateSocket(id, mgr, obj, cb, ipV6Enable,
|
return UdpSocketWrapper::CreateSocket(id, mgr, obj, cb, ipV6Enable,
|
||||||
disableGQOS);
|
disableGQOS);
|
||||||
}
|
}
|
||||||
|
@ -50,90 +50,93 @@ public:
|
|||||||
virtual int32_t InitializeSendSockets(
|
virtual int32_t InitializeSendSockets(
|
||||||
const char* ipAddr,
|
const char* ipAddr,
|
||||||
const uint16_t rtpPort,
|
const uint16_t rtpPort,
|
||||||
const uint16_t rtcpPort = 0);
|
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||||
virtual int32_t InitializeReceiveSockets(
|
virtual int32_t InitializeReceiveSockets(
|
||||||
UdpTransportData* const packetCallback,
|
UdpTransportData* const packetCallback,
|
||||||
const uint16_t rtpPort,
|
const uint16_t rtpPort,
|
||||||
const char* ipAddr = NULL,
|
const char* ipAddr = NULL,
|
||||||
const char* multicastIpAddr = NULL,
|
const char* multicastIpAddr = NULL,
|
||||||
const uint16_t rtcpPort = 0);
|
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||||
virtual int32_t InitializeSourcePorts(
|
virtual int32_t InitializeSourcePorts(
|
||||||
const uint16_t rtpPort,
|
const uint16_t rtpPort,
|
||||||
const uint16_t rtcpPort = 0);
|
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||||
virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const;
|
virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const
|
||||||
|
OVERRIDE;
|
||||||
virtual int32_t ReceiveSocketInformation(
|
virtual int32_t ReceiveSocketInformation(
|
||||||
char ipAddr[kIpAddressVersion6Length],
|
char ipAddr[kIpAddressVersion6Length],
|
||||||
uint16_t& rtpPort,
|
uint16_t& rtpPort,
|
||||||
uint16_t& rtcpPort,
|
uint16_t& rtcpPort,
|
||||||
char multicastIpAddr[kIpAddressVersion6Length]) const;
|
char multicastIpAddr[kIpAddressVersion6Length]) const OVERRIDE;
|
||||||
virtual int32_t SendSocketInformation(
|
virtual int32_t SendSocketInformation(
|
||||||
char ipAddr[kIpAddressVersion6Length],
|
char ipAddr[kIpAddressVersion6Length],
|
||||||
uint16_t& rtpPort,
|
uint16_t& rtpPort,
|
||||||
uint16_t& rtcpPort) const;
|
uint16_t& rtcpPort) const OVERRIDE;
|
||||||
virtual int32_t RemoteSocketInformation(
|
virtual int32_t RemoteSocketInformation(
|
||||||
char ipAddr[kIpAddressVersion6Length],
|
char ipAddr[kIpAddressVersion6Length],
|
||||||
uint16_t& rtpPort,
|
uint16_t& rtpPort,
|
||||||
uint16_t& rtcpPort) const;
|
uint16_t& rtcpPort) const OVERRIDE;
|
||||||
virtual int32_t SetQoS(const bool QoS,
|
virtual int32_t SetQoS(const bool QoS,
|
||||||
const int32_t serviceType,
|
const int32_t serviceType,
|
||||||
const uint32_t maxBitrate = 0,
|
const uint32_t maxBitrate = 0,
|
||||||
const int32_t overrideDSCP = 0,
|
const int32_t overrideDSCP = 0,
|
||||||
const bool audio = false);
|
const bool audio = false) OVERRIDE;
|
||||||
virtual int32_t QoS(bool& QoS, int32_t& serviceType,
|
virtual int32_t QoS(bool& QoS, int32_t& serviceType,
|
||||||
int32_t& overrideDSCP) const;
|
int32_t& overrideDSCP) const OVERRIDE;
|
||||||
virtual int32_t SetToS(const int32_t DSCP,
|
virtual int32_t SetToS(const int32_t DSCP,
|
||||||
const bool useSetSockOpt = false);
|
const bool useSetSockOpt = false) OVERRIDE;
|
||||||
virtual int32_t ToS(int32_t& DSCP, bool& useSetSockOpt) const;
|
virtual int32_t ToS(int32_t& DSCP, bool& useSetSockOpt) const OVERRIDE;
|
||||||
virtual int32_t SetPCP(const int32_t PCP);
|
virtual int32_t SetPCP(const int32_t PCP) OVERRIDE;
|
||||||
virtual int32_t PCP(int32_t& PCP) const;
|
virtual int32_t PCP(int32_t& PCP) const OVERRIDE;
|
||||||
virtual int32_t EnableIpV6();
|
virtual int32_t EnableIpV6() OVERRIDE;
|
||||||
virtual bool IpV6Enabled() const;
|
virtual bool IpV6Enabled() const OVERRIDE;
|
||||||
virtual int32_t SetFilterIP(
|
virtual int32_t SetFilterIP(
|
||||||
const char filterIPAddress[kIpAddressVersion6Length]);
|
const char filterIPAddress[kIpAddressVersion6Length]) OVERRIDE;
|
||||||
virtual int32_t FilterIP(
|
virtual int32_t FilterIP(
|
||||||
char filterIPAddress[kIpAddressVersion6Length]) const;
|
char filterIPAddress[kIpAddressVersion6Length]) const OVERRIDE;
|
||||||
virtual int32_t SetFilterPorts(const uint16_t rtpFilterPort,
|
virtual int32_t SetFilterPorts(const uint16_t rtpFilterPort,
|
||||||
const uint16_t rtcpFilterPort);
|
const uint16_t rtcpFilterPort) OVERRIDE;
|
||||||
virtual int32_t FilterPorts(uint16_t& rtpFilterPort,
|
virtual int32_t FilterPorts(uint16_t& rtpFilterPort,
|
||||||
uint16_t& rtcpFilterPort) const;
|
uint16_t& rtcpFilterPort) const OVERRIDE;
|
||||||
virtual int32_t StartReceiving(
|
virtual int32_t StartReceiving(
|
||||||
const uint32_t numberOfSocketBuffers);
|
const uint32_t numberOfSocketBuffers) OVERRIDE;
|
||||||
virtual int32_t StopReceiving();
|
virtual int32_t StopReceiving() OVERRIDE;
|
||||||
virtual bool Receiving() const;
|
virtual bool Receiving() const OVERRIDE;
|
||||||
virtual bool SendSocketsInitialized() const;
|
virtual bool SendSocketsInitialized() const OVERRIDE;
|
||||||
virtual bool SourcePortsInitialized() const;
|
virtual bool SourcePortsInitialized() const OVERRIDE;
|
||||||
virtual bool ReceiveSocketsInitialized() const;
|
virtual bool ReceiveSocketsInitialized() const OVERRIDE;
|
||||||
virtual int32_t SendRaw(const int8_t* data,
|
virtual int32_t SendRaw(const int8_t* data,
|
||||||
uint32_t length, int32_t isRTCP,
|
uint32_t length, int32_t isRTCP,
|
||||||
uint16_t portnr = 0,
|
uint16_t portnr = 0,
|
||||||
const char* ip = NULL);
|
const char* ip = NULL) OVERRIDE;
|
||||||
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
||||||
uint32_t length,
|
uint32_t length,
|
||||||
const SocketAddress& to);
|
const SocketAddress& to) OVERRIDE;
|
||||||
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
||||||
uint32_t length,
|
uint32_t length,
|
||||||
const SocketAddress& to);
|
const SocketAddress& to) OVERRIDE;
|
||||||
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
||||||
uint32_t length,
|
uint32_t length,
|
||||||
uint16_t rtpPort);
|
uint16_t rtpPort) OVERRIDE;
|
||||||
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
||||||
uint32_t length,
|
uint32_t length,
|
||||||
uint16_t rtcpPort);
|
uint16_t rtcpPort) OVERRIDE;
|
||||||
// Transport functions
|
// Transport functions
|
||||||
virtual int SendPacket(int channel, const void* data, int length);
|
virtual int SendPacket(int channel, const void* data, int length) OVERRIDE;
|
||||||
virtual int SendRTCPPacket(int channel, const void* data, int length);
|
virtual int SendRTCPPacket(int channel,
|
||||||
|
const void* data,
|
||||||
|
int length) OVERRIDE;
|
||||||
|
|
||||||
// UdpTransport functions continue.
|
// UdpTransport functions continue.
|
||||||
virtual int32_t SetSendIP(const char* ipaddr);
|
virtual int32_t SetSendIP(const char* ipaddr) OVERRIDE;
|
||||||
virtual int32_t SetSendPorts(const uint16_t rtpPort,
|
virtual int32_t SetSendPorts(const uint16_t rtpPort,
|
||||||
const uint16_t rtcpPort = 0);
|
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||||
|
|
||||||
virtual ErrorCode LastError() const;
|
virtual ErrorCode LastError() const OVERRIDE;
|
||||||
|
|
||||||
virtual int32_t IPAddressCached(const SocketAddress& address,
|
virtual int32_t IPAddressCached(const SocketAddress& address,
|
||||||
char* ip,
|
char* ip,
|
||||||
uint32_t& ipSize,
|
uint32_t& ipSize,
|
||||||
uint16_t& sourcePort);
|
uint16_t& sourcePort) OVERRIDE;
|
||||||
|
|
||||||
int32_t Id() const {return _id;}
|
int32_t Id() const {return _id;}
|
||||||
protected:
|
protected:
|
||||||
|
@ -38,3 +38,36 @@ void BitFlipEncryption::FlipSomeBitsInData(const unsigned char* in_data,
|
|||||||
}
|
}
|
||||||
*bytes_out = bytes_in;
|
*bytes_out = bytes_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BitFlipEncryption::encrypt(int channel_no,
|
||||||
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) {
|
||||||
|
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitFlipEncryption::decrypt(int channel_no,
|
||||||
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) {
|
||||||
|
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitFlipEncryption::encrypt_rtcp(int channel_no,
|
||||||
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) {
|
||||||
|
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitFlipEncryption::decrypt_rtcp(int channel_no,
|
||||||
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) {
|
||||||
|
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -23,27 +23,29 @@ class BitFlipEncryption : public webrtc::Encryption {
|
|||||||
// gets flipped in a particular byte.
|
// gets flipped in a particular byte.
|
||||||
BitFlipEncryption(unsigned int rand_seed, float flip_probability);
|
BitFlipEncryption(unsigned int rand_seed, float flip_probability);
|
||||||
|
|
||||||
virtual void encrypt(int channel_no, unsigned char* in_data,
|
virtual void encrypt(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
unsigned char* in_data,
|
||||||
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
unsigned char* out_data,
|
||||||
}
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE;
|
||||||
|
|
||||||
virtual void decrypt(int channel_no, unsigned char* in_data,
|
virtual void decrypt(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
unsigned char* in_data,
|
||||||
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
unsigned char* out_data,
|
||||||
}
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE;
|
||||||
|
|
||||||
virtual void encrypt_rtcp(int channel_no, unsigned char* in_data,
|
virtual void encrypt_rtcp(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in,
|
unsigned char* in_data,
|
||||||
int* bytes_out) {
|
unsigned char* out_data,
|
||||||
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
int bytes_in,
|
||||||
}
|
int* bytes_out) OVERRIDE;
|
||||||
|
|
||||||
virtual void decrypt_rtcp(int channel_no, unsigned char* in_data,
|
virtual void decrypt_rtcp(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in,
|
unsigned char* in_data,
|
||||||
int* bytes_out) {
|
unsigned char* out_data,
|
||||||
FlipSomeBitsInData(in_data, out_data, bytes_in, bytes_out);
|
int bytes_in,
|
||||||
}
|
int* bytes_out) OVERRIDE;
|
||||||
|
|
||||||
int64_t flip_count() const { return flip_count_; }
|
int64_t flip_count() const { return flip_count_; }
|
||||||
|
|
||||||
|
@ -19,31 +19,42 @@ class RandomEncryption : public webrtc::Encryption {
|
|||||||
public:
|
public:
|
||||||
explicit RandomEncryption(unsigned int rand_seed);
|
explicit RandomEncryption(unsigned int rand_seed);
|
||||||
|
|
||||||
virtual void encrypt(int channel_no, unsigned char* in_data,
|
virtual void encrypt(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE {
|
||||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void decrypt(int channel_no, unsigned char* in_data,
|
virtual void decrypt(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
unsigned char* in_data,
|
||||||
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE {
|
||||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void encrypt_rtcp(int channel_no, unsigned char* in_data,
|
virtual void encrypt_rtcp(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in,
|
unsigned char* in_data,
|
||||||
int* bytes_out) {
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE {
|
||||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void decrypt_rtcp(int channel_no, unsigned char* in_data,
|
virtual void decrypt_rtcp(int channel_no,
|
||||||
unsigned char* out_data, int bytes_in,
|
unsigned char* in_data,
|
||||||
int* bytes_out) {
|
unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
|
int* bytes_out) OVERRIDE {
|
||||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Generates some completely random data with roughly the right length.
|
// Generates some completely random data with roughly the right length.
|
||||||
void GenerateRandomData(unsigned char* out_data, int bytes_in,
|
void GenerateRandomData(unsigned char* out_data,
|
||||||
|
int bytes_in,
|
||||||
int* bytes_out);
|
int* bytes_out);
|
||||||
|
|
||||||
// Makes up a length within +- 50 of the original length, without
|
// Makes up a length within +- 50 of the original length, without
|
||||||
|
@ -78,5 +78,8 @@ bool FrameReaderImpl::ReadFrame(uint8_t* source_buffer) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t FrameReaderImpl::FrameLength() { return frame_length_in_bytes_; }
|
||||||
|
int FrameReaderImpl::NumberOfFrames() { return number_of_frames_; }
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -54,11 +54,11 @@ class FrameReaderImpl : public FrameReader {
|
|||||||
// For YUV this is 3 * width * height / 2
|
// For YUV this is 3 * width * height / 2
|
||||||
FrameReaderImpl(std::string input_filename, size_t frame_length_in_bytes);
|
FrameReaderImpl(std::string input_filename, size_t frame_length_in_bytes);
|
||||||
virtual ~FrameReaderImpl();
|
virtual ~FrameReaderImpl();
|
||||||
bool Init();
|
virtual bool Init() OVERRIDE;
|
||||||
bool ReadFrame(uint8_t* source_buffer);
|
virtual bool ReadFrame(uint8_t* source_buffer) OVERRIDE;
|
||||||
void Close();
|
virtual void Close() OVERRIDE;
|
||||||
size_t FrameLength() { return frame_length_in_bytes_; }
|
virtual size_t FrameLength() OVERRIDE;
|
||||||
int NumberOfFrames() { return number_of_frames_; }
|
virtual int NumberOfFrames() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string input_filename_;
|
std::string input_filename_;
|
||||||
|
@ -48,6 +48,8 @@ void FrameWriterImpl::Close() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t FrameWriterImpl::FrameLength() { return frame_length_in_bytes_; }
|
||||||
|
|
||||||
bool FrameWriterImpl::WriteFrame(uint8_t* frame_buffer) {
|
bool FrameWriterImpl::WriteFrame(uint8_t* frame_buffer) {
|
||||||
assert(frame_buffer);
|
assert(frame_buffer);
|
||||||
if (output_file_ == NULL) {
|
if (output_file_ == NULL) {
|
||||||
|
@ -52,10 +52,10 @@ class FrameWriterImpl : public FrameWriter {
|
|||||||
// For YUV: 3*width*height/2
|
// For YUV: 3*width*height/2
|
||||||
FrameWriterImpl(std::string output_filename, size_t frame_length_in_bytes);
|
FrameWriterImpl(std::string output_filename, size_t frame_length_in_bytes);
|
||||||
virtual ~FrameWriterImpl();
|
virtual ~FrameWriterImpl();
|
||||||
bool Init();
|
virtual bool Init() OVERRIDE;
|
||||||
bool WriteFrame(uint8_t* frame_buffer);
|
virtual bool WriteFrame(uint8_t* frame_buffer) OVERRIDE;
|
||||||
void Close();
|
virtual void Close() OVERRIDE;
|
||||||
size_t FrameLength() { return frame_length_in_bytes_; }
|
virtual size_t FrameLength() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string output_filename_;
|
std::string output_filename_;
|
||||||
|
@ -41,6 +41,8 @@ TraceToStderr::~TraceToStderr() {
|
|||||||
Trace::ReturnTrace();
|
Trace::ReturnTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TraceToStderr::SetTimeSeconds(float time) { time_seconds_ = time; }
|
||||||
|
|
||||||
void TraceToStderr::Print(TraceLevel level, const char* msg_array, int length) {
|
void TraceToStderr::Print(TraceLevel level, const char* msg_array, int length) {
|
||||||
if (level & kLevelFilter) {
|
if (level & kLevelFilter) {
|
||||||
assert(length > Trace::kBoilerplateLength);
|
assert(length > Trace::kBoilerplateLength);
|
||||||
|
@ -36,10 +36,12 @@ class TraceToStderr : public TraceCallback {
|
|||||||
// No attempt is made to ensure thread-safety between the trace writing and
|
// No attempt is made to ensure thread-safety between the trace writing and
|
||||||
// time updating. In tests, since traces will normally be triggered by the
|
// time updating. In tests, since traces will normally be triggered by the
|
||||||
// main thread doing the time updating, this should be of no concern.
|
// main thread doing the time updating, this should be of no concern.
|
||||||
virtual void SetTimeSeconds(float time) { time_seconds_ = time; }
|
virtual void SetTimeSeconds(float time);
|
||||||
|
|
||||||
// Implements TraceCallback.
|
// Implements TraceCallback.
|
||||||
virtual void Print(TraceLevel level, const char* msg_array, int length);
|
virtual void Print(TraceLevel level,
|
||||||
|
const char* msg_array,
|
||||||
|
int length) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool override_time_;
|
bool override_time_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user