rtcp::Ij renamed to rtcp::ExtendedJitterReport
to match name given in the RFC5450 private member renamed to inter_arrival_jitters_ for the same reason. rtcp::ExtendedJitterReport moved into own file accessors and Parse function added to make class usable for parsing packet Review URL: https://codereview.webrtc.org/1434213004 Cr-Commit-Position: refs/heads/master@{#10636}
This commit is contained in:
parent
cbe9f51cf8
commit
f8506cbdd8
@ -247,6 +247,7 @@
|
||||
'rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_format_remb_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_packet_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_packet/extended_jitter_report_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_packet/report_block_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc',
|
||||
'rtp_rtcp/source/rtcp_receiver_unittest.cc',
|
||||
|
||||
@ -46,6 +46,8 @@ source_set("rtp_rtcp") {
|
||||
"source/remote_ntp_time_estimator.cc",
|
||||
"source/rtcp_packet.cc",
|
||||
"source/rtcp_packet.h",
|
||||
"source/rtcp_packet/extended_jitter_report.cc",
|
||||
"source/rtcp_packet/extended_jitter_report.h",
|
||||
"source/rtcp_packet/report_block.cc",
|
||||
"source/rtcp_packet/report_block.h",
|
||||
"source/rtcp_packet/transport_feedback.cc",
|
||||
|
||||
@ -41,6 +41,8 @@
|
||||
'source/rtp_rtcp_impl.h',
|
||||
'source/rtcp_packet.cc',
|
||||
'source/rtcp_packet.h',
|
||||
'source/rtcp_packet/extended_jitter_report.cc',
|
||||
'source/rtcp_packet/extended_jitter_report.h',
|
||||
'source/rtcp_packet/report_block.cc',
|
||||
'source/rtcp_packet/report_block.h',
|
||||
'source/rtcp_packet/transport_feedback.cc',
|
||||
|
||||
@ -163,28 +163,6 @@ void CreateReportBlocks(const std::vector<ReportBlock>& blocks,
|
||||
}
|
||||
}
|
||||
|
||||
// Transmission Time Offsets in RTP Streams (RFC 5450).
|
||||
//
|
||||
// 0 1 2 3
|
||||
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// hdr |V=2|P| RC | PT=IJ=195 | length |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// . .
|
||||
// . .
|
||||
// . .
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
void CreateIj(const std::vector<uint32_t>& ij_items,
|
||||
uint8_t* buffer,
|
||||
size_t* pos) {
|
||||
for (uint32_t item : ij_items)
|
||||
AssignUWord32(buffer, pos, item);
|
||||
}
|
||||
|
||||
// Source Description (SDES) (RFC 3550).
|
||||
//
|
||||
// 0 1 2 3
|
||||
@ -804,29 +782,6 @@ bool ReceiverReport::WithReportBlock(const ReportBlock& block) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ij::Create(uint8_t* packet,
|
||||
size_t* index,
|
||||
size_t max_length,
|
||||
RtcpPacket::PacketReadyCallback* callback) const {
|
||||
while (*index + BlockLength() > max_length) {
|
||||
if (!OnBufferFull(packet, index, callback))
|
||||
return false;
|
||||
}
|
||||
size_t length = ij_items_.size();
|
||||
CreateHeader(length, PT_IJ, length, packet, index);
|
||||
CreateIj(ij_items_, packet, index);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ij::WithJitterItem(uint32_t jitter) {
|
||||
if (ij_items_.size() >= kMaxNumberOfIjItems) {
|
||||
LOG(LS_WARNING) << "Max inter-arrival jitter items reached.";
|
||||
return false;
|
||||
}
|
||||
ij_items_.push_back(jitter);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Sdes::Create(uint8_t* packet,
|
||||
size_t* index,
|
||||
size_t max_length,
|
||||
|
||||
@ -263,51 +263,6 @@ class ReceiverReport : public RtcpPacket {
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ReceiverReport);
|
||||
};
|
||||
|
||||
// Transmission Time Offsets in RTP Streams (RFC 5450).
|
||||
//
|
||||
// 0 1 2 3
|
||||
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// hdr |V=2|P| RC | PT=IJ=195 | length |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// . .
|
||||
// . .
|
||||
// . .
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
//
|
||||
// If present, this RTCP packet must be placed after a receiver report
|
||||
// (inside a compound RTCP packet), and MUST have the same value for RC
|
||||
// (reception report count) as the receiver report.
|
||||
|
||||
class Ij : public RtcpPacket {
|
||||
public:
|
||||
Ij() : RtcpPacket() {}
|
||||
|
||||
virtual ~Ij() {}
|
||||
|
||||
bool WithJitterItem(uint32_t jitter);
|
||||
|
||||
protected:
|
||||
bool Create(uint8_t* packet,
|
||||
size_t* index,
|
||||
size_t max_length,
|
||||
RtcpPacket::PacketReadyCallback* callback) const override;
|
||||
|
||||
private:
|
||||
static const int kMaxNumberOfIjItems = 0x1f;
|
||||
|
||||
size_t BlockLength() const {
|
||||
return kHeaderLength + 4 * ij_items_.size();
|
||||
}
|
||||
|
||||
std::vector<uint32_t> ij_items_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Ij);
|
||||
};
|
||||
|
||||
// Source Description (SDES) (RFC 3550).
|
||||
//
|
||||
// 0 1 2 3
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
||||
|
||||
using webrtc::RTCPUtility::RtcpCommonHeader;
|
||||
|
||||
namespace webrtc {
|
||||
namespace rtcp {
|
||||
|
||||
// Transmission Time Offsets in RTP Streams (RFC 5450).
|
||||
//
|
||||
// 0 1 2 3
|
||||
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// hdr |V=2|P| RC | PT=IJ=195 | length |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// . .
|
||||
// . .
|
||||
// . .
|
||||
// | inter-arrival jitter |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
//
|
||||
// If present, this RTCP packet must be placed after a receiver report
|
||||
// (inside a compound RTCP packet), and MUST have the same value for RC
|
||||
// (reception report count) as the receiver report.
|
||||
|
||||
bool ExtendedJitterReport::Parse(const RtcpCommonHeader& header,
|
||||
const uint8_t* payload) {
|
||||
RTC_DCHECK(header.packet_type == kPacketType);
|
||||
|
||||
const uint8_t jitters_count = header.count_or_format;
|
||||
const size_t kJitterSizeBytes = 4u;
|
||||
|
||||
if (header.payload_size_bytes < jitters_count * kJitterSizeBytes) {
|
||||
LOG(LS_WARNING) << "Packet is too small to contain all the jitter.";
|
||||
return false;
|
||||
}
|
||||
|
||||
inter_arrival_jitters_.resize(jitters_count);
|
||||
for (size_t index = 0; index < jitters_count; ++index) {
|
||||
inter_arrival_jitters_[index] =
|
||||
ByteReader<uint32_t>::ReadBigEndian(&payload[index * kJitterSizeBytes]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExtendedJitterReport::WithJitter(uint32_t jitter) {
|
||||
if (inter_arrival_jitters_.size() >= kMaxNumberOfJitters) {
|
||||
LOG(LS_WARNING) << "Max inter-arrival jitter items reached.";
|
||||
return false;
|
||||
}
|
||||
inter_arrival_jitters_.push_back(jitter);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExtendedJitterReport::Create(
|
||||
uint8_t* packet,
|
||||
size_t* index,
|
||||
size_t max_length,
|
||||
RtcpPacket::PacketReadyCallback* callback) const {
|
||||
while (*index + BlockLength() > max_length) {
|
||||
if (!OnBufferFull(packet, index, callback))
|
||||
return false;
|
||||
}
|
||||
const size_t index_end = *index + BlockLength();
|
||||
size_t length = inter_arrival_jitters_.size();
|
||||
CreateHeader(length, kPacketType, length, packet, index);
|
||||
|
||||
for (uint32_t jitter : inter_arrival_jitters_) {
|
||||
ByteWriter<uint32_t>::WriteBigEndian(packet + *index, jitter);
|
||||
*index += sizeof(uint32_t);
|
||||
}
|
||||
// Sanity check.
|
||||
RTC_DCHECK_EQ(index_end, *index);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace rtcp
|
||||
} // namespace webrtc
|
||||
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_
|
||||
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace rtcp {
|
||||
|
||||
class ExtendedJitterReport : public RtcpPacket {
|
||||
public:
|
||||
static const uint8_t kPacketType = 195;
|
||||
|
||||
ExtendedJitterReport() : RtcpPacket() {}
|
||||
|
||||
virtual ~ExtendedJitterReport() {}
|
||||
|
||||
// Parse assumes header is already parsed and validated.
|
||||
bool Parse(const RTCPUtility::RtcpCommonHeader& header,
|
||||
const uint8_t* payload); // Size of the payload is in the header.
|
||||
|
||||
bool WithJitter(uint32_t jitter);
|
||||
|
||||
size_t jitters_count() const { return inter_arrival_jitters_.size(); }
|
||||
uint32_t jitter(size_t index) const {
|
||||
RTC_DCHECK_LT(index, jitters_count());
|
||||
return inter_arrival_jitters_[index];
|
||||
}
|
||||
|
||||
protected:
|
||||
bool Create(uint8_t* packet,
|
||||
size_t* index,
|
||||
size_t max_length,
|
||||
RtcpPacket::PacketReadyCallback* callback) const override;
|
||||
|
||||
private:
|
||||
static const int kMaxNumberOfJitters = 0x1f;
|
||||
|
||||
size_t BlockLength() const override {
|
||||
return kHeaderLength + 4 * inter_arrival_jitters_.size();
|
||||
}
|
||||
|
||||
std::vector<uint32_t> inter_arrival_jitters_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ExtendedJitterReport);
|
||||
};
|
||||
|
||||
} // namespace rtcp
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_
|
||||
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
|
||||
|
||||
using webrtc::rtcp::RawPacket;
|
||||
using webrtc::rtcp::ExtendedJitterReport;
|
||||
using webrtc::RTCPUtility::RtcpCommonHeader;
|
||||
using webrtc::RTCPUtility::RtcpParseCommonHeader;
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
class RtcpPacketExtendedJitterReportTest : public ::testing::Test {
|
||||
protected:
|
||||
void BuildPacket() { packet = ij.Build().Pass(); }
|
||||
void ParsePacket() {
|
||||
RtcpCommonHeader header;
|
||||
EXPECT_TRUE(
|
||||
RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header));
|
||||
EXPECT_EQ(header.BlockSize(), packet->Length());
|
||||
EXPECT_TRUE(parsed_.Parse(
|
||||
header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes));
|
||||
}
|
||||
|
||||
ExtendedJitterReport ij;
|
||||
rtc::scoped_ptr<RawPacket> packet;
|
||||
const ExtendedJitterReport& parsed() { return parsed_; }
|
||||
|
||||
private:
|
||||
ExtendedJitterReport parsed_;
|
||||
};
|
||||
|
||||
TEST_F(RtcpPacketExtendedJitterReportTest, NoItem) {
|
||||
// No initialization because packet is empty.
|
||||
BuildPacket();
|
||||
ParsePacket();
|
||||
|
||||
EXPECT_EQ(0u, parsed().jitters_count());
|
||||
}
|
||||
|
||||
TEST_F(RtcpPacketExtendedJitterReportTest, OneItem) {
|
||||
EXPECT_TRUE(ij.WithJitter(0x11121314));
|
||||
|
||||
BuildPacket();
|
||||
ParsePacket();
|
||||
|
||||
EXPECT_EQ(1u, parsed().jitters_count());
|
||||
EXPECT_EQ(0x11121314U, parsed().jitter(0));
|
||||
}
|
||||
|
||||
TEST_F(RtcpPacketExtendedJitterReportTest, TwoItems) {
|
||||
EXPECT_TRUE(ij.WithJitter(0x11121418));
|
||||
EXPECT_TRUE(ij.WithJitter(0x22242628));
|
||||
|
||||
BuildPacket();
|
||||
ParsePacket();
|
||||
|
||||
EXPECT_EQ(2u, parsed().jitters_count());
|
||||
EXPECT_EQ(0x11121418U, parsed().jitter(0));
|
||||
EXPECT_EQ(0x22242628U, parsed().jitter(1));
|
||||
}
|
||||
|
||||
TEST_F(RtcpPacketExtendedJitterReportTest, TooManyItems) {
|
||||
const int kMaxIjItems = (1 << 5) - 1;
|
||||
for (int i = 0; i < kMaxIjItems; ++i) {
|
||||
EXPECT_TRUE(ij.WithJitter(i));
|
||||
}
|
||||
EXPECT_FALSE(ij.WithJitter(kMaxIjItems));
|
||||
}
|
||||
|
||||
TEST_F(RtcpPacketExtendedJitterReportTest, ParseFailWithTooManyItems) {
|
||||
ij.WithJitter(0x11121418);
|
||||
BuildPacket();
|
||||
RtcpCommonHeader header;
|
||||
RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header);
|
||||
header.count_or_format++; // Damage package.
|
||||
|
||||
ExtendedJitterReport parsed;
|
||||
|
||||
EXPECT_FALSE(parsed.Parse(
|
||||
header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
@ -23,7 +23,6 @@ using webrtc::rtcp::Bye;
|
||||
using webrtc::rtcp::Dlrr;
|
||||
using webrtc::rtcp::Empty;
|
||||
using webrtc::rtcp::Fir;
|
||||
using webrtc::rtcp::Ij;
|
||||
using webrtc::rtcp::Nack;
|
||||
using webrtc::rtcp::Pli;
|
||||
using webrtc::rtcp::Sdes;
|
||||
@ -196,50 +195,6 @@ TEST(RtcpPacketTest, SrWithTooManyReportBlocks) {
|
||||
EXPECT_FALSE(sr.WithReportBlock(rb));
|
||||
}
|
||||
|
||||
TEST(RtcpPacketTest, IjNoItem) {
|
||||
Ij ij;
|
||||
|
||||
rtc::scoped_ptr<RawPacket> packet(ij.Build());
|
||||
RtcpPacketParser parser;
|
||||
parser.Parse(packet->Buffer(), packet->Length());
|
||||
EXPECT_EQ(1, parser.ij()->num_packets());
|
||||
EXPECT_EQ(0, parser.ij_item()->num_packets());
|
||||
}
|
||||
|
||||
TEST(RtcpPacketTest, IjOneItem) {
|
||||
Ij ij;
|
||||
EXPECT_TRUE(ij.WithJitterItem(0x11111111));
|
||||
|
||||
rtc::scoped_ptr<RawPacket> packet(ij.Build());
|
||||
RtcpPacketParser parser;
|
||||
parser.Parse(packet->Buffer(), packet->Length());
|
||||
EXPECT_EQ(1, parser.ij()->num_packets());
|
||||
EXPECT_EQ(1, parser.ij_item()->num_packets());
|
||||
EXPECT_EQ(0x11111111U, parser.ij_item()->Jitter());
|
||||
}
|
||||
|
||||
TEST(RtcpPacketTest, IjTwoItems) {
|
||||
Ij ij;
|
||||
EXPECT_TRUE(ij.WithJitterItem(0x11111111));
|
||||
EXPECT_TRUE(ij.WithJitterItem(0x22222222));
|
||||
|
||||
rtc::scoped_ptr<RawPacket> packet(ij.Build());
|
||||
RtcpPacketParser parser;
|
||||
parser.Parse(packet->Buffer(), packet->Length());
|
||||
EXPECT_EQ(1, parser.ij()->num_packets());
|
||||
EXPECT_EQ(2, parser.ij_item()->num_packets());
|
||||
EXPECT_EQ(0x22222222U, parser.ij_item()->Jitter());
|
||||
}
|
||||
|
||||
TEST(RtcpPacketTest, IjTooManyItems) {
|
||||
Ij ij;
|
||||
const int kMaxIjItems = (1 << 5) - 1;
|
||||
for (int i = 0; i < kMaxIjItems; ++i) {
|
||||
EXPECT_TRUE(ij.WithJitterItem(i));
|
||||
}
|
||||
EXPECT_FALSE(ij.WithJitterItem(kMaxIjItems));
|
||||
}
|
||||
|
||||
TEST(RtcpPacketTest, AppWithNoData) {
|
||||
App app;
|
||||
app.WithSubType(30);
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -384,20 +385,20 @@ TEST_F(RtcpReceiverTest, GetRtt) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpReceiverTest, InjectIjWithNoItem) {
|
||||
rtcp::Ij ij;
|
||||
rtcp::ExtendedJitterReport ij;
|
||||
rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build());
|
||||
EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
|
||||
EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
|
||||
}
|
||||
|
||||
TEST_F(RtcpReceiverTest, InjectIjWithOneItem) {
|
||||
rtcp::Ij ij;
|
||||
ij.WithJitterItem(0x11111111);
|
||||
rtcp::ExtendedJitterReport ij;
|
||||
ij.WithJitter(0x11213141);
|
||||
|
||||
rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build());
|
||||
EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
|
||||
EXPECT_EQ(kRtcpTransmissionTimeOffset, rtcp_packet_info_.rtcpPacketTypeFlags);
|
||||
EXPECT_EQ(0x11111111U, rtcp_packet_info_.interArrivalJitter);
|
||||
EXPECT_EQ(0x11213141U, rtcp_packet_info_.interArrivalJitter);
|
||||
}
|
||||
|
||||
TEST_F(RtcpReceiverTest, InjectAppWithNoData) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user