Adding REMB to receive stream configuration, the send side will always
react to incoming REMB for now. Adding a test to verify the receive side is generating RTCP REMB and will follow up with a send side test as soon as the bitrate stats are wired up for the new API. TEST=See above. R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5779004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5286 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
86bb56a7f5
commit
92c2793154
@ -277,7 +277,9 @@ void Call::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) {
|
||||
}
|
||||
|
||||
VideoReceiveStream::Config Call::GetDefaultReceiveConfig() {
|
||||
return VideoReceiveStream::Config();
|
||||
VideoReceiveStream::Config config;
|
||||
config.rtp.remb = true;
|
||||
return config;
|
||||
}
|
||||
|
||||
VideoReceiveStream* Call::CreateVideoReceiveStream(
|
||||
|
@ -936,4 +936,53 @@ TEST_F(CallTest, ObserversEncodedFrames) {
|
||||
|
||||
DestroyStreams();
|
||||
}
|
||||
|
||||
TEST_F(CallTest, ReceiveStreamSendsRemb) {
|
||||
class RembObserver : public test::RtpRtcpObserver {
|
||||
public:
|
||||
RembObserver() : test::RtpRtcpObserver(kDefaultTimeoutMs) {}
|
||||
|
||||
virtual Action OnReceiveRtcp(const uint8_t* packet,
|
||||
size_t length) OVERRIDE {
|
||||
RTCPUtility::RTCPParserV2 parser(packet, length, true);
|
||||
EXPECT_TRUE(parser.IsValid());
|
||||
|
||||
bool received_psfb = false;
|
||||
bool received_remb = false;
|
||||
RTCPUtility::RTCPPacketTypes packet_type = parser.Begin();
|
||||
while (packet_type != RTCPUtility::kRtcpNotValidCode) {
|
||||
if (packet_type == RTCPUtility::kRtcpPsfbRembCode) {
|
||||
const RTCPUtility::RTCPPacket& packet = parser.Packet();
|
||||
EXPECT_EQ(packet.PSFBAPP.SenderSSRC, kReceiverLocalSsrc);
|
||||
received_psfb = true;
|
||||
} else if (packet_type == RTCPUtility::kRtcpPsfbRembItemCode) {
|
||||
const RTCPUtility::RTCPPacket& packet = parser.Packet();
|
||||
EXPECT_GT(packet.REMBItem.BitRate, 0u);
|
||||
EXPECT_EQ(packet.REMBItem.NumberOfSSRCs, 1u);
|
||||
EXPECT_EQ(packet.REMBItem.SSRCs[0], kSendSsrc);
|
||||
received_remb = true;
|
||||
}
|
||||
packet_type = parser.Iterate();
|
||||
}
|
||||
if (received_psfb && received_remb)
|
||||
observation_complete_->Set();
|
||||
return SEND_PACKET;
|
||||
}
|
||||
} observer;
|
||||
|
||||
CreateCalls(Call::Config(observer.SendTransport()),
|
||||
Call::Config(observer.ReceiveTransport()));
|
||||
observer.SetReceivers(receiver_call_->Receiver(), sender_call_->Receiver());
|
||||
CreateTestConfigs();
|
||||
CreateStreams();
|
||||
CreateFrameGenerator();
|
||||
StartSending();
|
||||
|
||||
EXPECT_EQ(kEventSignaled, observer.Wait())
|
||||
<< "Timed out while waiting for a receiver RTCP REMB packet to be sent.";
|
||||
|
||||
StopSending();
|
||||
observer.StopSending();
|
||||
DestroyStreams();
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
@ -61,6 +61,7 @@ VideoReceiveStream::VideoReceiveStream(webrtc::VideoEngine* video_engine,
|
||||
assert(config_.rtp.remote_ssrc != config_.rtp.local_ssrc);
|
||||
|
||||
rtp_rtcp_->SetLocalSSRC(channel_, config_.rtp.local_ssrc);
|
||||
rtp_rtcp_->SetRembStatus(channel_, false, config_.rtp.remb);
|
||||
|
||||
network_ = ViENetwork::GetInterface(video_engine);
|
||||
assert(network_ != NULL);
|
||||
|
@ -115,6 +115,8 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport,
|
||||
}
|
||||
}
|
||||
|
||||
rtp_rtcp_->SetRembStatus(channel_, true, false);
|
||||
|
||||
// Enable NACK, FEC or both.
|
||||
if (config_.rtp.fec.red_payload_type != -1) {
|
||||
assert(config_.rtp.fec.ulpfec_payload_type != -1);
|
||||
|
@ -108,7 +108,8 @@ class VideoReceiveStream {
|
||||
Rtp()
|
||||
: remote_ssrc(0),
|
||||
local_ssrc(0),
|
||||
rtcp_mode(newapi::kRtcpReducedSize) {}
|
||||
rtcp_mode(newapi::kRtcpReducedSize),
|
||||
remb(false) {}
|
||||
|
||||
// Synchronization source (stream identifier) to be received.
|
||||
uint32_t remote_ssrc;
|
||||
@ -118,6 +119,9 @@ class VideoReceiveStream {
|
||||
// See RtcpMode for description.
|
||||
newapi::RtcpMode rtcp_mode;
|
||||
|
||||
// See draft-alvestrand-rmcat-remb for information.
|
||||
bool remb;
|
||||
|
||||
// See NackConfig for description.
|
||||
NackConfig nack;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user