Change WebRtc_Word8 to char

Review URL: https://webrtc-codereview.appspot.com/407003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1787 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-02-28 17:26:14 +00:00
parent 50219cd393
commit 91b359ea9b
17 changed files with 52 additions and 55 deletions

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -51,7 +51,7 @@ typedef struct WebRtcCngDecInst CNG_dec_inst;
* -1 - Error * -1 - Error
*/ */
WebRtc_Word16 WebRtcCng_Version(WebRtc_Word8 *version); WebRtc_Word16 WebRtcCng_Version(char *version);
/**************************************************************************** /****************************************************************************
* WebRtcCng_AssignSizeEnc/Dec(...) * WebRtcCng_AssignSizeEnc/Dec(...)

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -19,7 +19,7 @@
typedef struct WebRtcCngDecInst_t_ { typedef struct WebRtcCngDecInst_t_ {
WebRtc_UWord32 dec_seed; WebRtc_UWord32 dec_seed;
WebRtc_Word32 dec_target_energy; WebRtc_Word32 dec_target_energy;
WebRtc_Word32 dec_used_energy; WebRtc_Word32 dec_used_energy;
@ -90,9 +90,9 @@ const WebRtc_Word16 WebRtcCng_kCorrWindow[WEBRTC_CNG_MAX_LPC_ORDER] = {
* *
* Return value : 0 - Ok * Return value : 0 - Ok
* -1 - Error * -1 - Error
*/ */
WebRtc_Word16 WebRtcCng_Version(WebRtc_Word8 *version) WebRtc_Word16 WebRtcCng_Version(char *version)
{ {
strcpy((char*)version,(const char*)"1.2.0\n"); strcpy((char*)version,(const char*)"1.2.0\n");
return(0); return(0);
@ -201,7 +201,7 @@ WebRtc_Word16 WebRtcCng_CreateDec(CNG_dec_inst **cng_inst)
} }
else { else {
/* The memory could not be allocated */ /* The memory could not be allocated */
return(-1); return(-1);
} }
} }
@ -234,7 +234,7 @@ WebRtc_Word16 WebRtcCng_InitEnc(CNG_enc_inst *cng_inst,
int i; int i;
WebRtcCngEncInst_t* inst=(WebRtcCngEncInst_t*)cng_inst; WebRtcCngEncInst_t* inst=(WebRtcCngEncInst_t*)cng_inst;
memset(inst, 0, sizeof(WebRtcCngEncInst_t)); memset(inst, 0, sizeof(WebRtcCngEncInst_t));
/* Check LPC order */ /* Check LPC order */
@ -248,7 +248,7 @@ WebRtc_Word16 WebRtcCng_InitEnc(CNG_enc_inst *cng_inst,
inst->errorcode = CNG_DISALLOWED_SAMPLING_FREQUENCY; inst->errorcode = CNG_DISALLOWED_SAMPLING_FREQUENCY;
return (-1); return (-1);
} }
inst->enc_sampfreq=fs; inst->enc_sampfreq=fs;
inst->enc_interval=interval; inst->enc_interval=interval;
inst->enc_nrOfCoefs=quality; inst->enc_nrOfCoefs=quality;
@ -287,7 +287,7 @@ WebRtc_Word16 WebRtcCng_InitDec(CNG_dec_inst *cng_inst)
return(0); return(0);
} }
/**************************************************************************** /****************************************************************************
* WebRtcCng_FreeEnc/Dec(...) * WebRtcCng_FreeEnc/Dec(...)
* *

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -249,7 +249,7 @@ WebRtc_Word16 WebRtcIlbcfix_NetEqPlc(iLBC_decinst_t *iLBCdec_inst, WebRtc_Word16
return (0); return (0);
} }
void WebRtcIlbcfix_version(WebRtc_Word8 *version) void WebRtcIlbcfix_version(char *version)
{ {
strcpy((char*)version, "1.1.1"); strcpy((char*)version, "1.1.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 * 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 * that can be found in the LICENSE file in the root of the source
@ -250,11 +250,10 @@ extern "C" {
* - version : Version number of iLBC (maximum 20 char) * - version : Version number of iLBC (maximum 20 char)
*/ */
void WebRtcIlbcfix_version(WebRtc_Word8 *version); void WebRtcIlbcfix_version(char *version);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -124,7 +124,7 @@ class AudioCodingModule: public Module {
// -1 if the list number (listId) is invalid. // -1 if the list number (listId) is invalid.
// 0 if succeeded. // 0 if succeeded.
// //
static WebRtc_Word32 Codec(const WebRtc_Word8* payloadName, CodecInst& codec, static WebRtc_Word32 Codec(const char* payloadName, CodecInst& codec,
const WebRtc_Word32 samplingFreqHz = -1); const WebRtc_Word32 samplingFreqHz = -1);
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -142,7 +142,7 @@ class AudioCodingModule: public Module {
// if the codec is found, the index of the codec in the list, // if the codec is found, the index of the codec in the list,
// -1 if the codec is not found. // -1 if the codec is not found.
// //
static WebRtc_Word32 Codec(const WebRtc_Word8* payloadName, static WebRtc_Word32 Codec(const char* payloadName,
const WebRtc_Word32 samplingFreqHz = -1); const WebRtc_Word32 samplingFreqHz = -1);
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View File

@ -49,7 +49,7 @@ int16_t ACMCELT::DecodeSafe(uint8_t* /* bitStream */,
int16_t /* bitStreamLenByte */, int16_t /* bitStreamLenByte */,
int16_t* /* audio */, int16_t* /* audio */,
int16_t* /* audioSamples */, int16_t* /* audioSamples */,
char* /* speechType */) { int8_t* /* speechType */) {
return -1; return -1;
} }
@ -157,7 +157,7 @@ int16_t ACMCELT::DecodeSafe(uint8_t* /* bitStream */,
int16_t /* bitStreamLenByte */, int16_t /* bitStreamLenByte */,
int16_t* /* audio */, int16_t* /* audio */,
int16_t* /* audioSamples */, int16_t* /* audioSamples */,
char* /* speechType */) { int8_t* /* speechType */) {
return 0; return 0;
} }

