Breaking out receive-stats, rtp-payload-registry and rtp-receiver from the

rtp_rtcp implementation.

This refactoring significantly reduces the receive-side RTP parser and receiver
complexity, and makes it possible to implement RTX correctly by having two
instances of receive-statistics.

With this change the dead-or-alive and packet timeout APIs are removed.

TEST=trybots, vie_auto_test, voe_auto_test
BUG=1811
R=mflodman@webrtc.org, pbos@webrtc.org, xians@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4301 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-07-05 14:30:48 +00:00
parent d4d9480c05
commit 66b2e5c05a
98 changed files with 2840 additions and 4279 deletions

View File

@ -10,7 +10,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/rtp_rtcp/interface/receive_statistics.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_receiver.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
@ -24,10 +27,18 @@ class LoopBackTransport : public webrtc::Transport {
LoopBackTransport()
: _count(0),
_packetLoss(0),
rtp_payload_registry_(NULL),
rtp_receiver_(NULL),
_rtpRtcpModule(NULL) {
}
void SetSendModule(RtpRtcp* rtpRtcpModule) {
void SetSendModule(RtpRtcp* rtpRtcpModule,
RTPPayloadRegistry* payload_registry,
RtpReceiver* receiver,
ReceiveStatistics* receive_statistics) {
_rtpRtcpModule = rtpRtcpModule;
rtp_payload_registry_ = payload_registry;
rtp_receiver_ = receiver;
receive_statistics_ = receive_statistics;
}
void DropEveryNthPacket(int n) {
_packetLoss = n;
@ -44,8 +55,15 @@ class LoopBackTransport : public webrtc::Transport {
if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) {
return -1;
}
if (_rtpRtcpModule->IncomingRtpPacket(static_cast<const uint8_t*>(data),
len, header) < 0) {
PayloadUnion payload_specific;
if (!rtp_payload_registry_->GetPayloadSpecifics(
header.payloadType, &payload_specific)) {
return -1;
}
receive_statistics_->IncomingPacket(header, len, false, true);
if (!rtp_receiver_->IncomingRtpPacket(&header,
static_cast<const uint8_t*>(data),
len, payload_specific, true)) {
return -1;
}
return len;
@ -59,10 +77,13 @@ class LoopBackTransport : public webrtc::Transport {
private:
int _count;
int _packetLoss;
ReceiveStatistics* receive_statistics_;
RTPPayloadRegistry* rtp_payload_registry_;
RtpReceiver* rtp_receiver_;
RtpRtcp* _rtpRtcpModule;
};
class RtpReceiver : public RtpData {
class TestRtpReceiver : public NullRtpData {
public:
virtual int32_t OnReceivedPayloadData(