Add -Werror and -Wextra to the Linux build.
Includes all fixes required for -Wextra. Review URL: http://webrtc-codereview.appspot.com/117006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@410 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
9139fddf0e
commit
f81f9f8c2a
@ -36,10 +36,10 @@
|
|||||||
'C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses/',
|
'C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses/',
|
||||||
}],
|
}],
|
||||||
['build_with_chromium==1', {
|
['build_with_chromium==1', {
|
||||||
# Exclude pulse audio on Chromium since its prerequisites don't
|
# Exclude pulse audio on Chromium since its prerequisites don't require
|
||||||
# include pulse audio.
|
# pulse audio.
|
||||||
'include_pulse_audio%': 0,
|
'include_pulse_audio%': 0,
|
||||||
# Exclude internal ADM since chrome uses its own IO handling.
|
# Exclude internal ADM since Chromium uses its own IO handling.
|
||||||
'include_internal_audio_device%': 0,
|
'include_internal_audio_device%': 0,
|
||||||
}, {
|
}, {
|
||||||
'include_pulse_audio%': 1,
|
'include_pulse_audio%': 1,
|
||||||
@ -90,6 +90,16 @@
|
|||||||
'defines': [
|
'defines': [
|
||||||
'WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER',
|
'WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER',
|
||||||
],
|
],
|
||||||
|
}, {
|
||||||
|
# Add more stringent warnings to the standalone build than
|
||||||
|
# provided by the Chromium common.gypi.
|
||||||
|
'conditions': [
|
||||||
|
['OS=="linux"', {
|
||||||
|
'cflags': [
|
||||||
|
'-Wextra',
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
], # conditions
|
], # conditions
|
||||||
|
|
||||||
@ -98,11 +108,6 @@
|
|||||||
# TODO(ajm): This block disables some warnings from the chromium_code
|
# TODO(ajm): This block disables some warnings from the chromium_code
|
||||||
# configuration. Remove when possible.
|
# configuration. Remove when possible.
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['OS=="linux"', {
|
|
||||||
'cflags!': [
|
|
||||||
'-Werror',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
['OS=="mac"', {
|
['OS=="mac"', {
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
|
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
|
||||||
|
@ -39,13 +39,18 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
static const WebRtc_UWord32 kAvifHasindex = 0x00000010;
|
static const WebRtc_UWord32 kAvifHasindex = 0x00000010;
|
||||||
static const WebRtc_UWord32 kAvifMustuseindex = 0x00000020;
|
static const WebRtc_UWord32 kAvifMustuseindex = 0x00000020;
|
||||||
static const WebRtc_UWord32 kAvifIsinterleaved = 0x00000100;
|
static const WebRtc_UWord32 kAvifIsinterleaved = 0x00000100;
|
||||||
static const WebRtc_UWord32 kAvifTrustcktype = 0x00000800;
|
static const WebRtc_UWord32 kAvifTrustcktype = 0x00000800;
|
||||||
static const WebRtc_UWord32 kAvifWascapturefile = 0x00010000;
|
static const WebRtc_UWord32 kAvifWascapturefile = 0x00010000;
|
||||||
}
|
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
T MinValue(T a, T b)
|
||||||
|
{
|
||||||
|
return a < b ? a : b;
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
AviFile::AVIMAINHEADER::AVIMAINHEADER()
|
AviFile::AVIMAINHEADER::AVIMAINHEADER()
|
||||||
: fcc( 0),
|
: fcc( 0),
|
||||||
@ -1505,8 +1510,7 @@ WebRtc_Word32 AviFile::ReadAVIVideoStreamHeader(WebRtc_Word32 endpos)
|
|||||||
if (chunksize > _videoFormatHeader.biSize)
|
if (chunksize > _videoFormatHeader.biSize)
|
||||||
{
|
{
|
||||||
const WebRtc_UWord32 size = chunksize - _videoFormatHeader.biSize;
|
const WebRtc_UWord32 size = chunksize - _videoFormatHeader.biSize;
|
||||||
const WebRtc_Word32 readSize = (size > CODEC_CONFIG_LENGTH) ?
|
const WebRtc_UWord32 readSize = MinValue(size, CODEC_CONFIG_LENGTH);
|
||||||
CODEC_CONFIG_LENGTH : size;
|
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_videoConfigParameters), readSize);
|
reinterpret_cast<WebRtc_UWord8*>(_videoConfigParameters), readSize);
|
||||||
_videoConfigLength = readSize;
|
_videoConfigLength = readSize;
|
||||||
@ -1528,15 +1532,14 @@ WebRtc_Word32 AviFile::ReadAVIVideoStreamHeader(WebRtc_Word32 endpos)
|
|||||||
|
|
||||||
if (chunktag == MakeFourCc('s', 't', 'r', 'n'))
|
if (chunktag == MakeFourCc('s', 't', 'r', 'n'))
|
||||||
{
|
{
|
||||||
WebRtc_Word32 size = (chunksize > STREAM_NAME_LENGTH) ?
|
const WebRtc_UWord32 size = MinValue(chunksize, STREAM_NAME_LENGTH);
|
||||||
STREAM_NAME_LENGTH : chunksize;
|
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_videoStreamName), size);
|
reinterpret_cast<WebRtc_UWord8*>(_videoStreamName), size);
|
||||||
}
|
}
|
||||||
else if (chunktag == MakeFourCc('s', 't', 'r', 'd'))
|
else if (chunktag == MakeFourCc('s', 't', 'r', 'd'))
|
||||||
{
|
{
|
||||||
WebRtc_Word32 size = (chunksize > CODEC_CONFIG_LENGTH) ?
|
const WebRtc_UWord32 size = MinValue(chunksize,
|
||||||
CODEC_CONFIG_LENGTH : chunksize;
|
CODEC_CONFIG_LENGTH);
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_videoConfigParameters), size);
|
reinterpret_cast<WebRtc_UWord8*>(_videoConfigParameters), size);
|
||||||
_videoConfigLength = size;
|
_videoConfigLength = size;
|
||||||
@ -1579,11 +1582,10 @@ WebRtc_Word32 AviFile::ReadAVIAudioStreamHeader(WebRtc_Word32 endpos)
|
|||||||
_bytesRead += GetLE16(_audioFormatHeader.wBitsPerSample);
|
_bytesRead += GetLE16(_audioFormatHeader.wBitsPerSample);
|
||||||
_bytesRead += GetLE16(_audioFormatHeader.cbSize);
|
_bytesRead += GetLE16(_audioFormatHeader.cbSize);
|
||||||
|
|
||||||
const WebRtc_Word32 diffRead = chunksize - (_bytesRead - startRead);
|
const WebRtc_UWord32 diffRead = chunksize - (_bytesRead - startRead);
|
||||||
if (diffRead > 0)
|
if (diffRead > 0)
|
||||||
{
|
{
|
||||||
size_t size = (diffRead > CODEC_CONFIG_LENGTH) ?
|
const WebRtc_UWord32 size = MinValue(diffRead, CODEC_CONFIG_LENGTH);
|
||||||
CODEC_CONFIG_LENGTH : diffRead;
|
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_audioConfigParameters), size);
|
reinterpret_cast<WebRtc_UWord8*>(_audioConfigParameters), size);
|
||||||
}
|
}
|
||||||
@ -1597,15 +1599,14 @@ WebRtc_Word32 AviFile::ReadAVIAudioStreamHeader(WebRtc_Word32 endpos)
|
|||||||
|
|
||||||
if (chunktag == MakeFourCc('s', 't', 'r', 'n'))
|
if (chunktag == MakeFourCc('s', 't', 'r', 'n'))
|
||||||
{
|
{
|
||||||
WebRtc_Word32 size = (chunksize > STREAM_NAME_LENGTH) ?
|
const WebRtc_UWord32 size = MinValue(chunksize, STREAM_NAME_LENGTH);
|
||||||
STREAM_NAME_LENGTH : chunksize;
|
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_audioStreamName), size);
|
reinterpret_cast<WebRtc_UWord8*>(_audioStreamName), size);
|
||||||
}
|
}
|
||||||
else if (chunktag == MakeFourCc('s', 't', 'r', 'd'))
|
else if (chunktag == MakeFourCc('s', 't', 'r', 'd'))
|
||||||
{
|
{
|
||||||
WebRtc_Word32 size = (chunksize > CODEC_CONFIG_LENGTH) ?
|
const WebRtc_UWord32 size = MinValue(chunksize,
|
||||||
CODEC_CONFIG_LENGTH : chunksize;
|
CODEC_CONFIG_LENGTH);
|
||||||
_bytesRead += GetBuffer(
|
_bytesRead += GetBuffer(
|
||||||
reinterpret_cast<WebRtc_UWord8*>(_audioConfigParameters), size);
|
reinterpret_cast<WebRtc_UWord8*>(_audioConfigParameters), size);
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,9 @@ public:
|
|||||||
AVI_VIDEO = 1
|
AVI_VIDEO = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {CODEC_CONFIG_LENGTH = 64};
|
// Unsigned, for comparison with must-be-unsigned types.
|
||||||
enum {STREAM_NAME_LENGTH = 32};
|
static const unsigned int CODEC_CONFIG_LENGTH = 64;
|
||||||
|
static const unsigned int STREAM_NAME_LENGTH = 32;
|
||||||
|
|
||||||
AviFile();
|
AviFile();
|
||||||
~AviFile();
|
~AviFile();
|
||||||
|
@ -54,7 +54,7 @@ struct ProtectedPacket
|
|||||||
ForwardErrorCorrection::Packet* pkt; /**> Pointer to the packet storage. */
|
ForwardErrorCorrection::Packet* pkt; /**> Pointer to the packet storage. */
|
||||||
};
|
};
|
||||||
|
|
||||||
ForwardErrorCorrection::ForwardErrorCorrection(const WebRtc_Word32 id) :
|
ForwardErrorCorrection::ForwardErrorCorrection(WebRtc_Word32 id) :
|
||||||
_id(id),
|
_id(id),
|
||||||
_generatedFecPackets(NULL),
|
_generatedFecPackets(NULL),
|
||||||
_fecPacketList(),
|
_fecPacketList(),
|
||||||
@ -92,8 +92,8 @@ ForwardErrorCorrection::~ForwardErrorCorrection()
|
|||||||
WebRtc_Word32
|
WebRtc_Word32
|
||||||
ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList,
|
ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList,
|
||||||
WebRtc_UWord8 protectionFactor,
|
WebRtc_UWord8 protectionFactor,
|
||||||
WebRtc_UWord32 numImportantPackets,
|
int numImportantPackets,
|
||||||
const bool useUnequalProtection,
|
bool useUnequalProtection,
|
||||||
ListWrapper& fecPacketList)
|
ListWrapper& fecPacketList)
|
||||||
{
|
{
|
||||||
if (mediaPacketList.Empty())
|
if (mediaPacketList.Empty())
|
||||||
@ -132,15 +132,15 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList,
|
|||||||
if (numImportantPackets > numMediaPackets)
|
if (numImportantPackets > numMediaPackets)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
|
WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
|
||||||
"Number of Important packet greater than number of Media Packets %d %d",
|
"Number of important packets (%d) greater than number of media "
|
||||||
numImportantPackets, numMediaPackets);
|
"packets (%d)", numImportantPackets, numMediaPackets);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (numImportantPackets < 0)
|
if (numImportantPackets < 0)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
|
WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
|
||||||
"Number of Important packets less than zero %d %d",
|
"Number of important packets (%d) less than zero",
|
||||||
numImportantPackets, numMediaPackets);
|
numImportantPackets);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList,
|
|||||||
WebRtc_Word32
|
WebRtc_Word32
|
||||||
ForwardErrorCorrection::DecodeFEC(ListWrapper& receivedPacketList,
|
ForwardErrorCorrection::DecodeFEC(ListWrapper& receivedPacketList,
|
||||||
ListWrapper& recoveredPacketList,
|
ListWrapper& recoveredPacketList,
|
||||||
const WebRtc_UWord16 lastFECSeqNum,
|
WebRtc_UWord16 lastFECSeqNum,
|
||||||
bool& frameComplete)
|
bool& frameComplete)
|
||||||
{
|
{
|
||||||
// TODO: can we check for multiple ULP headers, and return an error?
|
// TODO: can we check for multiple ULP headers, and return an error?
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
struct Packet
|
struct Packet
|
||||||
{
|
{
|
||||||
WebRtc_UWord16 length; /**> Length of packet in bytes. */
|
WebRtc_UWord16 length; /**> Length of packet in bytes. */
|
||||||
WebRtc_UWord8 data[IP_PACKET_SIZE]; /**> Packet data. */
|
WebRtc_UWord8 data[IP_PACKET_SIZE]; /**> Packet data. */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
struct ReceivedPacket
|
struct ReceivedPacket
|
||||||
{
|
{
|
||||||
WebRtc_UWord16 seqNum; /**> Sequence number of packet. */
|
WebRtc_UWord16 seqNum; /**> Sequence number of packet. */
|
||||||
WebRtc_UWord32 ssrc; /**> SSRC of the current frame. Must be set for FEC
|
WebRtc_UWord32 ssrc; /**> SSRC of the current frame. Must be set for FEC
|
||||||
packets, but not required for media packets. */
|
packets, but not required for media packets. */
|
||||||
bool isFec; /**> Set to true if this is an FEC packet and false
|
bool isFec; /**> Set to true if this is an FEC packet and false
|
||||||
otherwise. */
|
otherwise. */
|
||||||
@ -73,13 +73,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
struct RecoveredPacket
|
struct RecoveredPacket
|
||||||
{
|
{
|
||||||
bool wasRecovered; /**> Will be true if this packet was recovered by the FEC.
|
bool wasRecovered; /**> Will be true if this packet was recovered by the FEC.
|
||||||
Otherwise it was a media packet passed in through the
|
Otherwise it was a media packet passed in through the
|
||||||
received packet list. */
|
received packet list. */
|
||||||
WebRtc_UWord16 seqNum; /**> Sequence number of the packet. This is mostly for
|
WebRtc_UWord16 seqNum; /**> Sequence number of the packet. This is mostly for
|
||||||
implementation convenience but could be utilized by the
|
implementation convenience but could be utilized by the
|
||||||
user if so desired. */
|
user if so desired. */
|
||||||
Packet* pkt; /**> Pointer to the packet storage. */
|
Packet* pkt; /**> Pointer to the packet storage. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +87,7 @@ public:
|
|||||||
*
|
*
|
||||||
* \param[in] id Module ID
|
* \param[in] id Module ID
|
||||||
*/
|
*/
|
||||||
ForwardErrorCorrection(const WebRtc_Word32 id);
|
ForwardErrorCorrection(WebRtc_Word32 id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor. Before freeing an instance of the class, #DecodeFEC() must be called
|
* Destructor. Before freeing an instance of the class, #DecodeFEC() must be called
|
||||||
@ -122,8 +122,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
WebRtc_Word32 GenerateFEC(const ListWrapper& mediaPacketList,
|
WebRtc_Word32 GenerateFEC(const ListWrapper& mediaPacketList,
|
||||||
WebRtc_UWord8 protectionFactor,
|
WebRtc_UWord8 protectionFactor,
|
||||||
WebRtc_UWord32 numImportantPackets,
|
int numImportantPackets,
|
||||||
const bool useUnequalProtection,
|
bool useUnequalProtection,
|
||||||
ListWrapper& fecPacketList);
|
ListWrapper& fecPacketList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,9 +165,9 @@ public:
|
|||||||
* \return 0 on success, -1 on failure.
|
* \return 0 on success, -1 on failure.
|
||||||
*/
|
*/
|
||||||
WebRtc_Word32 DecodeFEC(ListWrapper& receivedPacketList,
|
WebRtc_Word32 DecodeFEC(ListWrapper& receivedPacketList,
|
||||||
ListWrapper& recoveredPacketList,
|
ListWrapper& recoveredPacketList,
|
||||||
const WebRtc_UWord16 lastFECSeqNum,
|
WebRtc_UWord16 lastFECSeqNum,
|
||||||
bool& frameComplete);
|
bool& frameComplete);
|
||||||
/**
|
/**
|
||||||
* Gets the size in bytes of the FEC/ULP headers, which must be accounted for as
|
* Gets the size in bytes of the FEC/ULP headers, which must be accounted for as
|
||||||
* packet overhead.
|
* packet overhead.
|
||||||
@ -176,12 +176,12 @@ public:
|
|||||||
static WebRtc_UWord16 PacketOverhead();
|
static WebRtc_UWord16 PacketOverhead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
WebRtc_Word32 _id;
|
||||||
Packet* _generatedFecPackets;
|
Packet* _generatedFecPackets;
|
||||||
ListWrapper _fecPacketList;
|
ListWrapper _fecPacketList;
|
||||||
WebRtc_UWord16 _seqNumBase;
|
WebRtc_UWord16 _seqNumBase;
|
||||||
bool _lastMediaPacketReceived;
|
bool _lastMediaPacketReceived;
|
||||||
bool _fecPacketReceived;
|
bool _fecPacketReceived;
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
|
@ -39,15 +39,14 @@ enum ResidualProtectionMode
|
|||||||
* \param[out] packetMask A pointer to hold the output mask, of size
|
* \param[out] packetMask A pointer to hold the output mask, of size
|
||||||
* [0, x * numMaskBytes], where x >= numRows.
|
* [0, x * numMaskBytes], where x >= numRows.
|
||||||
*/
|
*/
|
||||||
void FitSubMask(const WebRtc_UWord16 numMaskBytes,
|
void FitSubMask(WebRtc_UWord16 numMaskBytes,
|
||||||
const WebRtc_UWord16 numSubMaskBytes,
|
WebRtc_UWord16 numSubMaskBytes,
|
||||||
const WebRtc_UWord16 numRows,
|
WebRtc_UWord16 numRows,
|
||||||
const WebRtc_UWord8* subMask,
|
const WebRtc_UWord8* subMask,
|
||||||
WebRtc_UWord8* packetMask)
|
WebRtc_UWord8* packetMask)
|
||||||
{
|
{
|
||||||
if (numMaskBytes == numSubMaskBytes)
|
if (numMaskBytes == numSubMaskBytes)
|
||||||
{
|
{
|
||||||
|
|
||||||
memcpy(packetMask,subMask,
|
memcpy(packetMask,subMask,
|
||||||
numRows * numSubMaskBytes);
|
numRows * numSubMaskBytes);
|
||||||
}
|
}
|
||||||
@ -86,10 +85,10 @@ void FitSubMask(const WebRtc_UWord16 numMaskBytes,
|
|||||||
// TODO (marpan): This function is doing three things at the same time:
|
// TODO (marpan): This function is doing three things at the same time:
|
||||||
// shift within a byte, byte shift and resizing.
|
// shift within a byte, byte shift and resizing.
|
||||||
// Split up into subroutines.
|
// Split up into subroutines.
|
||||||
void ShiftFitSubMask(const WebRtc_UWord16 numMaskBytes,
|
void ShiftFitSubMask(WebRtc_UWord16 numMaskBytes,
|
||||||
const WebRtc_UWord16 resMaskBytes,
|
WebRtc_UWord16 resMaskBytes,
|
||||||
const WebRtc_UWord16 numColumnShift,
|
WebRtc_UWord16 numColumnShift,
|
||||||
const WebRtc_UWord16 endRow,
|
WebRtc_UWord16 endRow,
|
||||||
const WebRtc_UWord8* subMask,
|
const WebRtc_UWord8* subMask,
|
||||||
WebRtc_UWord8* packetMask)
|
WebRtc_UWord8* packetMask)
|
||||||
{
|
{
|
||||||
@ -160,11 +159,11 @@ namespace webrtc {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
// Residual protection for remaining packets
|
// Residual protection for remaining packets
|
||||||
void ResidualPacketProtection(const WebRtc_UWord16 numMediaPackets,
|
void ResidualPacketProtection(WebRtc_UWord16 numMediaPackets,
|
||||||
const WebRtc_UWord16 numFecPackets,
|
WebRtc_UWord16 numFecPackets,
|
||||||
const WebRtc_UWord16 numImpPackets,
|
WebRtc_UWord16 numImpPackets,
|
||||||
const WebRtc_UWord16 numMaskBytes,
|
WebRtc_UWord16 numMaskBytes,
|
||||||
const ResidualProtectionMode mode,
|
ResidualProtectionMode mode,
|
||||||
WebRtc_UWord8* packetMask)
|
WebRtc_UWord8* packetMask)
|
||||||
{
|
{
|
||||||
if (mode == kModeNoOverlap)
|
if (mode == kModeNoOverlap)
|
||||||
@ -209,9 +208,9 @@ void ResidualPacketProtection(const WebRtc_UWord16 numMediaPackets,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Higher protection for numImpPackets
|
// Higher protection for numImpPackets
|
||||||
void ImportantPacketProtection(const WebRtc_UWord16 numFecPackets,
|
void ImportantPacketProtection(WebRtc_UWord16 numFecPackets,
|
||||||
const WebRtc_UWord16 numImpPackets,
|
WebRtc_UWord16 numImpPackets,
|
||||||
const WebRtc_UWord16 numMaskBytes,
|
WebRtc_UWord16 numMaskBytes,
|
||||||
WebRtc_UWord8* packetMask)
|
WebRtc_UWord8* packetMask)
|
||||||
{
|
{
|
||||||
const WebRtc_UWord8 lBit = numImpPackets > 16 ? 1 : 0;
|
const WebRtc_UWord8 lBit = numImpPackets > 16 ? 1 : 0;
|
||||||
@ -289,14 +288,15 @@ void UnequalProtectionMask(const WebRtc_UWord16 numMediaPackets,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneratePacketMasks(const WebRtc_UWord32 numMediaPackets,
|
void GeneratePacketMasks(int numMediaPackets,
|
||||||
const WebRtc_UWord32 numFecPackets,
|
int numFecPackets,
|
||||||
const WebRtc_UWord32 numImpPackets,
|
int numImpPackets,
|
||||||
const bool useUnequalProtection,
|
bool useUnequalProtection,
|
||||||
WebRtc_UWord8* packetMask)
|
WebRtc_UWord8* packetMask)
|
||||||
{
|
{
|
||||||
assert(numMediaPackets <= sizeof(packetMaskTbl)/sizeof(*packetMaskTbl) &&
|
assert(numMediaPackets <= static_cast<int>(sizeof(packetMaskTbl) /
|
||||||
numMediaPackets > 0);
|
sizeof(*packetMaskTbl)));
|
||||||
|
assert(numMediaPackets > 0);
|
||||||
assert(numFecPackets <= numMediaPackets && numFecPackets > 0);
|
assert(numFecPackets <= numMediaPackets && numFecPackets > 0);
|
||||||
assert(numImpPackets <= numMediaPackets && numImpPackets >= 0);
|
assert(numImpPackets <= numMediaPackets && numImpPackets >= 0);
|
||||||
|
|
||||||
|
@ -38,12 +38,10 @@ namespace internal {
|
|||||||
* of size:
|
* of size:
|
||||||
* numFecPackets * "number of mask bytes".
|
* numFecPackets * "number of mask bytes".
|
||||||
*/
|
*/
|
||||||
void GeneratePacketMasks(const WebRtc_UWord32 numMediaPackets,
|
void GeneratePacketMasks(int numMediaPackets,
|
||||||
const WebRtc_UWord32 numFecPackets,
|
int numFecPackets,
|
||||||
const WebRtc_UWord32 numImpPackets,
|
int numImpPackets,
|
||||||
const bool useUnequalProtection,
|
bool useUnequalProtection,
|
||||||
WebRtc_UWord8* packetMask);
|
WebRtc_UWord8* packetMask);
|
||||||
|
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -46,17 +46,17 @@ public:
|
|||||||
// This method will be called after the detection of an inband
|
// This method will be called after the detection of an inband
|
||||||
// telephone event. The event code is given as output in the
|
// telephone event. The event code is given as output in the
|
||||||
// |eventCode| parameter.
|
// |eventCode| parameter.
|
||||||
virtual void OnReceivedTelephoneEventInband(const int channel,
|
virtual void OnReceivedTelephoneEventInband(int channel,
|
||||||
const unsigned char eventCode,
|
int eventCode,
|
||||||
const bool endOfEvent) = 0;
|
bool endOfEvent) = 0;
|
||||||
|
|
||||||
// This method will be called after the detection of an out-of-band
|
// This method will be called after the detection of an out-of-band
|
||||||
// telephone event. The event code is given as output in the
|
// telephone event. The event code is given as output in the
|
||||||
// |eventCode| parameter.
|
// |eventCode| parameter.
|
||||||
virtual void OnReceivedTelephoneEventOutOfBand(
|
virtual void OnReceivedTelephoneEventOutOfBand(
|
||||||
const int channel,
|
int channel,
|
||||||
const unsigned char eventCode,
|
int eventCode,
|
||||||
const bool endOfEvent) = 0;
|
bool endOfEvent) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~VoETelephoneEventObserver() {}
|
virtual ~VoETelephoneEventObserver() {}
|
||||||
@ -79,7 +79,7 @@ public:
|
|||||||
virtual int Release() = 0;
|
virtual int Release() = 0;
|
||||||
|
|
||||||
// Sends telephone events either in-band or out-of-band.
|
// Sends telephone events either in-band or out-of-band.
|
||||||
virtual int SendTelephoneEvent(int channel, unsigned char eventCode,
|
virtual int SendTelephoneEvent(int channel, int eventCode,
|
||||||
bool outOfBand = true, int lengthMs = 160,
|
bool outOfBand = true, int lengthMs = 160,
|
||||||
int attenuationDb = 10) = 0;
|
int attenuationDb = 10) = 0;
|
||||||
|
|
||||||
@ -110,13 +110,13 @@ public:
|
|||||||
virtual int GetDtmfFeedbackStatus(bool& enabled, bool& directFeedback) = 0;
|
virtual int GetDtmfFeedbackStatus(bool& enabled, bool& directFeedback) = 0;
|
||||||
|
|
||||||
// Plays a DTMF feedback tone (only locally).
|
// Plays a DTMF feedback tone (only locally).
|
||||||
virtual int PlayDtmfTone(unsigned char eventCode, int lengthMs = 200,
|
virtual int PlayDtmfTone(int eventCode, int lengthMs = 200,
|
||||||
int attenuationDb = 10) = 0;
|
int attenuationDb = 10) = 0;
|
||||||
|
|
||||||
// Starts playing out a DTMF feedback tone locally.
|
// Starts playing out a DTMF feedback tone locally.
|
||||||
// The tone will be played out until the corresponding stop function
|
// The tone will be played out until the corresponding stop function
|
||||||
// is called.
|
// is called.
|
||||||
virtual int StartPlayingDtmfTone(unsigned char eventCode,
|
virtual int StartPlayingDtmfTone(int eventCode,
|
||||||
int attenuationDb = 10) = 0;
|
int attenuationDb = 10) = 0;
|
||||||
|
|
||||||
// Stops playing out a DTMF feedback tone locally.
|
// Stops playing out a DTMF feedback tone locally.
|
||||||
|
@ -4511,7 +4511,7 @@ Channel::SetSendTelephoneEventPayloadType(unsigned char type)
|
|||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||||
"Channel::SetSendTelephoneEventPayloadType()");
|
"Channel::SetSendTelephoneEventPayloadType()");
|
||||||
if (type < 0 || type > 127)
|
if (type > 127)
|
||||||
{
|
{
|
||||||
_engineStatisticsPtr->SetLastError(
|
_engineStatisticsPtr->SetLastError(
|
||||||
VE_INVALID_ARGUMENT, kTraceError,
|
VE_INVALID_ARGUMENT, kTraceError,
|
||||||
|
@ -513,11 +513,11 @@ public:
|
|||||||
{
|
{
|
||||||
return _inputIsOnHold;
|
return _inputIsOnHold;
|
||||||
};
|
};
|
||||||
RtpRtcp* const RtpRtcpModulePtr()
|
RtpRtcp* RtpRtcpModulePtr() const
|
||||||
{
|
{
|
||||||
return &_rtpRtcpModule;
|
return &_rtpRtcpModule;
|
||||||
};
|
};
|
||||||
WebRtc_Word8 const OutputEnergyLevel()
|
WebRtc_Word8 OutputEnergyLevel() const
|
||||||
{
|
{
|
||||||
return _outputAudioLevel.Level();
|
return _outputAudioLevel.Level();
|
||||||
};
|
};
|
||||||
|
@ -72,7 +72,7 @@ int VoEDtmfImpl::Release()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int VoEDtmfImpl::SendTelephoneEvent(int channel,
|
int VoEDtmfImpl::SendTelephoneEvent(int channel,
|
||||||
unsigned char eventCode,
|
int eventCode,
|
||||||
bool outOfBand,
|
bool outOfBand,
|
||||||
int lengthMs,
|
int lengthMs,
|
||||||
int attenuationDb)
|
int attenuationDb)
|
||||||
@ -216,7 +216,7 @@ int VoEDtmfImpl::GetSendTelephoneEventPayloadType(int channel,
|
|||||||
return channelPtr->GetSendTelephoneEventPayloadType(type);
|
return channelPtr->GetSendTelephoneEventPayloadType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VoEDtmfImpl::PlayDtmfTone(unsigned char eventCode,
|
int VoEDtmfImpl::PlayDtmfTone(int eventCode,
|
||||||
int lengthMs,
|
int lengthMs,
|
||||||
int attenuationDb)
|
int attenuationDb)
|
||||||
{
|
{
|
||||||
@ -251,7 +251,7 @@ int VoEDtmfImpl::PlayDtmfTone(unsigned char eventCode,
|
|||||||
return _outputMixerPtr->PlayDtmfTone(eventCode, lengthMs, attenuationDb);
|
return _outputMixerPtr->PlayDtmfTone(eventCode, lengthMs, attenuationDb);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VoEDtmfImpl::StartPlayingDtmfTone(unsigned char eventCode,
|
int VoEDtmfImpl::StartPlayingDtmfTone(int eventCode,
|
||||||
int attenuationDb)
|
int attenuationDb)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1),
|
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1),
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
virtual int SendTelephoneEvent(
|
virtual int SendTelephoneEvent(
|
||||||
int channel,
|
int channel,
|
||||||
unsigned char eventCode,
|
int eventCode,
|
||||||
bool outOfBand = true,
|
bool outOfBand = true,
|
||||||
int lengthMs = 160,
|
int lengthMs = 160,
|
||||||
int attenuationDb = 10);
|
int attenuationDb = 10);
|
||||||
@ -44,11 +44,11 @@ public:
|
|||||||
|
|
||||||
virtual int GetDtmfFeedbackStatus(bool& enabled, bool& directFeedback);
|
virtual int GetDtmfFeedbackStatus(bool& enabled, bool& directFeedback);
|
||||||
|
|
||||||
virtual int PlayDtmfTone(unsigned char eventCode,
|
virtual int PlayDtmfTone(int eventCode,
|
||||||
int lengthMs = 200,
|
int lengthMs = 200,
|
||||||
int attenuationDb = 10);
|
int attenuationDb = 10);
|
||||||
|
|
||||||
virtual int StartPlayingDtmfTone(unsigned char eventCode,
|
virtual int StartPlayingDtmfTone(int eventCode,
|
||||||
int attenuationDb = 10);
|
int attenuationDb = 10);
|
||||||
|
|
||||||
virtual int StopPlayingDtmfTone();
|
virtual int StopPlayingDtmfTone();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user