Remove or rename typedefs with _t prefixes.

_t prefixes are reserved for additional typenames in POSIX.

R=henrik.lundin@webrtc.org, hta@webrtc.org, stefan@webrtc.org
BUG=162

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7931 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2014-12-17 13:43:55 +00:00
parent 5263c58923
commit e728ee03ba
16 changed files with 165 additions and 140 deletions

View File

@@ -42,7 +42,6 @@
// Forward declaration to avoid pulling in libsrtp headers here // Forward declaration to avoid pulling in libsrtp headers here
struct srtp_event_data_t; struct srtp_event_data_t;
struct srtp_ctx_t; struct srtp_ctx_t;
typedef srtp_ctx_t* srtp_t;
struct srtp_policy_t; struct srtp_policy_t;
namespace cricket { namespace cricket {
@@ -238,7 +237,7 @@ class SrtpSession {
static std::list<SrtpSession*>* sessions(); static std::list<SrtpSession*>* sessions();
srtp_t session_; srtp_ctx_t* session_;
int rtp_auth_tag_len_; int rtp_auth_tag_len_;
int rtcp_auth_tag_len_; int rtcp_auth_tag_len_;
rtc::scoped_ptr<SrtpStat> srtp_stat_; rtc::scoped_ptr<SrtpStat> srtp_stat_;

View File

@@ -24,9 +24,10 @@
#include "decode.h" #include "decode.h"
#include <stdlib.h> #include <stdlib.h>
int16_t WebRtcIlbcfix_EncoderAssign(IlbcEncoderInstance** iLBC_encinst,
int16_t WebRtcIlbcfix_EncoderAssign(iLBC_encinst_t **iLBC_encinst, int16_t *ILBCENC_inst_Addr, int16_t *size) { int16_t* ILBCENC_inst_Addr,
*iLBC_encinst=(iLBC_encinst_t*)ILBCENC_inst_Addr; int16_t* size) {
*iLBC_encinst=(IlbcEncoderInstance*)ILBCENC_inst_Addr;
*size=sizeof(iLBC_Enc_Inst_t)/sizeof(int16_t); *size=sizeof(iLBC_Enc_Inst_t)/sizeof(int16_t);
if (*iLBC_encinst!=NULL) { if (*iLBC_encinst!=NULL) {
return(0); return(0);
@@ -35,8 +36,10 @@ int16_t WebRtcIlbcfix_EncoderAssign(iLBC_encinst_t **iLBC_encinst, int16_t *ILBC
} }
} }
int16_t WebRtcIlbcfix_DecoderAssign(iLBC_decinst_t **iLBC_decinst, int16_t *ILBCDEC_inst_Addr, int16_t *size) { int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance** iLBC_decinst,
*iLBC_decinst=(iLBC_decinst_t*)ILBCDEC_inst_Addr; int16_t* ILBCDEC_inst_Addr,
int16_t* size) {
*iLBC_decinst=(IlbcDecoderInstance*)ILBCDEC_inst_Addr;
*size=sizeof(iLBC_Dec_Inst_t)/sizeof(int16_t); *size=sizeof(iLBC_Dec_Inst_t)/sizeof(int16_t);
if (*iLBC_decinst!=NULL) { if (*iLBC_decinst!=NULL) {
return(0); return(0);
@@ -45,8 +48,8 @@ int16_t WebRtcIlbcfix_DecoderAssign(iLBC_decinst_t **iLBC_decinst, int16_t *ILBC
} }
} }
int16_t WebRtcIlbcfix_EncoderCreate(iLBC_encinst_t **iLBC_encinst) { int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) {
*iLBC_encinst=(iLBC_encinst_t*)malloc(sizeof(iLBC_Enc_Inst_t)); *iLBC_encinst=(IlbcEncoderInstance*)malloc(sizeof(iLBC_Enc_Inst_t));
if (*iLBC_encinst!=NULL) { if (*iLBC_encinst!=NULL) {
WebRtcSpl_Init(); WebRtcSpl_Init();
return(0); return(0);
@@ -55,8 +58,8 @@ int16_t WebRtcIlbcfix_EncoderCreate(iLBC_encinst_t **iLBC_encinst) {
} }
} }
int16_t WebRtcIlbcfix_DecoderCreate(iLBC_decinst_t **iLBC_decinst) { int16_t WebRtcIlbcfix_DecoderCreate(IlbcDecoderInstance **iLBC_decinst) {
*iLBC_decinst=(iLBC_decinst_t*)malloc(sizeof(iLBC_Dec_Inst_t)); *iLBC_decinst=(IlbcDecoderInstance*)malloc(sizeof(iLBC_Dec_Inst_t));
if (*iLBC_decinst!=NULL) { if (*iLBC_decinst!=NULL) {
WebRtcSpl_Init(); WebRtcSpl_Init();
return(0); return(0);
@@ -65,19 +68,18 @@ int16_t WebRtcIlbcfix_DecoderCreate(iLBC_decinst_t **iLBC_decinst) {
} }
} }
int16_t WebRtcIlbcfix_EncoderFree(iLBC_encinst_t *iLBC_encinst) { int16_t WebRtcIlbcfix_EncoderFree(IlbcEncoderInstance *iLBC_encinst) {
free(iLBC_encinst); free(iLBC_encinst);
return(0); return(0);
} }
int16_t WebRtcIlbcfix_DecoderFree(iLBC_decinst_t *iLBC_decinst) { int16_t WebRtcIlbcfix_DecoderFree(IlbcDecoderInstance *iLBC_decinst) {
free(iLBC_decinst); free(iLBC_decinst);
return(0); return(0);
} }
int16_t WebRtcIlbcfix_EncoderInit(IlbcEncoderInstance* iLBCenc_inst,
int16_t WebRtcIlbcfix_EncoderInit(iLBC_encinst_t *iLBCenc_inst, int16_t mode) int16_t mode) {
{
if ((mode==20)||(mode==30)) { if ((mode==20)||(mode==30)) {
WebRtcIlbcfix_InitEncode((iLBC_Enc_Inst_t*) iLBCenc_inst, mode); WebRtcIlbcfix_InitEncode((iLBC_Enc_Inst_t*) iLBCenc_inst, mode);
return(0); return(0);
@@ -86,7 +88,7 @@ int16_t WebRtcIlbcfix_EncoderInit(iLBC_encinst_t *iLBCenc_inst, int16_t mode)
} }
} }
int16_t WebRtcIlbcfix_Encode(iLBC_encinst_t* iLBCenc_inst, int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
const int16_t* speechIn, const int16_t* speechIn,
int16_t len, int16_t len,
uint8_t* encoded) { uint8_t* encoded) {
@@ -120,7 +122,8 @@ int16_t WebRtcIlbcfix_Encode(iLBC_encinst_t* iLBCenc_inst,
} }
} }
int16_t WebRtcIlbcfix_DecoderInit(iLBC_decinst_t *iLBCdec_inst, int16_t mode) { int16_t WebRtcIlbcfix_DecoderInit(IlbcDecoderInstance* iLBCdec_inst,
int16_t mode) {
if ((mode==20)||(mode==30)) { if ((mode==20)||(mode==30)) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, mode, 1); WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, mode, 1);
return(0); return(0);
@@ -128,17 +131,17 @@ int16_t WebRtcIlbcfix_DecoderInit(iLBC_decinst_t *iLBCdec_inst, int16_t mode) {
return(-1); return(-1);
} }
} }
int16_t WebRtcIlbcfix_DecoderInit20Ms(iLBC_decinst_t *iLBCdec_inst) { int16_t WebRtcIlbcfix_DecoderInit20Ms(IlbcDecoderInstance *iLBCdec_inst) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 20, 1); WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 20, 1);
return(0); return(0);
} }
int16_t WebRtcIlbcfix_Decoderinit30Ms(iLBC_decinst_t *iLBCdec_inst) { int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 30, 1); WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 30, 1);
return(0); return(0);
} }
int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst,
const int16_t *encoded, const int16_t *encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
@@ -157,7 +160,9 @@ int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst,
if ((len==NO_OF_BYTES_30MS)|| if ((len==NO_OF_BYTES_30MS)||
(len==2*NO_OF_BYTES_30MS)|| (len==2*NO_OF_BYTES_30MS)||
(len==3*NO_OF_BYTES_30MS)) { (len==3*NO_OF_BYTES_30MS)) {
WebRtcIlbcfix_InitDecode(((iLBC_Dec_Inst_t*)iLBCdec_inst), 30, ((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer); WebRtcIlbcfix_InitDecode(
((iLBC_Dec_Inst_t*)iLBCdec_inst), 30,
((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer);
} else { } else {
/* Unsupported frame length */ /* Unsupported frame length */
return(-1); return(-1);
@@ -166,7 +171,9 @@ int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst,
if ((len==NO_OF_BYTES_20MS)|| if ((len==NO_OF_BYTES_20MS)||
(len==2*NO_OF_BYTES_20MS)|| (len==2*NO_OF_BYTES_20MS)||
(len==3*NO_OF_BYTES_20MS)) { (len==3*NO_OF_BYTES_20MS)) {
WebRtcIlbcfix_InitDecode(((iLBC_Dec_Inst_t*)iLBCdec_inst), 20, ((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer); WebRtcIlbcfix_InitDecode(
((iLBC_Dec_Inst_t*)iLBCdec_inst), 20,
((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer);
} else { } else {
/* Unsupported frame length */ /* Unsupported frame length */
return(-1); return(-1);
@@ -175,7 +182,11 @@ int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst,
} }
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) { while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(&decoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], (const uint16_t*) &encoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words], (iLBC_Dec_Inst_t*) iLBCdec_inst, 1); WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
i++; i++;
} }
/* iLBC does not support VAD/CNG yet */ /* iLBC does not support VAD/CNG yet */
@@ -183,7 +194,7 @@ int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst,
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl); return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
} }
int16_t WebRtcIlbcfix_Decode20Ms(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst,
const int16_t *encoded, const int16_t *encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
@@ -199,7 +210,11 @@ int16_t WebRtcIlbcfix_Decode20Ms(iLBC_decinst_t *iLBCdec_inst,
} }
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) { while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(&decoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], (const uint16_t*) &encoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words], (iLBC_Dec_Inst_t*) iLBCdec_inst, 1); WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
i++; i++;
} }
/* iLBC does not support VAD/CNG yet */ /* iLBC does not support VAD/CNG yet */
@@ -207,7 +222,7 @@ int16_t WebRtcIlbcfix_Decode20Ms(iLBC_decinst_t *iLBCdec_inst,
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl); return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
} }
int16_t WebRtcIlbcfix_Decode30Ms(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst,
const int16_t *encoded, const int16_t *encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
@@ -223,7 +238,11 @@ int16_t WebRtcIlbcfix_Decode30Ms(iLBC_decinst_t *iLBCdec_inst,
} }
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) { while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(&decoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], (const uint16_t*) &encoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words], (iLBC_Dec_Inst_t*) iLBCdec_inst, 1); WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
i++; i++;
} }
/* iLBC does not support VAD/CNG yet */ /* iLBC does not support VAD/CNG yet */
@@ -231,19 +250,24 @@ int16_t WebRtcIlbcfix_Decode30Ms(iLBC_decinst_t *iLBCdec_inst,
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl); return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
} }
int16_t WebRtcIlbcfix_DecodePlc(iLBC_decinst_t *iLBCdec_inst, int16_t *decoded, int16_t noOfLostFrames) { int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance* iLBCdec_inst,
int16_t* decoded,
int16_t noOfLostFrames) {
int i; int i;
uint16_t dummy; uint16_t dummy;
for (i=0;i<noOfLostFrames;i++) { for (i=0;i<noOfLostFrames;i++) {
/* call decoder */ /* call decoder */
WebRtcIlbcfix_DecodeImpl(&decoded[i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], &dummy, (iLBC_Dec_Inst_t*) iLBCdec_inst, 0); WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], &dummy,
(iLBC_Dec_Inst_t*)iLBCdec_inst, 0);
} }
return (noOfLostFrames*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl); return (noOfLostFrames*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
} }
int16_t WebRtcIlbcfix_NetEqPlc(iLBC_decinst_t *iLBCdec_inst, int16_t *decoded, int16_t noOfLostFrames) { int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance* iLBCdec_inst,
int16_t* decoded,
int16_t noOfLostFrames) {
/* Two input parameters not used, but needed for function pointers in NetEQ */ /* Two input parameters not used, but needed for function pointers in NetEQ */
(void)(decoded = NULL); (void)(decoded = NULL);
(void)(noOfLostFrames = 0); (void)(noOfLostFrames = 0);

View File

@@ -48,7 +48,7 @@ class AudioEncoderIlbc : public AudioEncoder {
int num_10ms_frames_buffered_; int num_10ms_frames_buffered_;
uint32_t first_timestamp_in_buffer_; uint32_t first_timestamp_in_buffer_;
int16_t input_buffer_[kMaxSamplesPerPacket]; int16_t input_buffer_[kMaxSamplesPerPacket];
iLBC_encinst_t* encoder_; IlbcEncoderInstance* encoder_;
}; };
} // namespace webrtc } // namespace webrtc