View File

@ -35,11 +35,11 @@ class ACMCELT : public ACMGenericCodec {
protected: protected:
WebRtc_Word16 DecodeSafe( WebRtc_Word16 DecodeSafe(
WebRtc_UWord8* bitStream, uint8_t* /* bitStream */,
WebRtc_Word16 bitStreamLenByte, int16_t /* bitStreamLenByte */,
WebRtc_Word16* audio, int16_t* /* audio */,
WebRtc_Word16* audioSamples, int16_t* /* audioSamples */,
WebRtc_Word8* speechType); int8_t* /* speechType */);
int32_t CodecDef(WebRtcNetEQ_CodecDef& codecDef, const CodecInst& codecInst); int32_t CodecDef(WebRtcNetEQ_CodecDef& codecDef, const CodecInst& codecInst);

View File

@ -986,7 +986,7 @@ ACMNetEQ::FlushBuffers()
WebRtc_Word32 WebRtc_Word32
ACMNetEQ::GetVersion( ACMNetEQ::GetVersion(
WebRtc_Word8* version, char* version,
WebRtc_UWord32& remainingBufferInBytes, WebRtc_UWord32& remainingBufferInBytes,
WebRtc_UWord32& position) WebRtc_UWord32& position)
{ {
@ -996,7 +996,7 @@ ACMNetEQ::GetVersion(
remainingBufferInBytes -= (position - len); remainingBufferInBytes -= (position - len);
len = position; len = position;
WebRtc_Word8 myVersion[100]; char myVersion[100];
if(WebRtcNetEQ_GetVersion(myVersion) < 0) if(WebRtcNetEQ_GetVersion(myVersion) < 0)
{ {
return -1; return -1;
@ -1111,11 +1111,11 @@ ACMNetEQ::SetUniqueId(
void void
ACMNetEQ::LogError( ACMNetEQ::LogError(
const WebRtc_Word8* neteqFuncName, const char* neteqFuncName,
const WebRtc_Word16 idx) const const WebRtc_Word16 idx) const
{ {
WebRtc_Word8 errorName[NETEQ_ERR_MSG_LEN_BYTE]; char errorName[NETEQ_ERR_MSG_LEN_BYTE];
WebRtc_Word8 myFuncName[50]; char myFuncName[50];
int neteqErrorCode = WebRtcNetEQ_GetErrorCode(_inst[idx]); int neteqErrorCode = WebRtcNetEQ_GetErrorCode(_inst[idx]);
WebRtcNetEQ_GetErrorName(neteqErrorCode, errorName, NETEQ_ERR_MSG_LEN_BYTE - 1); WebRtcNetEQ_GetErrorName(neteqErrorCode, errorName, NETEQ_ERR_MSG_LEN_BYTE - 1);
strncpy(myFuncName, neteqFuncName, 49); strncpy(myFuncName, neteqFuncName, 49);

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -56,7 +56,7 @@ public:
// -1 if NetEQ returned an error. // -1 if NetEQ returned an error.
// //
static WebRtc_Word32 GetVersion( static WebRtc_Word32 GetVersion(
WebRtc_Word8* version, char* version,
WebRtc_UWord32& remainingBuffInBytes, WebRtc_UWord32& remainingBuffInBytes,
WebRtc_UWord32& position); WebRtc_UWord32& position);
@ -330,7 +330,7 @@ private:
const WebRtcRTPHeader& rtpInfo); const WebRtcRTPHeader& rtpInfo);
void LogError( void LogError(
const WebRtc_Word8* neteqFuncName, const char* neteqFuncName,
const WebRtc_Word16 idx) const; const WebRtc_Word16 idx) const;
WebRtc_Word16 InitByIdxSafe( WebRtc_Word16 InitByIdxSafe(

View File

@ -52,7 +52,7 @@ AudioCodingModule::Codec(
// Get supported codec Param with name // Get supported codec Param with name
WebRtc_Word32 WebRtc_Word32
AudioCodingModule::Codec( AudioCodingModule::Codec(
const WebRtc_Word8* payloadName, const char* payloadName,
CodecInst& codec, CodecInst& codec,
const WebRtc_Word32 samplingFreqHz) const WebRtc_Word32 samplingFreqHz)
{ {
@ -86,7 +86,7 @@ AudioCodingModule::Codec(
// Get supported codec Index with name, and frequency if needed // Get supported codec Index with name, and frequency if needed
WebRtc_Word32 WebRtc_Word32
AudioCodingModule::Codec( AudioCodingModule::Codec(
const WebRtc_Word8* payloadName, const char* payloadName,
const WebRtc_Word32 samplingFreqHz) const WebRtc_Word32 samplingFreqHz)
{ {
CodecInst codec; CodecInst codec;

View File

@ -2314,7 +2314,7 @@ AudioCodingModuleImpl::DecoderParamByPlType(
WebRtc_Word16 WebRtc_Word16
AudioCodingModuleImpl::DecoderListIDByPlName( AudioCodingModuleImpl::DecoderListIDByPlName(
const WebRtc_Word8* payloadName, const char* payloadName,
const WebRtc_UWord16 sampFreqHz) const const WebRtc_UWord16 sampFreqHz) const
{ {
WebRtcACMCodecParams codecParams; WebRtcACMCodecParams codecParams;
@ -2485,7 +2485,7 @@ AudioCodingModuleImpl::PlayoutTimestamp(
bool bool
AudioCodingModuleImpl::HaveValidEncoder( AudioCodingModuleImpl::HaveValidEncoder(
const WebRtc_Word8* callerName) const const char* callerName) const
{ {
if((!_sendCodecRegistered) || if((!_sendCodecRegistered) ||
(_currentSendCodecIdx < 0) || (_currentSendCodecIdx < 0) ||

View File

@ -46,7 +46,7 @@ public:
// get version information for ACM and all components // get version information for ACM and all components
WebRtc_Word32 Version( WebRtc_Word32 Version(
WebRtc_Word8* version, char* version,
WebRtc_UWord32& remainingBufferInBytes, WebRtc_UWord32& remainingBufferInBytes,
WebRtc_UWord32& position) const; WebRtc_UWord32& position) const;
@ -292,12 +292,12 @@ protected:
WebRtcACMCodecParams& codecParams) const; WebRtcACMCodecParams& codecParams) const;
WebRtc_Word16 DecoderListIDByPlName( WebRtc_Word16 DecoderListIDByPlName(
const WebRtc_Word8* payloadName, const char* payloadName,
const WebRtc_UWord16 sampFreqHz = 0) const; const WebRtc_UWord16 sampFreqHz = 0) const;
WebRtc_Word32 InitializeReceiverSafe(); WebRtc_Word32 InitializeReceiverSafe();
bool HaveValidEncoder(const WebRtc_Word8* callerName) const; bool HaveValidEncoder(const char* callerName) const;
WebRtc_Word32 RegisterRecCodecMSSafe( WebRtc_Word32 RegisterRecCodecMSSafe(
const CodecInst& receiveCodec, const CodecInst& receiveCodec,

View File

@ -1,6 +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 * 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 * that can be found in the LICENSE file in the root of the source
@ -53,7 +52,7 @@ PCMFile::ChooseFile(
char* fileName, char* fileName,
WebRtc_Word16 maxLen) WebRtc_Word16 maxLen)
{ {
WebRtc_Word8 tmpName[MAX_FILE_NAME_LENGTH_BYTE]; char tmpName[MAX_FILE_NAME_LENGTH_BYTE];
//strcpy(_fileName, "in.pcm"); //strcpy(_fileName, "in.pcm");
//printf("\n\nPlease enter the input file: "); //printf("\n\nPlease enter the input file: ");
EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL); EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL);
@ -105,7 +104,7 @@ PCMFile::ChooseFile(
WebRtc_Word16 maxLen, WebRtc_Word16 maxLen,
WebRtc_UWord16* frequencyHz) WebRtc_UWord16* frequencyHz)
{ {
WebRtc_Word8 tmpName[MAX_FILE_NAME_LENGTH_BYTE]; char tmpName[MAX_FILE_NAME_LENGTH_BYTE];
//strcpy(_fileName, "in.pcm"); //strcpy(_fileName, "in.pcm");
//printf("\n\nPlease enter the input file: "); //printf("\n\nPlease enter the input file: ");
EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL); EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL);

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -53,7 +53,7 @@ SpatialAudio::Setup()
// Register the receiver ACM in channel // Register the receiver ACM in channel
_channel->RegisterReceiverACM(_acmReceiver); _channel->RegisterReceiverACM(_acmReceiver);
WebRtc_Word8 audioFileName[MAX_FILE_NAME_LENGTH_BYTE]; char audioFileName[MAX_FILE_NAME_LENGTH_BYTE];
WebRtc_UWord16 sampFreqHz = 32000; WebRtc_UWord16 sampFreqHz = 32000;
strncpy(audioFileName, "./test/data/audio_coding/testfile32kHz.pcm", strncpy(audioFileName, "./test/data/audio_coding/testfile32kHz.pcm",

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 * 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 * that can be found in the LICENSE file in the root of the source
@ -99,7 +99,7 @@ WebRtc_Word16
TwoWayCommunication::ChooseFile(char* fileName, WebRtc_Word16 maxLen, TwoWayCommunication::ChooseFile(char* fileName, WebRtc_Word16 maxLen,
WebRtc_UWord16* frequencyHz) WebRtc_UWord16* frequencyHz)
{ {
WebRtc_Word8 tmpName[MAX_FILE_NAME_LENGTH_BYTE]; char tmpName[MAX_FILE_NAME_LENGTH_BYTE];
//strcpy(_fileName, "in.pcm"); //strcpy(_fileName, "in.pcm");
//printf("\n\nPlease enter the input file: "); //printf("\n\nPlease enter the input file: ");
EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL); EXPECT_TRUE(fgets(tmpName, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL);

View File

@ -156,9 +156,9 @@ typedef struct
/* Info functions */ /* Info functions */
#define WEBRTC_NETEQ_MAX_ERROR_NAME 40 #define WEBRTC_NETEQ_MAX_ERROR_NAME 40
int WebRtcNetEQ_GetVersion(WebRtc_Word8 *version); int WebRtcNetEQ_GetVersion(char *version);
int WebRtcNetEQ_GetErrorCode(void *inst); int WebRtcNetEQ_GetErrorCode(void *inst);
int WebRtcNetEQ_GetErrorName(int errorCode, WebRtc_Word8 *errorName, int maxStrLen); int WebRtcNetEQ_GetErrorName(int errorCode, char *errorName, int maxStrLen);
/* Instance memory assign functions */ /* Instance memory assign functions */
@ -213,4 +213,3 @@ int WebRtcNetEQ_VQmonGetRxStatistics(void *inst, WebRtc_UWord16 *avgDelayMs,
#endif #endif
#endif #endif

View File

@ -35,8 +35,8 @@
return(-1); \ return(-1); \
} } } }
int WebRtcNetEQ_strncpy(WebRtc_Word8 *strDest, int numberOfElements, int WebRtcNetEQ_strncpy(char *strDest, int numberOfElements,
const WebRtc_Word8 *strSource, int count) const char *strSource, int count)
{ {
/* check vector lengths */ /* check vector lengths */
if (count > numberOfElements) if (count > numberOfElements)
@ -59,7 +59,7 @@ int WebRtcNetEQ_strncpy(WebRtc_Word8 *strDest, int numberOfElements,
* Info functions * Info functions
*/ */
int WebRtcNetEQ_GetVersion(WebRtc_Word8 *version) int WebRtcNetEQ_GetVersion(char *version)
{ {
char versionString[] = "3.3.0\0 "; char versionString[] = "3.3.0\0 ";
char endChar[] = " "; char endChar[] = " ";
@ -79,7 +79,7 @@ int WebRtcNetEQ_GetErrorCode(void *inst)
return (NetEqMainInst->ErrorCode); return (NetEqMainInst->ErrorCode);
} }
int WebRtcNetEQ_GetErrorName(int errorCode, WebRtc_Word8 *errorName, int maxStrLen) int WebRtcNetEQ_GetErrorName(int errorCode, char *errorName, int maxStrLen)
{ {
if ((errorName == NULL) || (maxStrLen <= 0)) if ((errorName == NULL) || (maxStrLen <= 0))
{ {