Cleanup messy data type of unknown_payload_type

BUG=322
TEST=build on all platforms
Review URL: https://webrtc-codereview.appspot.com/430002

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1848 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-03-06 20:59:13 +00:00
parent 8b111eb3e6
commit 0975d2158c
19 changed files with 72 additions and 56 deletions

View File

@ -377,7 +377,7 @@ public:
*/
virtual WebRtc_Word32 SetRTPKeepaliveStatus(
const bool enable,
const WebRtc_Word8 unknownPayloadType,
const int unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS) = 0;
/*
@ -391,7 +391,7 @@ public:
*/
virtual WebRtc_Word32 RTPKeepaliveStatus(
bool* enable,
WebRtc_Word8* unknownPayloadType,
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const = 0;
/*

View File

@ -77,7 +77,10 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_METHOD2(IncomingPacket,
WebRtc_Word32(const WebRtc_UWord8* incomingPacket, const WebRtc_UWord16 packetLength));
MOCK_METHOD4(IncomingAudioNTP,
WebRtc_Word32(const WebRtc_UWord32 audioReceivedNTPsecs, const WebRtc_UWord32 audioReceivedNTPfrac, const WebRtc_UWord32 audioRTCPArrivalTimeSecs, const WebRtc_UWord32 audioRTCPArrivalTimeFrac));
WebRtc_Word32(const WebRtc_UWord32 audioReceivedNTPsecs,
const WebRtc_UWord32 audioReceivedNTPfrac,
const WebRtc_UWord32 audioRTCPArrivalTimeSecs,
const WebRtc_UWord32 audioRTCPArrivalTimeFrac));
MOCK_METHOD0(InitSender,
WebRtc_Word32());
MOCK_METHOD1(RegisterSendTransport,
@ -85,15 +88,20 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_METHOD1(SetMaxTransferUnit,
WebRtc_Word32(const WebRtc_UWord16 size));
MOCK_METHOD3(SetTransportOverhead,
WebRtc_Word32(const bool TCP, const bool IPV6, const WebRtc_UWord8 authenticationOverhead));
WebRtc_Word32(const bool TCP, const bool IPV6,
const WebRtc_UWord8 authenticationOverhead));
MOCK_CONST_METHOD0(MaxPayloadLength,
WebRtc_UWord16());
MOCK_CONST_METHOD0(MaxDataPayloadLength,
WebRtc_UWord16());
MOCK_METHOD3(SetRTPKeepaliveStatus,
WebRtc_Word32(const bool enable, const WebRtc_Word8 unknownPayloadType, const WebRtc_UWord16 deltaTransmitTimeMS));
WebRtc_Word32(const bool enable,
const int unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS));
MOCK_CONST_METHOD3(RTPKeepaliveStatus,
WebRtc_Word32(bool* enable, WebRtc_Word8* unknownPayloadType, WebRtc_UWord16* deltaTransmitTimeMS));
WebRtc_Word32(bool* enable,
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS));
MOCK_CONST_METHOD0(RTPKeepalive,
bool());
MOCK_METHOD1(RegisterSendPayload,
@ -147,7 +155,13 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_CONST_METHOD1(EstimatedReceiveBandwidth,
int(WebRtc_UWord32* available_bandwidth));
MOCK_METHOD7(SendOutgoingData,
WebRtc_Word32(const FrameType frameType, const WebRtc_Word8 payloadType, const WebRtc_UWord32 timeStamp, const WebRtc_UWord8* payloadData, const WebRtc_UWord32 payloadSize, const RTPFragmentationHeader* fragmentation, const RTPVideoHeader* rtpVideoHdr));
WebRtc_Word32(const FrameType frameType,
const WebRtc_Word8 payloadType,
const WebRtc_UWord32 timeStamp,
const WebRtc_UWord8* payloadData,
const WebRtc_UWord32 payloadSize,
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* rtpVideoHdr));
MOCK_METHOD1(RegisterIncomingRTCPCallback,
WebRtc_Word32(RtcpFeedback* incomingMessagesCallback));
MOCK_CONST_METHOD0(RTCP,
@ -164,7 +178,8 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_CONST_METHOD4(RemoteNTP,
WebRtc_Word32(WebRtc_UWord32 *ReceivedNTPsecs, WebRtc_UWord32 *ReceivedNTPfrac, WebRtc_UWord32 *RTCPArrivalTimeSecs, WebRtc_UWord32 *RTCPArrivalTimeFrac));
MOCK_METHOD2(AddMixedCNAME,
WebRtc_Word32(const WebRtc_UWord32 SSRC, const WebRtc_Word8 cName[RTCP_CNAME_SIZE]));
WebRtc_Word32(const WebRtc_UWord32 SSRC,
const char cName[RTCP_CNAME_SIZE]));
MOCK_METHOD1(RemoveMixedCNAME,
WebRtc_Word32(const WebRtc_UWord32 SSRC));
MOCK_CONST_METHOD5(RTT,

View File

@ -870,7 +870,7 @@ bool ModuleRtpRtcpImpl::RTPKeepalive() const {
WebRtc_Word32 ModuleRtpRtcpImpl::RTPKeepaliveStatus(
bool* enable,
WebRtc_Word8* unknownPayloadType,
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceRtpRtcp, _id, "RTPKeepaliveStatus()");
@ -881,7 +881,7 @@ WebRtc_Word32 ModuleRtpRtcpImpl::RTPKeepaliveStatus(
WebRtc_Word32 ModuleRtpRtcpImpl::SetRTPKeepaliveStatus(
bool enable,
WebRtc_Word8 unknownPayloadType,
const int unknownPayloadType,
WebRtc_UWord16 deltaTransmitTimeMS) {
if (enable) {
WEBRTC_TRACE(

View File

@ -148,13 +148,15 @@ public:
*/
virtual WebRtc_Word32 InitSender();
virtual WebRtc_Word32 SetRTPKeepaliveStatus(const bool enable,
const WebRtc_Word8 unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS);
virtual WebRtc_Word32 SetRTPKeepaliveStatus(
const bool enable,
const int unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS);
virtual WebRtc_Word32 RTPKeepaliveStatus(bool* enable,
WebRtc_Word8* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const;
virtual WebRtc_Word32 RTPKeepaliveStatus(
bool* enable,
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const;
virtual bool RTPKeepalive() const;

View File

@ -361,7 +361,7 @@ RTPSender::RTPKeepalive() const
WebRtc_Word32
RTPSender::RTPKeepaliveStatus(bool* enable,
WebRtc_Word8* unknownPayloadType,
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const
{
CriticalSectionScoped cs(_sendCritsect);
@ -382,7 +382,7 @@ RTPSender::RTPKeepaliveStatus(bool* enable,
}
WebRtc_Word32 RTPSender::EnableRTPKeepalive(
const WebRtc_Word8 unknownPayloadType,
const int unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS) {
CriticalSectionScoped cs(_sendCritsect);

View File

@ -199,12 +199,12 @@ public:
/*
* Keep alive
*/
WebRtc_Word32 EnableRTPKeepalive( const WebRtc_Word8 unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS);
WebRtc_Word32 EnableRTPKeepalive( const int unknownPayloadType,
const WebRtc_UWord16 deltaTransmitTimeMS);
WebRtc_Word32 RTPKeepaliveStatus(bool* enable,
WebRtc_Word8* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const;
int* unknownPayloadType,
WebRtc_UWord16* deltaTransmitTimeMS) const;
WebRtc_Word32 DisableRTPKeepalive();

View File

@ -263,7 +263,7 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
virtual int SetRTPKeepAliveStatus(
const int video_channel,
bool enable,
const char unknown_payload_type,
const int unknown_payload_type,
const unsigned int delta_transmit_time_seconds =
KDefaultDeltaTransmitTimeSeconds) = 0;
@ -271,7 +271,7 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
virtual int GetRTPKeepAliveStatus(
const int video_channel,
bool& enabled,
char& unkown_payload_type,
int& unkown_payload_type,
unsigned int& delta_transmit_time_seconds) const = 0;
// This function enables capturing of RTP packets to a binary file on a

View File

@ -661,10 +661,10 @@ void ViEAutoTest::ViERtpRtcpAPITest()
// RTP Keepalive
//
{
char setPT = 123;
int setPT = 123;
unsigned int setDeltaTime = 10;
bool enabled = false;
char getPT = 0;
int getPT = 0;
unsigned int getDeltaTime = 0;
EXPECT_EQ(0, ViE.rtp_rtcp->SetRTPKeepAliveStatus(
tbChannel.videoChannel, true, 119));

View File

@ -1058,7 +1058,7 @@ int ViEChannel::GetEstimatedReceiveBandwidth(
WebRtc_Word32 ViEChannel::SetKeepAliveStatus(
const bool enable,
const WebRtc_Word8 unknown_payload_type,
const int unknown_payload_type,
const WebRtc_UWord16 delta_transmit_timeMS) {
WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_),
"%s", __FUNCTION__);
@ -1109,7 +1109,7 @@ WebRtc_Word32 ViEChannel::SetKeepAliveStatus(
WebRtc_Word32 ViEChannel::GetKeepAliveStatus(
bool& enabled,
WebRtc_Word8& unknown_payload_type,
int& unknown_payload_type,
WebRtc_UWord16& delta_transmit_time_ms) {
WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s",
__FUNCTION__);

View File

@ -164,10 +164,10 @@ class ViEChannel
WebRtc_UWord32& nackBitrateSent) const;
int GetEstimatedReceiveBandwidth(WebRtc_UWord32* estimated_bandwidth) const;
WebRtc_Word32 SetKeepAliveStatus(const bool enable,
const WebRtc_Word8 unknown_payload_type,
const int unknown_payload_type,
const WebRtc_UWord16 delta_transmit_timeMS);
WebRtc_Word32 GetKeepAliveStatus(bool& enable,
WebRtc_Word8& unknown_payload_type,
int& unknown_payload_type,
WebRtc_UWord16& delta_transmit_timeMS);
WebRtc_Word32 StartRTPDump(const char file_nameUTF8[1024],
RTPDirections direction);

View File

@ -770,7 +770,7 @@ int ViERTP_RTCPImpl::GetEstimatedReceiveBandwidth(
int ViERTP_RTCPImpl::SetRTPKeepAliveStatus(
const int video_channel,
bool enable,
const char unknown_payload_type,
const int unknown_payload_type,
const unsigned int delta_transmit_time_seconds) {
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
ViEId(shared_data_->instance_id(), video_channel),
@ -801,7 +801,7 @@ int ViERTP_RTCPImpl::SetRTPKeepAliveStatus(
int ViERTP_RTCPImpl::GetRTPKeepAliveStatus(
const int video_channel,
bool& enabled,
char& unknown_payload_type,
int& unknown_payload_type,
unsigned int& delta_transmit_time_seconds) const {
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
ViEId(shared_data_->instance_id(), video_channel),

View File

@ -96,12 +96,12 @@ class ViERTP_RTCPImpl
virtual int SetRTPKeepAliveStatus(
const int video_channel,
bool enable,
const char unknown_payload_type,
const int unknown_payload_type,
const unsigned int delta_transmit_time_seconds);
virtual int GetRTPKeepAliveStatus(
const int video_channel,
bool& enabled,
char& unkown_payload_type,
int& unkown_payload_type,
unsigned int& delta_transmit_time_seconds) const;
virtual int StartRTPDump(const int video_channel,
const char file_nameUTF8[1024],

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -191,12 +191,12 @@ public:
// This functionality can maintain an existing Network Address Translator
// (NAT) mapping while regular RTP is no longer transmitted.
virtual int SetRTPKeepaliveStatus(
int channel, bool enable, unsigned char unknownPayloadType,
int channel, bool enable, int unknownPayloadType,
int deltaTransmitTimeSeconds = 15) = 0;
// Gets the RTP keepalive mechanism status.
virtual int GetRTPKeepaliveStatus(
int channel, bool& enabled, unsigned char& unknownPayloadType,
int channel, bool& enabled, int& unknownPayloadType,
int& deltaTransmitTimeSeconds) = 0;
// Enables capturing of RTP packets to a binary file on a specific

View File

@ -5646,7 +5646,7 @@ Channel::GetFECStatus(bool& enabled, int& redPayloadtype)
int
Channel::SetRTPKeepaliveStatus(bool enable,
unsigned char unknownPayloadType,
int unknownPayloadType,
int deltaTransmitTimeSeconds)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
@ -5673,11 +5673,11 @@ Channel::SetRTPKeepaliveStatus(bool enable,
int
Channel::GetRTPKeepaliveStatus(bool& enabled,
unsigned char& unknownPayloadType,
int& unknownPayloadType,
int& deltaTransmitTimeSeconds)
{
bool onOff(false);
WebRtc_Word8 payloadType(0);
int payloadType(0);
WebRtc_UWord16 deltaTransmitTimeMS(0);
if (_rtpRtcpModule.RTPKeepaliveStatus(&onOff, &payloadType,
&deltaTransmitTimeMS) != 0)

View File

@ -343,9 +343,9 @@ public:
int GetRTPStatistics(CallStatistics& stats);
int SetFECStatus(bool enable, int redPayloadtype);
int GetFECStatus(bool& enabled, int& redPayloadtype);
int SetRTPKeepaliveStatus(bool enable, unsigned char unknownPayloadType,
int SetRTPKeepaliveStatus(bool enable, int unknownPayloadType,
int deltaTransmitTimeSeconds);
int GetRTPKeepaliveStatus(bool& enabled, unsigned char& unknownPayloadType,
int GetRTPKeepaliveStatus(bool& enabled, int& unknownPayloadType,
int& deltaTransmitTimeSeconds);
int StartRTPDump(const char fileNameUTF8[1024], RTPDirections direction);
int StopRTPDump(RTPDirections direction);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -575,7 +575,7 @@ int VoERTP_RTCPImpl::GetFECStatus(int channel,
int VoERTP_RTCPImpl::SetRTPKeepaliveStatus(int channel,
bool enable,
unsigned char unknownPayloadType,
int unknownPayloadType,
int deltaTransmitTimeSeconds)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1),
@ -603,7 +603,7 @@ int VoERTP_RTCPImpl::SetRTPKeepaliveStatus(int channel,
int VoERTP_RTCPImpl::GetRTPKeepaliveStatus(int channel,
bool& enabled,
unsigned char& unknownPayloadType,
int& unknownPayloadType,
int& deltaTransmitTimeSeconds)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1),

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -90,12 +90,12 @@ public:
// RTP keepalive mechanism (maintains NAT mappings associated to RTP flows)
virtual int SetRTPKeepaliveStatus(int channel,
bool enable,
unsigned char unknownPayloadType,
int unknownPayloadType,
int deltaTransmitTimeSeconds = 15);
virtual int GetRTPKeepaliveStatus(int channel,
bool& enabled,
unsigned char& unknownPayloadType,
int& unknownPayloadType,
int& deltaTransmitTimeSeconds);
// FEC

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -43,7 +43,7 @@ TEST_F(RtpRtcpBeforeStreamingTest,
}
TEST_F(RtpRtcpBeforeStreamingTest, RtpKeepAliveStatusIsOffByDefault) {
unsigned char payload_type;
int payload_type;
int delta_seconds;
bool on;
@ -56,7 +56,7 @@ TEST_F(RtpRtcpBeforeStreamingTest, RtpKeepAliveStatusIsOffByDefault) {
}
TEST_F(RtpRtcpBeforeStreamingTest, SetRtpKeepAliveDealsWithInvalidParameters) {
unsigned char payload_type;
int payload_type;
int delta_seconds;
bool on;
@ -90,7 +90,7 @@ TEST_F(RtpRtcpBeforeStreamingTest,
EXPECT_EQ(0, voe_rtp_rtcp_->SetRTPKeepaliveStatus(
channel_, true, 1));
unsigned char payload_type;
int payload_type;
int delta_seconds;
bool on;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -7149,7 +7149,7 @@ int VoEExtendedTest::TestRTP_RTCP() {
ANL();
TEST(GetRTPKeepaliveStatus);
unsigned char pt;
int pt;
int dT;
TEST_MUSTPASS(!rtp_rtcp->GetRTPKeepaliveStatus(-1, enabled, pt, dT));
MARK();
@ -7609,8 +7609,7 @@ int VoEExtendedTest::TestVolumeControl()
TEST_MUSTPASS(voe_base_->Init());
TEST_MUSTPASS(voe_base_->CreateChannel());
#if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE) && \
!defined(WEBRTC_ANDROID)))
#if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE)))
#if defined(_WIN32)
TEST_MUSTPASS(hardware->SetRecordingDevice(-1));
TEST_MUSTPASS(hardware->SetPlayoutDevice(-1));