View File

@@ -29,9 +29,9 @@
* Customer has to cast instance to proper type * Customer has to cast instance to proper type
*/ */
typedef struct iLBC_encinst_t_ iLBC_encinst_t; typedef struct iLBC_encinst_t_ IlbcEncoderInstance;
typedef struct iLBC_decinst_t_ iLBC_decinst_t; typedef struct iLBC_decinst_t_ IlbcDecoderInstance;
/* /*
* Comfort noise constants * Comfort noise constants
@@ -60,10 +60,10 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_EncoderAssign(iLBC_encinst_t **iLBC_encinst, int16_t WebRtcIlbcfix_EncoderAssign(IlbcEncoderInstance **iLBC_encinst,
int16_t *ILBCENC_inst_Addr, int16_t *ILBCENC_inst_Addr,
int16_t *size); int16_t *size);
int16_t WebRtcIlbcfix_DecoderAssign(iLBC_decinst_t **iLBC_decinst, int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance **iLBC_decinst,
int16_t *ILBCDEC_inst_Addr, int16_t *ILBCDEC_inst_Addr,
int16_t *size); int16_t *size);
@@ -80,8 +80,8 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_EncoderCreate(iLBC_encinst_t **iLBC_encinst); int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst);
int16_t WebRtcIlbcfix_DecoderCreate(iLBC_decinst_t **iLBC_decinst); int16_t WebRtcIlbcfix_DecoderCreate(IlbcDecoderInstance **iLBC_decinst);
/**************************************************************************** /****************************************************************************
* WebRtcIlbcfix_XxxFree(...) * WebRtcIlbcfix_XxxFree(...)
@@ -95,8 +95,8 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_EncoderFree(iLBC_encinst_t *iLBC_encinst); int16_t WebRtcIlbcfix_EncoderFree(IlbcEncoderInstance *iLBC_encinst);
int16_t WebRtcIlbcfix_DecoderFree(iLBC_decinst_t *iLBC_decinst); int16_t WebRtcIlbcfix_DecoderFree(IlbcDecoderInstance *iLBC_decinst);
/**************************************************************************** /****************************************************************************
@@ -113,7 +113,7 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_EncoderInit(iLBC_encinst_t *iLBCenc_inst, int16_t WebRtcIlbcfix_EncoderInit(IlbcEncoderInstance *iLBCenc_inst,
int16_t frameLen); int16_t frameLen);
/**************************************************************************** /****************************************************************************
@@ -135,7 +135,7 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_Encode(iLBC_encinst_t *iLBCenc_inst, int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance *iLBCenc_inst,
const int16_t *speechIn, const int16_t *speechIn,
int16_t len, int16_t len,
uint8_t* encoded); uint8_t* encoded);
@@ -148,18 +148,17 @@ extern "C" {
* not needed to specify the frame length with a variable. * not needed to specify the frame length with a variable.
* *
* Input: * Input:
* - iLBC_decinst_t : iLBC instance, i.e. the user that should receive * - IlbcDecoderInstance : iLBC decoder instance
* be initialized * - frameLen : The frame length of the codec 20/30 (ms)
* - frameLen : The frame length of the codec 20/30 (ms)
* *
* Return value : 0 - Ok * Return value : 0 - Ok
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_DecoderInit(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_DecoderInit(IlbcDecoderInstance *iLBCdec_inst,
int16_t frameLen); int16_t frameLen);
int16_t WebRtcIlbcfix_DecoderInit20Ms(iLBC_decinst_t *iLBCdec_inst); int16_t WebRtcIlbcfix_DecoderInit20Ms(IlbcDecoderInstance *iLBCdec_inst);
int16_t WebRtcIlbcfix_Decoderinit30Ms(iLBC_decinst_t *iLBCdec_inst); int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst);
/**************************************************************************** /****************************************************************************
* WebRtcIlbcfix_Decode(...) * WebRtcIlbcfix_Decode(...)
@@ -181,17 +180,17 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_Decode(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst,
const int16_t* encoded, const int16_t* encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
int16_t *speechType); int16_t *speechType);
int16_t WebRtcIlbcfix_Decode20Ms(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst,
const int16_t *encoded, const int16_t *encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
int16_t *speechType); int16_t *speechType);
int16_t WebRtcIlbcfix_Decode30Ms(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst,
const int16_t *encoded, const int16_t *encoded,
int16_t len, int16_t len,
int16_t *decoded, int16_t *decoded,
@@ -215,7 +214,7 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_DecodePlc(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance *iLBCdec_inst,
int16_t *decoded, int16_t *decoded,
int16_t noOfLostFrames); int16_t noOfLostFrames);
@@ -237,7 +236,7 @@ extern "C" {
* -1 - Error * -1 - Error
*/ */
int16_t WebRtcIlbcfix_NetEqPlc(iLBC_decinst_t *iLBCdec_inst, int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance *iLBCdec_inst,
int16_t *decoded, int16_t *decoded,
int16_t noOfLostFrames); int16_t noOfLostFrames);

