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();
|
||||
|
||||
// Start implementation of UdpTransportData.
|
||||
void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
||||
const int32_t packet_length,
|
||||
const char* /*from_ip*/,
|
||||
const uint16_t /*from_port*/);
|
||||
virtual void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
|
||||
const int32_t packet_length,
|
||||
const char* /*from_ip*/,
|
||||
const uint16_t /*from_port*/) OVERRIDE;
|
||||
|
||||
void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
||||
const int32_t packet_length,
|
||||
const char* /*from_ip*/,
|
||||
const uint16_t /*from_port*/);
|
||||
virtual void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
|
||||
const int32_t packet_length,
|
||||
const char* /*from_ip*/,
|
||||
const uint16_t /*from_port*/) OVERRIDE;
|
||||
// End implementation of UdpTransportData.
|
||||
|
||||
// Specifies the ports to receive RTP packets on.
|
||||
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);
|
||||
|
||||
private:
|
||||
@ -59,21 +59,21 @@ class VideoChannelTransport : public UdpTransportData {
|
||||
virtual ~VideoChannelTransport();
|
||||
|
||||
// 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 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 char* /*from_ip*/,
|
||||
const uint16_t /*from_port*/);
|
||||
const uint16_t /*from_port*/) OVERRIDE;
|
||||
// End implementation of UdpTransportData.
|
||||
|
||||
// Specifies the ports to receive RTP packets on.
|
||||
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);
|
||||
|
||||
private:
|
||||
|
@ -36,15 +36,15 @@ public:
|
||||
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 Stop();
|
||||
virtual bool Start() OVERRIDE;
|
||||
virtual bool Stop() OVERRIDE;
|
||||
|
||||
virtual bool AddSocket(UdpSocketWrapper* s);
|
||||
virtual bool RemoveSocket(UdpSocketWrapper* s);
|
||||
virtual bool AddSocket(UdpSocketWrapper* s) OVERRIDE;
|
||||
virtual bool RemoveSocket(UdpSocketWrapper* s) OVERRIDE;
|
||||
private:
|
||||
int32_t _id;
|
||||
CriticalSectionWrapper* _critSect;
|
||||
|
@ -173,11 +173,25 @@ int32_t UdpSocketPosix::SendTo(const int8_t* buf, int32_t len,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
SOCKET UdpSocketPosix::GetFd() { return _socket; }
|
||||
int32_t UdpSocketPosix::GetError() { return _error; }
|
||||
|
||||
bool UdpSocketPosix::ValidHandle()
|
||||
{
|
||||
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()
|
||||
{
|
||||
// replace 2048 with a mcro define and figure out
|
||||
@ -221,6 +235,8 @@ void UdpSocketPosix::HasIncoming()
|
||||
}
|
||||
}
|
||||
|
||||
bool UdpSocketPosix::WantsIncoming() { return _wantsIncoming; }
|
||||
|
||||
void UdpSocketPosix::CloseBlocking()
|
||||
{
|
||||
_cs->Enter();
|
||||
|
@ -33,28 +33,29 @@ public:
|
||||
|
||||
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,
|
||||
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,
|
||||
const SocketAddress& to);
|
||||
const SocketAddress& to) OVERRIDE;
|
||||
|
||||
// Deletes socket in addition to closing it.
|
||||
// TODO (hellner): make destructor protected.
|
||||
virtual void CloseBlocking();
|
||||
virtual void CloseBlocking() OVERRIDE;
|
||||
|
||||
virtual SOCKET GetFd() {return _socket;}
|
||||
virtual int32_t GetError() {return _error;}
|
||||
virtual SOCKET GetFd();
|
||||
virtual int32_t GetError();
|
||||
|
||||
virtual bool ValidHandle();
|
||||
virtual bool ValidHandle() OVERRIDE;
|
||||
|
||||
virtual bool SetQos(int32_t /*serviceType*/,
|
||||
int32_t /*tokenRate*/,
|
||||
@ -63,11 +64,11 @@ public:
|
||||
int32_t /*minPolicedSize*/,
|
||||
int32_t /*maxSduSize*/,
|
||||
const SocketAddress& /*stRemName*/,
|
||||
int32_t /*overrideDSCP*/) {return false;}
|
||||
int32_t /*overrideDSCP*/) OVERRIDE;
|
||||
|
||||
bool CleanUp();
|
||||
void HasIncoming();
|
||||
bool WantsIncoming() {return _wantsIncoming;}
|
||||
bool WantsIncoming();
|
||||
void ReadyForDeletion();
|
||||
private:
|
||||
friend class UdpSocketManagerPosix;
|
||||
|
@ -141,11 +141,19 @@ bool UdpSocketWrapper::StartReceiving()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UdpSocketWrapper::StartReceiving(const uint32_t /*receiveBuffers*/) {
|
||||
return StartReceiving();
|
||||
}
|
||||
|
||||
bool UdpSocketWrapper::StopReceiving()
|
||||
{
|
||||
_wantsIncoming = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t UdpSocketWrapper::SetPCP(const int32_t /*pcp*/) { return -1; }
|
||||
|
||||
uint32_t UdpSocketWrapper::ReceiveBuffers() { return 0; }
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
@ -62,8 +62,7 @@ public:
|
||||
|
||||
// Start receiving UDP data.
|
||||
virtual bool StartReceiving();
|
||||
virtual inline bool StartReceiving(const uint32_t /*receiveBuffers*/)
|
||||
{return StartReceiving();}
|
||||
virtual bool StartReceiving(const uint32_t /*receiveBuffers*/);
|
||||
// Stop receiving UDP data.
|
||||
virtual bool StopReceiving();
|
||||
|
||||
@ -77,7 +76,7 @@ public:
|
||||
virtual int32_t SetTOS(const int32_t serviceType) = 0;
|
||||
|
||||
// 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.
|
||||
virtual int32_t SendTo(const int8_t* buf, int32_t len,
|
||||
@ -95,7 +94,7 @@ public:
|
||||
const SocketAddress &stRemName,
|
||||
int32_t overrideDSCP = 0) = 0;
|
||||
|
||||
virtual uint32_t ReceiveBuffers() {return 0;};
|
||||
virtual uint32_t ReceiveBuffers();
|
||||
|
||||
protected:
|
||||
// Creating the socket is done via CreateSocket().
|
||||
|
@ -68,12 +68,12 @@ namespace test {
|
||||
|
||||
class SocketFactory : public UdpTransportImpl::SocketFactoryInterface {
|
||||
public:
|
||||
UdpSocketWrapper* CreateSocket(const int32_t id,
|
||||
virtual UdpSocketWrapper* CreateSocket(const int32_t id,
|
||||
UdpSocketManager* mgr,
|
||||
CallbackObj obj,
|
||||
IncomingSocketCallback cb,
|
||||
bool ipV6Enable,
|
||||
bool disableGQOS) {
|
||||
bool disableGQOS) OVERRIDE {
|
||||
return UdpSocketWrapper::CreateSocket(id, mgr, obj, cb, ipV6Enable,
|
||||
disableGQOS);
|
||||
}
|
||||
|
@ -50,90 +50,93 @@ public:
|
||||
virtual int32_t InitializeSendSockets(
|
||||
const char* ipAddr,
|
||||
const uint16_t rtpPort,
|
||||
const uint16_t rtcpPort = 0);
|
||||
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||
virtual int32_t InitializeReceiveSockets(
|
||||
UdpTransportData* const packetCallback,
|
||||
const uint16_t rtpPort,
|
||||
const char* ipAddr = NULL,
|
||||
const char* multicastIpAddr = NULL,
|
||||
const uint16_t rtcpPort = 0);
|
||||
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||
virtual int32_t InitializeSourcePorts(
|
||||
const uint16_t rtpPort,
|
||||
const uint16_t rtcpPort = 0);
|
||||
virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const;
|
||||
const uint16_t rtcpPort = 0) OVERRIDE;
|
||||
virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const
|
||||
OVERRIDE;
|
||||
virtual int32_t ReceiveSocketInformation(
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
uint16_t& rtpPort,
|
||||
uint16_t& rtcpPort,
|
||||
char multicastIpAddr[kIpAddressVersion6Length]) const;
|
||||
char multicastIpAddr[kIpAddressVersion6Length]) const OVERRIDE;
|
||||
virtual int32_t SendSocketInformation(
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
uint16_t& rtpPort,
|
||||
uint16_t& rtcpPort) const;
|
||||
uint16_t& rtcpPort) const OVERRIDE;
|
||||
virtual int32_t RemoteSocketInformation(
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
uint16_t& rtpPort,
|
||||
uint16_t& rtcpPort) const;
|
||||
uint16_t& rtcpPort) const OVERRIDE;
|
||||
virtual int32_t SetQoS(const bool QoS,
|
||||
const int32_t serviceType,
|
||||
const uint32_t maxBitrate = 0,
|
||||
const int32_t overrideDSCP = 0,
|
||||
const bool audio = false);
|
||||
const bool audio = false) OVERRIDE;
|
||||
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,
|
||||
const bool useSetSockOpt = false);
|
||||
virtual int32_t ToS(int32_t& DSCP, bool& useSetSockOpt) const;
|
||||
virtual int32_t SetPCP(const int32_t PCP);
|
||||
virtual int32_t PCP(int32_t& PCP) const;
|
||||
virtual int32_t EnableIpV6();
|
||||
virtual bool IpV6Enabled() const;
|
||||
const bool useSetSockOpt = false) OVERRIDE;
|
||||
virtual int32_t ToS(int32_t& DSCP, bool& useSetSockOpt) const OVERRIDE;
|
||||
virtual int32_t SetPCP(const int32_t PCP) OVERRIDE;
|
||||
virtual int32_t PCP(int32_t& PCP) const OVERRIDE;
|
||||
virtual int32_t EnableIpV6() OVERRIDE;
|
||||
virtual bool IpV6Enabled() const OVERRIDE;
|
||||
virtual int32_t SetFilterIP(
|
||||
const char filterIPAddress[kIpAddressVersion6Length]);
|
||||
const char filterIPAddress[kIpAddressVersion6Length]) OVERRIDE;
|
||||
virtual int32_t FilterIP(
|
||||
char filterIPAddress[kIpAddressVersion6Length]) const;
|
||||
char filterIPAddress[kIpAddressVersion6Length]) const OVERRIDE;
|
||||
virtual int32_t SetFilterPorts(const uint16_t rtpFilterPort,
|
||||
const uint16_t rtcpFilterPort);
|
||||
const uint16_t rtcpFilterPort) OVERRIDE;
|
||||
virtual int32_t FilterPorts(uint16_t& rtpFilterPort,
|
||||
uint16_t& rtcpFilterPort) const;
|
||||
uint16_t& rtcpFilterPort) const OVERRIDE;
|
||||
virtual int32_t StartReceiving(
|
||||
const uint32_t numberOfSocketBuffers);
|
||||
virtual int32_t StopReceiving();
|
||||
virtual bool Receiving() const;
|
||||
virtual bool SendSocketsInitialized() const;
|
||||
virtual bool SourcePortsInitialized() const;
|
||||
virtual bool ReceiveSocketsInitialized() const;
|
||||
const uint32_t numberOfSocketBuffers) OVERRIDE;
|
||||
virtual int32_t StopReceiving() OVERRIDE;
|
||||
virtual bool Receiving() const OVERRIDE;
|
||||
virtual bool SendSocketsInitialized() const OVERRIDE;
|
||||
virtual bool SourcePortsInitialized() const OVERRIDE;
|
||||
virtual bool ReceiveSocketsInitialized() const OVERRIDE;
|
||||
virtual int32_t SendRaw(const int8_t* data,
|
||||
uint32_t length, int32_t isRTCP,
|
||||
uint16_t portnr = 0,
|
||||
const char* ip = NULL);
|
||||
const char* ip = NULL) OVERRIDE;
|
||||
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
||||
uint32_t length,
|
||||
const SocketAddress& to);
|
||||
const SocketAddress& to) OVERRIDE;
|
||||
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
||||
uint32_t length,
|
||||
const SocketAddress& to);
|
||||
const SocketAddress& to) OVERRIDE;
|
||||
virtual int32_t SendRTPPacketTo(const int8_t *data,
|
||||
uint32_t length,
|
||||
uint16_t rtpPort);
|
||||
uint16_t rtpPort) OVERRIDE;
|
||||
virtual int32_t SendRTCPPacketTo(const int8_t *data,
|
||||
uint32_t length,
|
||||
uint16_t rtcpPort);
|
||||
uint16_t rtcpPort) OVERRIDE;
|
||||
// Transport functions
|
||||
virtual int SendPacket(int channel, const void* data, int length);
|
||||
virtual int SendRTCPPacket(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) OVERRIDE;
|
||||
|
||||
// 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,
|
||||
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,
|
||||
char* ip,
|
||||
uint32_t& ipSize,
|
||||
uint16_t& sourcePort);
|
||||
uint16_t& sourcePort) OVERRIDE;
|
||||
|
||||
int32_t Id() const {return _id;}
|
||||
protected:
|
||||
|
@ -38,3 +38,36 @@ void BitFlipEncryption::FlipSomeBitsInData(const unsigned char* in_data,
|
||||
}
|
||||
*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.
|
||||
BitFlipEncryption(unsigned int rand_seed, float flip_probability);
|
||||
|
||||
virtual void 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);
|
||||
}
|
||||
virtual void encrypt(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE;
|
||||
|
||||
virtual void 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);
|
||||
}
|
||||
virtual void decrypt(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE;
|
||||
|
||||
virtual void 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);
|
||||
}
|
||||
virtual void encrypt_rtcp(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE;
|
||||
|
||||
virtual void 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);
|
||||
}
|
||||
virtual void decrypt_rtcp(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE;
|
||||
|
||||
int64_t flip_count() const { return flip_count_; }
|
||||
|
||||
|
@ -19,31 +19,42 @@ class RandomEncryption : public webrtc::Encryption {
|
||||
public:
|
||||
explicit RandomEncryption(unsigned int rand_seed);
|
||||
|
||||
virtual void encrypt(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
||||
virtual void encrypt(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE {
|
||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||
}
|
||||
|
||||
virtual void decrypt(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in, int* bytes_out) {
|
||||
virtual void decrypt(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE {
|
||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||
}
|
||||
|
||||
virtual void encrypt_rtcp(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in,
|
||||
int* bytes_out) {
|
||||
virtual void encrypt_rtcp(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE {
|
||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||
}
|
||||
|
||||
virtual void decrypt_rtcp(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in,
|
||||
int* bytes_out) {
|
||||
virtual void decrypt_rtcp(int channel_no,
|
||||
unsigned char* in_data,
|
||||
unsigned char* out_data,
|
||||
int bytes_in,
|
||||
int* bytes_out) OVERRIDE {
|
||||
GenerateRandomData(out_data, bytes_in, bytes_out);
|
||||
}
|
||||
|
||||
private:
|
||||
// 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);
|
||||
|
||||
// Makes up a length within +- 50 of the original length, without
|
||||
|
@ -78,5 +78,8 @@ bool FrameReaderImpl::ReadFrame(uint8_t* source_buffer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t FrameReaderImpl::FrameLength() { return frame_length_in_bytes_; }
|
||||
int FrameReaderImpl::NumberOfFrames() { return number_of_frames_; }
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
@ -54,11 +54,11 @@ class FrameReaderImpl : public FrameReader {
|
||||
// For YUV this is 3 * width * height / 2
|
||||
FrameReaderImpl(std::string input_filename, size_t frame_length_in_bytes);
|
||||
virtual ~FrameReaderImpl();
|
||||
bool Init();
|
||||
bool ReadFrame(uint8_t* source_buffer);
|
||||
void Close();
|
||||
size_t FrameLength() { return frame_length_in_bytes_; }
|
||||
int NumberOfFrames() { return number_of_frames_; }
|
||||
virtual bool Init() OVERRIDE;
|
||||
virtual bool ReadFrame(uint8_t* source_buffer) OVERRIDE;
|
||||
virtual void Close() OVERRIDE;
|
||||
virtual size_t FrameLength() OVERRIDE;
|
||||
virtual int NumberOfFrames() OVERRIDE;
|
||||
|
||||
private:
|
||||
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) {
|
||||
assert(frame_buffer);
|
||||
if (output_file_ == NULL) {
|
||||
|
@ -52,10 +52,10 @@ class FrameWriterImpl : public FrameWriter {
|
||||
// For YUV: 3*width*height/2
|
||||
FrameWriterImpl(std::string output_filename, size_t frame_length_in_bytes);
|
||||
virtual ~FrameWriterImpl();
|
||||
bool Init();
|
||||
bool WriteFrame(uint8_t* frame_buffer);
|
||||
void Close();
|
||||
size_t FrameLength() { return frame_length_in_bytes_; }
|
||||
virtual bool Init() OVERRIDE;
|
||||
virtual bool WriteFrame(uint8_t* frame_buffer) OVERRIDE;
|
||||
virtual void Close() OVERRIDE;
|
||||
virtual size_t FrameLength() OVERRIDE;
|
||||
|
||||
private:
|
||||
std::string output_filename_;
|
||||
|
@ -41,6 +41,8 @@ TraceToStderr::~TraceToStderr() {
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
void TraceToStderr::SetTimeSeconds(float time) { time_seconds_ = time; }
|
||||
|
||||
void TraceToStderr::Print(TraceLevel level, const char* msg_array, int length) {
|
||||
if (level & kLevelFilter) {
|
||||
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
|
||||
// time updating. In tests, since traces will normally be triggered by the
|
||||
// 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.
|
||||
virtual void Print(TraceLevel level, const char* msg_array, int length);
|
||||
virtual void Print(TraceLevel level,
|
||||
const char* msg_array,
|
||||
int length) OVERRIDE;
|
||||
|
||||
private:
|
||||
bool override_time_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user