ACM test are modified to run with both ACM1 and ACM2.

Beside the changes in test files. acm2/acm_generic_codec.cc and acm2/audio_coding_module_impl.cc are modified to fix a bug.

Also, nack{.cc, .h, _unittest.cc} are removed form main/sourc as nack files in both ACM1 and ACM2 are essentially identical.

R=andrew@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4908 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org
2013-10-02 21:44:33 +00:00
parent 2a97317953
commit 6ea3d1cc9e
41 changed files with 762 additions and 1346 deletions

View File

@@ -318,11 +318,7 @@ int16_t ACMGenericCodec::Encode(uint8_t* bitstream,
// break from the loop
break;
}
// TODO(andrew): This should be multiplied by the number of
// channels, right?
// http://code.google.com/p/webrtc/issues/detail?id=714
done = in_audio_ix_read_ >= frame_len_smpl_;
done = in_audio_ix_read_ >= frame_len_smpl_ * num_channels_;
}
}
if (status >= 0) {

View File

@@ -14,6 +14,7 @@
#include "gtest/gtest.h"
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h"
#include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h"
#include "webrtc/modules/audio_coding/neteq4/tools/rtp_generator.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
@@ -39,7 +40,7 @@ class AcmReceiverTest : public AudioPacketizationCallback,
protected:
AcmReceiverTest()
: receiver_(new AcmReceiver),
acm_(AudioCodingModule::Create(0)),
acm_(new AudioCodingModuleImpl(0)),
timestamp_(0),
packet_sent_(false),
last_packet_send_timestamp_(timestamp_),

View File

@@ -1469,7 +1469,7 @@ int AudioCodingModuleImpl::SetVADSafe(bool enable_dtx,
// If a send codec is registered, set VAD/DTX for the codec.
if (HaveValidEncoder("SetVAD") && codecs_[current_send_codec_idx_]->SetVAD(
&enable_dtx, &enable_vad, &mode) < 0) {
&dtx_enabled_, &vad_enabled_, &vad_mode_) < 0) {
// SetVAD failed.
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_,
"SetVAD failed");

View File

@@ -22,7 +22,12 @@ InitialDelayManager::InitialDelayManager(int initial_delay_ms,
buffered_audio_ms_(0),
buffering_(true),
playout_timestamp_(0),
late_packet_threshold_(late_packet_threshold) {}
late_packet_threshold_(late_packet_threshold) {
last_packet_rtp_info_.header.payloadType = kInvalidPayloadType;
last_packet_rtp_info_.header.ssrc = 0;
last_packet_rtp_info_.header.sequenceNumber = 0;
last_packet_rtp_info_.header.timestamp = 0;
}
void InitialDelayManager::UpdateLastReceivedPacket(
const WebRtcRTPHeader& rtp_info,
@@ -53,7 +58,9 @@ void InitialDelayManager::UpdateLastReceivedPacket(
return;
}
if (new_codec) {
// Either if it is a new packet or the first packet record and set variables.
if (new_codec ||
last_packet_rtp_info_.header.payloadType == kInvalidPayloadType) {
timestamp_step_ = 0;
if (type == kAudioPacket)
audio_payload_type_ = rtp_info.header.payloadType;