View File

@@ -52,8 +52,8 @@ int main(int argc, char* argv[])
int packetlosscount = 0; int packetlosscount = 0;
int frameLen; int frameLen;
int16_t speechType; int16_t speechType;
iLBC_encinst_t *Enc_Inst; IlbcEncoderInstance *Enc_Inst;
iLBC_decinst_t *Dec_Inst; IlbcDecoderInstance *Dec_Inst;
#ifdef __ILBC_WITH_40BITACC #ifdef __ILBC_WITH_40BITACC
/* Doublecheck that long long exists */ /* Doublecheck that long long exists */

View File

@@ -44,8 +44,8 @@ int main(int argc, char* argv[])
short len, mode, pli; short len, mode, pli;
int blockcount = 0; int blockcount = 0;
iLBC_encinst_t *Enc_Inst; IlbcEncoderInstance *Enc_Inst;
iLBC_decinst_t *Dec_Inst; IlbcDecoderInstance *Dec_Inst;
#ifdef JUNK_DATA #ifdef JUNK_DATA
int i; int i;
FILE *seedfile; FILE *seedfile;

View File

@@ -119,7 +119,7 @@ class AudioDecoderIlbc : public AudioDecoder {
virtual int Init(); virtual int Init();
private: private:
iLBC_decinst_t* dec_state_; IlbcDecoderInstance* dec_state_;
DISALLOW_COPY_AND_ASSIGN(AudioDecoderIlbc); DISALLOW_COPY_AND_ASSIGN(AudioDecoderIlbc);
}; };
#endif #endif

