Moved Opus-specific payload splitting into AudioDecoderOpus.
The biggest change to NetEq is the move from a primary flag, to a Priority with two separate levels: one set by RED splitting and one set by the codec itself. This allows us to unambigously prioritize "fallback" packets from these two sources. I've chosen what I believe is the sensible ordering: packets that the codec prioritizes are chosen first, regardless of if they are secondary RED packets or not. So if we were to use Opus w/ FEC in RED, we'd only do Opus FEC decoding if there was no RED packet that could cover the time slot. With this change, PayloadSplitter now only deals with RED packets. Maybe it should be renamed RedPayloadSplitter? BUG=webrtc:5805 Review-Url: https://codereview.webrtc.org/2342443005 Cr-Commit-Position: refs/heads/master@{#14347}
This commit is contained in:
@ -28,7 +28,7 @@
|
||||
#include "webrtc/modules/audio_coding/neteq/mock/mock_dtmf_buffer.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/mock/mock_dtmf_tone_generator.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/mock/mock_payload_splitter.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/mock/mock_red_payload_splitter.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/preemptive_expand.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/sync_buffer.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h"
|
||||
@ -124,11 +124,11 @@ class NetEqImplTest : public ::testing::Test {
|
||||
packet_buffer_ = deps.packet_buffer.get();
|
||||
|
||||
if (use_mock_payload_splitter_) {
|
||||
std::unique_ptr<MockPayloadSplitter> mock(new MockPayloadSplitter);
|
||||
std::unique_ptr<MockRedPayloadSplitter> mock(new MockRedPayloadSplitter);
|
||||
mock_payload_splitter_ = mock.get();
|
||||
deps.payload_splitter = std::move(mock);
|
||||
deps.red_payload_splitter = std::move(mock);
|
||||
}
|
||||
payload_splitter_ = deps.payload_splitter.get();
|
||||
red_payload_splitter_ = deps.red_payload_splitter.get();
|
||||
|
||||
deps.timestamp_scaler = std::unique_ptr<TimestampScaler>(
|
||||
new TimestampScaler(*deps.decoder_database.get()));
|
||||
@ -197,8 +197,8 @@ class NetEqImplTest : public ::testing::Test {
|
||||
MockPacketBuffer* mock_packet_buffer_ = nullptr;
|
||||
PacketBuffer* packet_buffer_ = nullptr;
|
||||
bool use_mock_packet_buffer_ = true;
|
||||
MockPayloadSplitter* mock_payload_splitter_ = nullptr;
|
||||
PayloadSplitter* payload_splitter_ = nullptr;
|
||||
MockRedPayloadSplitter* mock_payload_splitter_ = nullptr;
|
||||
RedPayloadSplitter* red_payload_splitter_ = nullptr;
|
||||
bool use_mock_payload_splitter_ = true;
|
||||
};
|
||||
|
||||
@ -332,11 +332,6 @@ TEST_F(NetEqImplTest, InsertPacket) {
|
||||
.WillOnce(Return(0));
|
||||
}
|
||||
|
||||
// Expectations for payload splitter.
|
||||
EXPECT_CALL(*mock_payload_splitter_, SplitFec(_, _))
|
||||
.Times(2)
|
||||
.WillRepeatedly(Return(PayloadSplitter::kOK));
|
||||
|
||||
// Insert first packet.
|
||||
neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user