Fixing lint warnings from previous commit
In this CL I have removed (almost) all lint warnings I got for this commit: https://code.google.com/p/webrtc/source/detail?r=3454. The only warning not fixed is a warning about usage of non-const reference. This will be fixed in a separate CL. BUG=issue1372 Review URL: https://webrtc-codereview.appspot.com/1091006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3510 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -17,8 +17,6 @@
|
|||||||
// references, where appropriate.
|
// references, where appropriate.
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_codec_database.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_codec_database.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_common_defs.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_common_defs.h"
|
||||||
#include "webrtc/system_wrappers/interface/trace.h"
|
#include "webrtc/system_wrappers/interface/trace.h"
|
||||||
|
|
||||||
@@ -34,11 +32,11 @@
|
|||||||
#include "webrtc/modules/audio_coding/neteq/interface/webrtc_neteq.h"
|
#include "webrtc/modules/audio_coding/neteq/interface/webrtc_neteq.h"
|
||||||
#ifdef WEBRTC_CODEC_ISAC
|
#ifdef WEBRTC_CODEC_ISAC
|
||||||
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
|
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_isac.h"
|
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_isac_macros.h"
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_ISACFX
|
#ifdef WEBRTC_CODEC_ISACFX
|
||||||
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
|
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
|
||||||
|
#endif
|
||||||
|
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_isac.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_isac.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_isac_macros.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_isac_macros.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -51,15 +49,15 @@
|
|||||||
#include "webrtc/modules/audio_coding/main/source/acm_ilbc.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_ilbc.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_AMR
|
#ifdef WEBRTC_CODEC_AMR
|
||||||
#include "amr_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/amr/include/amr_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_amr.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_amr.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_AMRWB
|
#ifdef WEBRTC_CODEC_AMRWB
|
||||||
#include "amrwb_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/amrwb/include/amrwb_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_amrwb.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_amrwb.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_CELT
|
#ifdef WEBRTC_CODEC_CELT
|
||||||
#include "celt_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/celt/include/celt_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_celt.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_celt.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_G722
|
#ifdef WEBRTC_CODEC_G722
|
||||||
@@ -67,23 +65,23 @@
|
|||||||
#include "webrtc/modules/audio_coding/main/source/acm_g722.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_g722.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_G722_1
|
#ifdef WEBRTC_CODEC_G722_1
|
||||||
#include "g7221_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/g7221/include/g7221_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_g7221.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_g7221.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_G722_1C
|
#ifdef WEBRTC_CODEC_G722_1C
|
||||||
#include "g7221c_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/g7221c/include/g7221c_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_g7221c.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_g7221c.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_G729
|
#ifdef WEBRTC_CODEC_G729
|
||||||
#include "g729_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/g729/include/g729_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_g729.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_g729.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_G729_1
|
#ifdef WEBRTC_CODEC_G729_1
|
||||||
#include "g7291_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/g7291/include/g7291_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_g7291.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_g7291.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_GSMFR
|
#ifdef WEBRTC_CODEC_GSMFR
|
||||||
#include "gsmfr_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/gsmfr/include/gsmfr_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_gsmfr.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_gsmfr.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
@@ -91,7 +89,7 @@
|
|||||||
#include "webrtc/modules/audio_coding/main/source/acm_opus.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_opus.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_SPEEX
|
#ifdef WEBRTC_CODEC_SPEEX
|
||||||
#include "speex_interface.h"
|
#include "webrtc/modules/audio_coding/codecs/speex/include/speex_interface.h"
|
||||||
#include "webrtc/modules/audio_coding/main/source/acm_speex.h"
|
#include "webrtc/modules/audio_coding/main/source/acm_speex.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_AVT
|
#ifdef WEBRTC_CODEC_AVT
|
||||||
@@ -417,45 +415,6 @@ enum {
|
|||||||
kInvalidRate = -50
|
kInvalidRate = -50
|
||||||
};
|
};
|
||||||
|
|
||||||
// Gets the codec id number from the database. If there is some mismatch in
|
|
||||||
// the codec settings, an error message will be recorded in the error string.
|
|
||||||
// NOTE! Only the first mismatch found will be recorded in the error string.
|
|
||||||
int ACMCodecDB::CodecNumber(const CodecInst* codec_inst, int* mirror_id,
|
|
||||||
char* err_message, int max_message_len_byte) {
|
|
||||||
int codec_id = ACMCodecDB::CodecNumber(codec_inst, mirror_id);
|
|
||||||
|
|
||||||
// Write error message if ACMCodecDB::CodecNumber() returned error.
|
|
||||||
if ((codec_id < 0) && (err_message != NULL)) {
|
|
||||||
char my_err_msg[1000];
|
|
||||||
|
|
||||||
if (codec_id == kInvalidCodec) {
|
|
||||||
sprintf(my_err_msg, "Call to ACMCodecDB::CodecNumber failed, Codec not "
|
|
||||||
"found");
|
|
||||||
} else if (codec_id == kInvalidPayloadtype) {
|
|
||||||
sprintf(my_err_msg, "Call to ACMCodecDB::CodecNumber failed, payload "
|
|
||||||
"number %d is out of range for %s", codec_inst->pltype,
|
|
||||||
codec_inst->plname);
|
|
||||||
} else if (codec_id == kInvalidPacketSize) {
|
|
||||||
sprintf(my_err_msg, "Call to ACMCodecDB::CodecNumber failed, Packet "
|
|
||||||
"size is out of range for %s", codec_inst->plname);
|
|
||||||
} else if (codec_id == kInvalidRate) {
|
|
||||||
sprintf(my_err_msg, "Call to ACMCodecDB::CodecNumber failed, rate=%d "
|
|
||||||
"is not a valid rate for %s", codec_inst->rate,
|
|
||||||
codec_inst->plname);
|
|
||||||
} else {
|
|
||||||
// Other error
|
|
||||||
sprintf(my_err_msg, "invalid codec parameters to be registered, "
|
|
||||||
"ACMCodecDB::CodecNumber failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
strncpy(err_message, my_err_msg, max_message_len_byte - 1);
|
|
||||||
// make sure that the message is null-terminated.
|
|
||||||
err_message[max_message_len_byte - 1] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
return codec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gets the codec id number from the database. If there is some mismatch in
|
// Gets the codec id number from the database. If there is some mismatch in
|
||||||
// the codec settings, the function will return an error code.
|
// the codec settings, the function will return an error code.
|
||||||
// NOTE! The first mismatch found will generate the return value.
|
// NOTE! The first mismatch found will generate the return value.
|
||||||
|
|||||||
@@ -240,14 +240,8 @@ class ACMCodecDB {
|
|||||||
// Output:
|
// Output:
|
||||||
// [mirror_id] - mirror id, which most often is the same as the return
|
// [mirror_id] - mirror id, which most often is the same as the return
|
||||||
// value, see above.
|
// value, see above.
|
||||||
// [err_message] - if present, in the event of a mismatch found between the
|
|
||||||
// input and the database, a descriptive error message is
|
|
||||||
// written here.
|
|
||||||
// [err_message] - if present, the length of error message is returned here.
|
|
||||||
// Return:
|
// Return:
|
||||||
// codec id if successful, otherwise < 0.
|
// codec id if successful, otherwise < 0.
|
||||||
static int CodecNumber(const CodecInst* codec_inst, int* mirror_id,
|
|
||||||
char* err_message, int max_message_len_byte);
|
|
||||||
static int CodecNumber(const CodecInst* codec_inst, int* mirror_id);
|
static int CodecNumber(const CodecInst* codec_inst, int* mirror_id);
|
||||||
static int CodecId(const CodecInst* codec_inst);
|
static int CodecId(const CodecInst* codec_inst);
|
||||||
static int CodecId(const char* payload_name, int frequency, int channels);
|
static int CodecId(const char* payload_name, int frequency, int channels);
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ void ACMOpus::DestructDecoderSafe() {
|
|||||||
|
|
||||||
void ACMOpus::InternalDestructEncoderInst(void* ptr_inst) {
|
void ACMOpus::InternalDestructEncoderInst(void* ptr_inst) {
|
||||||
if (ptr_inst != NULL) {
|
if (ptr_inst != NULL) {
|
||||||
WebRtcOpus_EncoderFree((OpusEncInst*) ptr_inst);
|
WebRtcOpus_EncoderFree(reinterpret_cast<OpusEncInst*>(ptr_inst));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,12 +78,12 @@ WebRtc_Word32 AudioCodingModule::Codec(const char* payload_name,
|
|||||||
// Checks the validity of the parameters of the given codec
|
// Checks the validity of the parameters of the given codec
|
||||||
bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
|
bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
|
||||||
int mirror_id;
|
int mirror_id;
|
||||||
char err_msg[500];
|
|
||||||
|
|
||||||
int codec_number = ACMCodecDB::CodecNumber(&codec, &mirror_id, err_msg, 500);
|
int codec_number = ACMCodecDB::CodecNumber(&codec, &mirror_id);
|
||||||
|
|
||||||
if (codec_number < 0) {
|
if (codec_number < 0) {
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, err_msg);
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1,
|
||||||
|
"Invalid codec settings.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -802,12 +802,10 @@ static int IsValidSendCodec(const CodecInst& send_codec,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char error_message[500];
|
int codec_id = ACMCodecDB::CodecNumber(&send_codec, mirror_id);
|
||||||
int codec_id = ACMCodecDB::CodecNumber(&send_codec, mirror_id, error_message,
|
|
||||||
sizeof(error_message));
|
|
||||||
if (codec_id < 0) {
|
if (codec_id < 0) {
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, acm_id,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, acm_id,
|
||||||
error_message);
|
"Invalid settings for the send codec.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1471,7 +1469,8 @@ int AudioCodingModuleImpl::PreprocessToAddData(const AudioFrame& in_frame,
|
|||||||
timestamp_diff = in_frame.timestamp_ - last_in_timestamp_;
|
timestamp_diff = in_frame.timestamp_ - last_in_timestamp_;
|
||||||
}
|
}
|
||||||
preprocess_frame_.timestamp_ = last_timestamp_ +
|
preprocess_frame_.timestamp_ = last_timestamp_ +
|
||||||
(WebRtc_UWord32)(timestamp_diff * ((double) send_codec_inst_.plfreq /
|
static_cast<uint32_t>(timestamp_diff *
|
||||||
|
(static_cast<double>(send_codec_inst_.plfreq) /
|
||||||
static_cast<double>(in_frame.sample_rate_hz_)));
|
static_cast<double>(in_frame.sample_rate_hz_)));
|
||||||
|
|
||||||
preprocess_frame_.samples_per_channel_ = input_resampler_.Resample10Msec(
|
preprocess_frame_.samples_per_channel_ = input_resampler_.Resample10Msec(
|
||||||
@@ -1546,7 +1545,7 @@ int AudioCodingModuleImpl::SetVADSafe(bool enable_dtx,
|
|||||||
&& (mode != VADAggr) && (mode != VADVeryAggr)) {
|
&& (mode != VADAggr) && (mode != VADVeryAggr)) {
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_,
|
||||||
"Invalid VAD Mode %d, no change is made to VAD/DTX status",
|
"Invalid VAD Mode %d, no change is made to VAD/DTX status",
|
||||||
(int) mode);
|
static_cast<int>(mode));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,21 +8,21 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "TestAllCodecs.h"
|
#include "webrtc/modules/audio_coding/main/test/TestAllCodecs.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#include "audio_coding_module.h"
|
#include "webrtc/common_types.h"
|
||||||
#include "audio_coding_module_typedefs.h"
|
#include "webrtc/engine_configurations.h"
|
||||||
#include "common_types.h"
|
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||||
#include "engine_configurations.h"
|
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||||
#include "testsupport/fileutils.h"
|
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||||
#include "trace.h"
|
#include "webrtc/system_wrappers/interface/trace.h"
|
||||||
#include "typedefs.h"
|
#include "webrtc/test/testsupport/fileutils.h"
|
||||||
#include "utility.h"
|
#include "webrtc/typedefs.h"
|
||||||
|
|
||||||
// Description of the test:
|
// Description of the test:
|
||||||
// In this test we set up a one-way communication channel from a participant
|
// In this test we set up a one-way communication channel from a participant
|
||||||
@@ -127,7 +127,6 @@ TestAllCodecs::~TestAllCodecs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TestAllCodecs::Perform() {
|
void TestAllCodecs::Perform() {
|
||||||
|
|
||||||
const std::string file_name =
|
const std::string file_name =
|
||||||
webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
|
webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
|
||||||
infile_a_.Open(file_name, 32000, "rb");
|
infile_a_.Open(file_name, 32000, "rb");
|
||||||
|
|||||||
@@ -8,19 +8,19 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "TestStereo.h"
|
#include "webrtc/modules/audio_coding/main/test/TestStereo.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <string>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#include "audio_coding_module_typedefs.h"
|
#include "webrtc/common_types.h"
|
||||||
#include "common_types.h"
|
#include "webrtc/engine_configurations.h"
|
||||||
#include "engine_configurations.h"
|
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||||
#include "testsupport/fileutils.h"
|
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||||
#include "trace.h"
|
#include "webrtc/system_wrappers/interface/trace.h"
|
||||||
#include "utility.h"
|
#include "webrtc/test/testsupport/fileutils.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@@ -65,10 +65,10 @@ WebRtc_Word32 TestPackStereo::SendData(
|
|||||||
if (lost_packet_ == false) {
|
if (lost_packet_ == false) {
|
||||||
if (frame_type != kAudioFrameCN) {
|
if (frame_type != kAudioFrameCN) {
|
||||||
rtp_info.type.Audio.isCNG = false;
|
rtp_info.type.Audio.isCNG = false;
|
||||||
rtp_info.type.Audio.channel = (int) codec_mode_;
|
rtp_info.type.Audio.channel = static_cast<int>(codec_mode_);
|
||||||
} else {
|
} else {
|
||||||
rtp_info.type.Audio.isCNG = true;
|
rtp_info.type.Audio.isCNG = true;
|
||||||
rtp_info.type.Audio.channel = (int) kMono;
|
rtp_info.type.Audio.channel = static_cast<int>(kMono);
|
||||||
}
|
}
|
||||||
status = receiver_acm_->IncomingPacket(payload_data, payload_size,
|
status = receiver_acm_->IncomingPacket(payload_data, payload_size,
|
||||||
rtp_info);
|
rtp_info);
|
||||||
@@ -245,7 +245,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_G722
|
#ifdef WEBRTC_CODEC_G722
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
channel_a2b_->set_codec_mode(kStereo);
|
channel_a2b_->set_codec_mode(kStereo);
|
||||||
@@ -275,7 +275,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_PCM16
|
#ifdef WEBRTC_CODEC_PCM16
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
channel_a2b_->set_codec_mode(kStereo);
|
channel_a2b_->set_codec_mode(kStereo);
|
||||||
@@ -298,7 +298,7 @@ void TestStereo::Perform() {
|
|||||||
|
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -319,7 +319,7 @@ void TestStereo::Perform() {
|
|||||||
|
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -414,7 +414,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_CELT
|
#ifdef WEBRTC_CODEC_CELT
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
channel_a2b_->set_codec_mode(kStereo);
|
channel_a2b_->set_codec_mode(kStereo);
|
||||||
@@ -437,7 +437,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===========================================================\n");
|
printf("===========================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-stereo\n");
|
printf("Test type: Stereo-to-stereo\n");
|
||||||
}
|
}
|
||||||
channel_a2b_->set_codec_mode(kStereo);
|
channel_a2b_->set_codec_mode(kStereo);
|
||||||
@@ -481,7 +481,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_G722
|
#ifdef WEBRTC_CODEC_G722
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -495,7 +495,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_PCM16
|
#ifdef WEBRTC_CODEC_PCM16
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -507,7 +507,7 @@ void TestStereo::Perform() {
|
|||||||
out_file_.Close();
|
out_file_.Close();
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -518,7 +518,7 @@ void TestStereo::Perform() {
|
|||||||
out_file_.Close();
|
out_file_.Close();
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -531,7 +531,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef PCMA_AND_PCMU
|
#ifdef PCMA_AND_PCMU
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -548,7 +548,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_CELT
|
#ifdef WEBRTC_CODEC_CELT
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -562,7 +562,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Mono-to-stereo\n");
|
printf("Test type: Mono-to-stereo\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ void TestStereo::Perform() {
|
|||||||
// Run stereo audio and mono codec.
|
// Run stereo audio and mono codec.
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -613,7 +613,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_PCM16
|
#ifdef WEBRTC_CODEC_PCM16
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -624,7 +624,7 @@ void TestStereo::Perform() {
|
|||||||
out_file_.Close();
|
out_file_.Close();
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -635,7 +635,7 @@ void TestStereo::Perform() {
|
|||||||
out_file_.Close();
|
out_file_.Close();
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("==============================================================\n");
|
printf("==============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -648,7 +648,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef PCMA_AND_PCMU
|
#ifdef PCMA_AND_PCMU
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -664,7 +664,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_CELT
|
#ifdef WEBRTC_CODEC_CELT
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -677,7 +677,7 @@ void TestStereo::Perform() {
|
|||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
if (test_mode_ != 0) {
|
if (test_mode_ != 0) {
|
||||||
printf("===============================================================\n");
|
printf("===============================================================\n");
|
||||||
printf("Test number: %d\n",test_cntr_ + 1);
|
printf("Test number: %d\n", test_cntr_ + 1);
|
||||||
printf("Test type: Stereo-to-mono\n");
|
printf("Test type: Stereo-to-mono\n");
|
||||||
}
|
}
|
||||||
test_cntr_++;
|
test_cntr_++;
|
||||||
@@ -794,11 +794,13 @@ void TestStereo::RegisterSendCodec(char side, char* codec_name,
|
|||||||
// For Celt the packet size in bytes is already counting the stereo part.
|
// For Celt the packet size in bytes is already counting the stereo part.
|
||||||
if (!strcmp(codec_name, "CELT")) {
|
if (!strcmp(codec_name, "CELT")) {
|
||||||
pack_size_bytes_ = (WebRtc_UWord16)(
|
pack_size_bytes_ = (WebRtc_UWord16)(
|
||||||
(float) (pack_size * rate) / (float) (sampling_freq_hz * 8) + 0.875)
|
static_cast<float>(pack_size * rate) /
|
||||||
|
static_cast<float>(sampling_freq_hz * 8) + 0.875)
|
||||||
/ channels;
|
/ channels;
|
||||||
} else {
|
} else {
|
||||||
pack_size_bytes_ = (WebRtc_UWord16)(
|
pack_size_bytes_ = (WebRtc_UWord16)(
|
||||||
(float) (pack_size * rate) / (float) (sampling_freq_hz * 8) + 0.875);
|
static_cast<float>(pack_size * rate) /
|
||||||
|
static_cast<float>(sampling_freq_hz * 8) + 0.875);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set pointer to the ACM where to register the codec
|
// Set pointer to the ACM where to register the codec
|
||||||
|
|||||||
Reference in New Issue
Block a user