View File

@@ -204,7 +204,7 @@ WebRtcVadInst *VAD_inst[2];
int16_t AMRWB_bitrate; int16_t AMRWB_bitrate;
#endif #endif
#ifdef CODEC_ILBC #ifdef CODEC_ILBC
iLBC_encinst_t *iLBCenc_inst[2]; IlbcEncoderInstance *iLBCenc_inst[2];
#endif #endif
#ifdef CODEC_ISAC #ifdef CODEC_ISAC
ISACStruct *ISAC_inst[2]; ISACStruct *ISAC_inst[2];

View File

@@ -292,7 +292,7 @@ int32_t AudioDeviceMac::Init()
if (_paRenderBuffer == NULL) if (_paRenderBuffer == NULL)
{ {
_paRenderBuffer = new PaUtilRingBuffer; _paRenderBuffer = new PaUtilRingBuffer;
ring_buffer_size_t bufSize = -1; PaRingBufferSize bufSize = -1;
bufSize = PaUtil_InitializeRingBuffer(_paRenderBuffer, sizeof(SInt16), bufSize = PaUtil_InitializeRingBuffer(_paRenderBuffer, sizeof(SInt16),
_renderBufSizeSamples, _renderBufSizeSamples,
_renderBufData); _renderBufData);
@@ -318,7 +318,7 @@ int32_t AudioDeviceMac::Init()
if (_paCaptureBuffer == NULL) if (_paCaptureBuffer == NULL)
{ {
_paCaptureBuffer = new PaUtilRingBuffer; _paCaptureBuffer = new PaUtilRingBuffer;
ring_buffer_size_t bufSize = -1; PaRingBufferSize bufSize = -1;
bufSize = PaUtil_InitializeRingBuffer(_paCaptureBuffer, bufSize = PaUtil_InitializeRingBuffer(_paCaptureBuffer,
sizeof(Float32), sizeof(Float32),
_captureBufSizeSamples, _captureBufSizeSamples,
@@ -2915,7 +2915,7 @@ OSStatus AudioDeviceMac::implDeviceIOProc(const AudioBufferList *inputData,
} }
} }
ring_buffer_size_t bufSizeSamples = PaRingBufferSize bufSizeSamples =
PaUtil_GetRingBufferReadAvailable(_paRenderBuffer); PaUtil_GetRingBufferReadAvailable(_paRenderBuffer);
int32_t renderDelayUs = static_cast<int32_t> (1e-3 * (outputTimeNs - nowNs) int32_t renderDelayUs = static_cast<int32_t> (1e-3 * (outputTimeNs - nowNs)
@@ -2933,7 +2933,7 @@ OSStatus AudioDeviceMac::implOutConverterProc(UInt32 *numberDataPackets,
AudioBufferList *data) AudioBufferList *data)
{ {
assert(data->mNumberBuffers == 1); assert(data->mNumberBuffers == 1);
ring_buffer_size_t numSamples = *numberDataPackets PaRingBufferSize numSamples = *numberDataPackets
* _outDesiredFormat.mChannelsPerFrame; * _outDesiredFormat.mChannelsPerFrame;
data->mBuffers->mNumberChannels = _outDesiredFormat.mChannelsPerFrame; data->mBuffers->mNumberChannels = _outDesiredFormat.mChannelsPerFrame;
@@ -2994,7 +2994,7 @@ OSStatus AudioDeviceMac::implInDeviceIOProc(const AudioBufferList *inputData,
return 0; return 0;
} }
ring_buffer_size_t bufSizeSamples = PaRingBufferSize bufSizeSamples =
PaUtil_GetRingBufferReadAvailable(_paCaptureBuffer); PaUtil_GetRingBufferReadAvailable(_paCaptureBuffer);
int32_t captureDelayUs = static_cast<int32_t> (1e-3 * (nowNs - inputTimeNs) int32_t captureDelayUs = static_cast<int32_t> (1e-3 * (nowNs - inputTimeNs)
@@ -3007,7 +3007,7 @@ OSStatus AudioDeviceMac::implInDeviceIOProc(const AudioBufferList *inputData,
AtomicSet32(&_captureDelayUs, captureDelayUs); AtomicSet32(&_captureDelayUs, captureDelayUs);
assert(inputData->mNumberBuffers == 1); assert(inputData->mNumberBuffers == 1);
ring_buffer_size_t numSamples = inputData->mBuffers->mDataByteSize PaRingBufferSize numSamples = inputData->mBuffers->mDataByteSize
* _inStreamFormat.mChannelsPerFrame / _inStreamFormat.mBytesPerPacket; * _inStreamFormat.mChannelsPerFrame / _inStreamFormat.mBytesPerPacket;
PaUtil_WriteRingBuffer(_paCaptureBuffer, inputData->mBuffers->mData, PaUtil_WriteRingBuffer(_paCaptureBuffer, inputData->mBuffers->mData,
numSamples); numSamples);
@@ -3026,7 +3026,7 @@ OSStatus AudioDeviceMac::implInConverterProc(UInt32 *numberDataPackets,
AudioBufferList *data) AudioBufferList *data)
{ {
assert(data->mNumberBuffers == 1); assert(data->mNumberBuffers == 1);
ring_buffer_size_t numSamples = *numberDataPackets PaRingBufferSize numSamples = *numberDataPackets
* _inStreamFormat.mChannelsPerFrame; * _inStreamFormat.mChannelsPerFrame;
while (PaUtil_GetRingBufferReadAvailable(_paCaptureBuffer) < numSamples) while (PaUtil_GetRingBufferReadAvailable(_paCaptureBuffer) < numSamples)
@@ -3054,7 +3054,7 @@ OSStatus AudioDeviceMac::implInConverterProc(UInt32 *numberDataPackets,
// Pass the read pointer directly to the converter to avoid a memcpy. // Pass the read pointer directly to the converter to avoid a memcpy.
void* dummyPtr; void* dummyPtr;
ring_buffer_size_t dummySize; PaRingBufferSize dummySize;
PaUtil_GetRingBufferReadRegions(_paCaptureBuffer, numSamples, PaUtil_GetRingBufferReadRegions(_paCaptureBuffer, numSamples,
&data->mBuffers->mData, &numSamples, &data->mBuffers->mData, &numSamples,
&dummyPtr, &dummySize); &dummyPtr, &dummySize);
@@ -3075,7 +3075,7 @@ bool AudioDeviceMac::RunRender(void* ptrThis)
bool AudioDeviceMac::RenderWorkerThread() bool AudioDeviceMac::RenderWorkerThread()
{ {
ring_buffer_size_t numSamples = ENGINE_PLAY_BUF_SIZE_IN_SAMPLES PaRingBufferSize numSamples = ENGINE_PLAY_BUF_SIZE_IN_SAMPLES
* _outDesiredFormat.mChannelsPerFrame; * _outDesiredFormat.mChannelsPerFrame;
while (PaUtil_GetRingBufferWriteAvailable(_paRenderBuffer) while (PaUtil_GetRingBufferWriteAvailable(_paRenderBuffer)
- _renderDelayOffsetSamples < numSamples) - _renderDelayOffsetSamples < numSamples)

View File

@@ -63,8 +63,10 @@
* Initialize FIFO. * Initialize FIFO.
* elementCount must be power of 2, returns -1 if not. * elementCount must be power of 2, returns -1 if not.
*/ */
ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ) PaRingBufferSize PaUtil_InitializeRingBuffer(PaUtilRingBuffer* rbuf,
{ PaRingBufferSize elementSizeBytes,
PaRingBufferSize elementCount,
void* dataPtr) {
if( ((elementCount-1) & elementCount) != 0) return -1; /* Not Power of two. */ if( ((elementCount-1) & elementCount) != 0) return -1; /* Not Power of two. */
rbuf->bufferSize = elementCount; rbuf->bufferSize = elementCount;
rbuf->buffer = (char *)dataPtr; rbuf->buffer = (char *)dataPtr;
@@ -77,14 +79,14 @@ ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buf
/*************************************************************************** /***************************************************************************
** Return number of elements available for reading. */ ** Return number of elements available for reading. */
ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ) PaRingBufferSize PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf )
{ {
PaUtil_ReadMemoryBarrier(); PaUtil_ReadMemoryBarrier();
return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask );
} }
/*************************************************************************** /***************************************************************************
** Return number of elements available for writing. */ ** Return number of elements available for writing. */
ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ) PaRingBufferSize PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf )
{ {
/* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */ /* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */
return ( rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf)); return ( rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf));
@@ -103,19 +105,21 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf )
** If non-contiguous, size2 will be the size of second region. ** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller. ** Returns room available to be written or elementCount, whichever is smaller.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, PaRingBufferSize PaUtil_GetRingBufferWriteRegions(PaUtilRingBuffer* rbuf,
void **dataPtr1, ring_buffer_size_t *sizePtr1, PaRingBufferSize elementCount,
void **dataPtr2, ring_buffer_size_t *sizePtr2 ) void** dataPtr1,
{ PaRingBufferSize* sizePtr1,
ring_buffer_size_t index; void** dataPtr2,
ring_buffer_size_t available = PaUtil_GetRingBufferWriteAvailable( rbuf ); PaRingBufferSize* sizePtr2) {
PaRingBufferSize index;
PaRingBufferSize available = PaUtil_GetRingBufferWriteAvailable( rbuf );
if( elementCount > available ) elementCount = available; if( elementCount > available ) elementCount = available;
/* Check to see if write is not contiguous. */ /* Check to see if write is not contiguous. */
index = rbuf->writeIndex & rbuf->smallMask; index = rbuf->writeIndex & rbuf->smallMask;
if( (index + elementCount) > rbuf->bufferSize ) if( (index + elementCount) > rbuf->bufferSize )
{ {
/* Write data in two blocks that wrap the buffer. */ /* Write data in two blocks that wrap the buffer. */
ring_buffer_size_t firstHalf = rbuf->bufferSize - index; PaRingBufferSize firstHalf = rbuf->bufferSize - index;
*dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
*sizePtr1 = firstHalf; *sizePtr1 = firstHalf;
*dataPtr2 = &rbuf->buffer[0]; *dataPtr2 = &rbuf->buffer[0];
@@ -134,8 +138,9 @@ ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, rin
/*************************************************************************** /***************************************************************************
*/ */
ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) PaRingBufferSize PaUtil_AdvanceRingBufferWriteIndex(
{ PaUtilRingBuffer* rbuf,
PaRingBufferSize elementCount) {
/* we need to ensure that previous writes are seen before we update the write index */ /* we need to ensure that previous writes are seen before we update the write index */
PaUtil_WriteMemoryBarrier(); PaUtil_WriteMemoryBarrier();
return rbuf->writeIndex = (rbuf->writeIndex + elementCount) & rbuf->bigMask; return rbuf->writeIndex = (rbuf->writeIndex + elementCount) & rbuf->bigMask;
@@ -147,19 +152,21 @@ ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, r
** If non-contiguous, size2 will be the size of second region. ** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller. ** Returns room available to be written or elementCount, whichever is smaller.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, PaRingBufferSize PaUtil_GetRingBufferReadRegions(PaUtilRingBuffer* rbuf,
void **dataPtr1, ring_buffer_size_t *sizePtr1, PaRingBufferSize elementCount,
void **dataPtr2, ring_buffer_size_t *sizePtr2 ) void** dataPtr1,
{ PaRingBufferSize* sizePtr1,
ring_buffer_size_t index; void** dataPtr2,
ring_buffer_size_t available = PaUtil_GetRingBufferReadAvailable( rbuf ); PaRingBufferSize* sizePtr2) {
PaRingBufferSize index;
PaRingBufferSize available = PaUtil_GetRingBufferReadAvailable( rbuf );
if( elementCount > available ) elementCount = available; if( elementCount > available ) elementCount = available;
/* Check to see if read is not contiguous. */ /* Check to see if read is not contiguous. */
index = rbuf->readIndex & rbuf->smallMask; index = rbuf->readIndex & rbuf->smallMask;
if( (index + elementCount) > rbuf->bufferSize ) if( (index + elementCount) > rbuf->bufferSize )
{ {
/* Write data in two blocks that wrap the buffer. */ /* Write data in two blocks that wrap the buffer. */
ring_buffer_size_t firstHalf = rbuf->bufferSize - index; PaRingBufferSize firstHalf = rbuf->bufferSize - index;
*dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
*sizePtr1 = firstHalf; *sizePtr1 = firstHalf;
*dataPtr2 = &rbuf->buffer[0]; *dataPtr2 = &rbuf->buffer[0];
@@ -176,8 +183,9 @@ ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring
} }
/*************************************************************************** /***************************************************************************
*/ */
ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) PaRingBufferSize PaUtil_AdvanceRingBufferReadIndex(
{ PaUtilRingBuffer* rbuf,
PaRingBufferSize elementCount) {
/* we need to ensure that previous writes are always seen before updating the index. */ /* we need to ensure that previous writes are always seen before updating the index. */
PaUtil_WriteMemoryBarrier(); PaUtil_WriteMemoryBarrier();
return rbuf->readIndex = (rbuf->readIndex + elementCount) & rbuf->bigMask; return rbuf->readIndex = (rbuf->readIndex + elementCount) & rbuf->bigMask;
@@ -185,9 +193,10 @@ ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ri
/*************************************************************************** /***************************************************************************
** Return elements written. */ ** Return elements written. */
ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ) PaRingBufferSize PaUtil_WriteRingBuffer(PaUtilRingBuffer* rbuf,
{ const void* data,
ring_buffer_size_t size1, size2, numWritten; PaRingBufferSize elementCount) {
PaRingBufferSize size1, size2, numWritten;
void *data1, *data2; void *data1, *data2;
numWritten = PaUtil_GetRingBufferWriteRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); numWritten = PaUtil_GetRingBufferWriteRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 );
if( size2 > 0 ) if( size2 > 0 )
@@ -207,9 +216,10 @@ ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *d
/*************************************************************************** /***************************************************************************
** Return elements read. */ ** Return elements read. */
ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ) PaRingBufferSize PaUtil_ReadRingBuffer(PaUtilRingBuffer* rbuf,
{ void* data,
ring_buffer_size_t size1, size2, numRead; PaRingBufferSize elementCount) {
PaRingBufferSize size1, size2, numRead;
void *data1, *data2; void *data1, *data2;
numRead = PaUtil_GetRingBufferReadRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); numRead = PaUtil_GetRingBufferReadRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 );
if( size2 > 0 ) if( size2 > 0 )

View File

@@ -69,15 +69,15 @@
#if defined(__APPLE__) #if defined(__APPLE__)
#include <sys/types.h> #include <sys/types.h>
typedef int32_t ring_buffer_size_t; typedef int32_t PaRingBufferSize;
#elif defined( __GNUC__ ) #elif defined( __GNUC__ )
typedef long ring_buffer_size_t; typedef long PaRingBufferSize;
#elif (_MSC_VER >= 1400) #elif (_MSC_VER >= 1400)
typedef long ring_buffer_size_t; typedef long PaRingBufferSize;
#elif defined(_MSC_VER) || defined(__BORLANDC__) #elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef long ring_buffer_size_t; typedef long PaRingBufferSize;
#else #else
typedef long ring_buffer_size_t; typedef long PaRingBufferSize;
#endif #endif
@@ -89,12 +89,12 @@ extern "C"
typedef struct PaUtilRingBuffer typedef struct PaUtilRingBuffer
{ {
ring_buffer_size_t bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ PaRingBufferSize bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */
ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ PaRingBufferSize writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */
ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ PaRingBufferSize readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */
ring_buffer_size_t bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ PaRingBufferSize bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */
ring_buffer_size_t smallMask; /**< Used for fitting indices to buffer. */ PaRingBufferSize smallMask; /**< Used for fitting indices to buffer. */
ring_buffer_size_t elementSizeBytes; /**< Number of bytes per element. */ PaRingBufferSize elementSizeBytes; /**< Number of bytes per element. */
char *buffer; /**< Pointer to the buffer containing the actual data. */ char *buffer; /**< Pointer to the buffer containing the actual data. */
}PaUtilRingBuffer; }PaUtilRingBuffer;
@@ -111,7 +111,7 @@ typedef struct PaUtilRingBuffer
@return -1 if elementCount is not a power of 2, otherwise 0. @return -1 if elementCount is not a power of 2, otherwise 0.
*/ */
ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ); PaRingBufferSize PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, PaRingBufferSize elementSizeBytes, PaRingBufferSize elementCount, void *dataPtr );
/** Clear buffer. Should only be called when buffer is NOT being read. /** Clear buffer. Should only be called when buffer is NOT being read.
@@ -125,7 +125,7 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf );
@return The number of elements available for writing. @return The number of elements available for writing.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); PaRingBufferSize PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf );
/** Retrieve the number of elements available in the ring buffer for reading. /** Retrieve the number of elements available in the ring buffer for reading.
@@ -133,7 +133,7 @@ ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf );
@return The number of elements available for reading. @return The number of elements available for reading.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); PaRingBufferSize PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf );
/** Write data to the ring buffer. /** Write data to the ring buffer.
@@ -145,7 +145,7 @@ ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf );
@return The number of elements written. @return The number of elements written.
*/ */
ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ); PaRingBufferSize PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, PaRingBufferSize elementCount );
/** Read data from the ring buffer. /** Read data from the ring buffer.
@@ -157,7 +157,7 @@ ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *d
@return The number of elements read. @return The number of elements read.
*/ */
ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ); PaRingBufferSize PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, PaRingBufferSize elementCount );
/** Get address of region(s) to which we can write data. /** Get address of region(s) to which we can write data.
@@ -179,9 +179,9 @@ ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ri
@return The room available to be written or elementCount, whichever is smaller. @return The room available to be written or elementCount, whichever is smaller.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, PaRingBufferSize PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, PaRingBufferSize elementCount,
void **dataPtr1, ring_buffer_size_t *sizePtr1, void **dataPtr1, PaRingBufferSize *sizePtr1,
void **dataPtr2, ring_buffer_size_t *sizePtr2 ); void **dataPtr2, PaRingBufferSize *sizePtr2 );
/** Advance the write index to the next location to be written. /** Advance the write index to the next location to be written.
@@ -191,7 +191,7 @@ ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, rin
@return The new position. @return The new position.
*/ */
ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); PaRingBufferSize PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, PaRingBufferSize elementCount );
/** Get address of region(s) from which we can write data. /** Get address of region(s) from which we can write data.
@@ -213,9 +213,9 @@ ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, r
@return The number of elements available for reading. @return The number of elements available for reading.
*/ */
ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, PaRingBufferSize PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, PaRingBufferSize elementCount,
void **dataPtr1, ring_buffer_size_t *sizePtr1, void **dataPtr1, PaRingBufferSize *sizePtr1,
void **dataPtr2, ring_buffer_size_t *sizePtr2 ); void **dataPtr2, PaRingBufferSize *sizePtr2 );
/** Advance the read index to the next location to be read. /** Advance the read index to the next location to be read.
@@ -225,7 +225,7 @@ ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring
@return The new position. @return The new position.
*/ */
ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); PaRingBufferSize PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, PaRingBufferSize elementCount );
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -11,13 +11,12 @@
#include <list> #include <list>
#include "vpx/vpx_encoder.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/modules/video_coding/utility/include/frame_dropper.h" #include "webrtc/modules/video_coding/utility/include/frame_dropper.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
// libvpx forward declaration.
typedef struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t;
namespace webrtc { namespace webrtc {
struct CodecSpecificInfoVP8; struct CodecSpecificInfoVP8;

View File

@@ -12,12 +12,11 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_
#include "vpx/vpx_encoder.h"
#include "webrtc/common_video/interface/video_image.h" #include "webrtc/common_video/interface/video_image.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
// libvpx forward declaration.
typedef struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t;
namespace webrtc { namespace webrtc {
struct CodecSpecificInfoVP8; struct CodecSpecificInfoVP8;

View File

@@ -378,7 +378,7 @@ int VP9DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) {
return ret_val; return ret_val;
} }
if (decoder_ == NULL) { if (decoder_ == NULL) {
decoder_ = new vpx_dec_ctx_t; decoder_ = new vpx_codec_ctx_t;
} }
vpx_codec_dec_cfg_t cfg; vpx_codec_dec_cfg_t cfg;
// Setting number of threads to a constant value (1) // Setting number of threads to a constant value (1)

View File

@@ -14,13 +14,8 @@
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
// VPX forward declaration #include "vpx/vpx_decoder.h"
typedef struct vpx_codec_ctx vpx_codec_ctx_t; #include "vpx/vpx_encoder.h"
typedef struct vpx_codec_ctx vpx_dec_ctx_t;
typedef struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t;
typedef struct vpx_image vpx_image_t;
typedef struct vpx_ref_frame vpx_ref_frame_t;
struct vpx_codec_cx_pkt;
namespace webrtc { namespace webrtc {
@@ -106,7 +101,7 @@ class VP9DecoderImpl : public VP9Decoder {
I420VideoFrame decoded_image_; I420VideoFrame decoded_image_;
DecodedImageCallback* decode_complete_callback_; DecodedImageCallback* decode_complete_callback_;
bool inited_; bool inited_;
vpx_dec_ctx_t* decoder_; vpx_codec_ctx_t* decoder_;
VideoCodec codec_; VideoCodec codec_;
bool key_frame_required_; bool key_frame_required_;
}; };

View File

@@ -92,9 +92,9 @@ const int kForever = -1;
#if _MSC_VER < 1700 #if _MSC_VER < 1700
#define alignof(t) __alignof(t) #define alignof(t) __alignof(t)
#endif #endif
#else // !WEBRTC_WIN #else // !WEBRTC_WIN
#define alignof(t) __alignof__(t) #define alignof(t) __alignof__(t)
#endif // !WEBRTC_WIN #endif // !WEBRTC_WIN
#define RTC_IS_ALIGNED(p, a) (0==(reinterpret_cast<uintptr_t>(p) & ((a)-1))) #define RTC_IS_ALIGNED(p, a) (0==(reinterpret_cast<uintptr_t>(p) & ((a)-1)))
#define ALIGNP(p, t) \ #define ALIGNP(p, t) \
(reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \ (reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \