Fix video_replay tool to respect RTX stream and fix default parameters.
Defaults are consistent with these used in CallTest. BUG=none Review-Url: https://codereview.webrtc.org/2972423002 Cr-Commit-Position: refs/heads/master@{#18961}
This commit is contained in:
parent
d8cf08f166
commit
863f03ba38
@ -427,6 +427,9 @@ const uint8_t CallTest::kRtxRedPayloadType = 99;
|
||||
const uint8_t CallTest::kUlpfecPayloadType = 119;
|
||||
const uint8_t CallTest::kFlexfecPayloadType = 120;
|
||||
const uint8_t CallTest::kAudioSendPayloadType = 103;
|
||||
const uint8_t CallTest::kPayloadTypeH264 = 122;
|
||||
const uint8_t CallTest::kPayloadTypeVP8 = 123;
|
||||
const uint8_t CallTest::kPayloadTypeVP9 = 124;
|
||||
const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE,
|
||||
0xBADCAFF};
|
||||
const uint32_t CallTest::kVideoSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE,
|
||||
|
||||
@ -50,6 +50,9 @@ class CallTest : public ::testing::Test {
|
||||
static const uint8_t kUlpfecPayloadType;
|
||||
static const uint8_t kFlexfecPayloadType;
|
||||
static const uint8_t kAudioSendPayloadType;
|
||||
static const uint8_t kPayloadTypeH264;
|
||||
static const uint8_t kPayloadTypeVP8;
|
||||
static const uint8_t kPayloadTypeVP9;
|
||||
static const uint32_t kSendRtxSsrcs[kNumSsrcs];
|
||||
static const uint32_t kVideoSendSsrcs[kNumSsrcs];
|
||||
static const uint32_t kAudioSendSsrc;
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "webrtc/rtc_base/checks.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
#include "webrtc/system_wrappers/include/sleep.h"
|
||||
#include "webrtc/test/call_test.h"
|
||||
#include "webrtc/test/encoder_settings.h"
|
||||
#include "webrtc/test/fake_decoder.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
@ -43,21 +44,38 @@ namespace flags {
|
||||
static bool ValidatePayloadType(const char* flagname, int32_t payload_type) {
|
||||
return payload_type > 0 && payload_type <= 127;
|
||||
}
|
||||
DEFINE_int32(payload_type, 0, "Payload type");
|
||||
DEFINE_int32(payload_type, test::CallTest::kPayloadTypeVP8, "Payload type");
|
||||
static int PayloadType() { return static_cast<int>(FLAGS_payload_type); }
|
||||
static const bool payload_dummy =
|
||||
google::RegisterFlagValidator(&FLAGS_payload_type, &ValidatePayloadType);
|
||||
|
||||
DEFINE_int32(payload_type_rtx,
|
||||
test::CallTest::kSendRtxPayloadType,
|
||||
"RTX payload type");
|
||||
static int PayloadTypeRtx() {
|
||||
return static_cast<int>(FLAGS_payload_type_rtx);
|
||||
}
|
||||
static const bool payload_rtx_dummy =
|
||||
google::RegisterFlagValidator(&FLAGS_payload_type_rtx,
|
||||
&ValidatePayloadType);
|
||||
|
||||
// Flag for SSRC.
|
||||
static bool ValidateSsrc(const char* flagname, uint64_t ssrc) {
|
||||
return ssrc > 0 && ssrc <= 0xFFFFFFFFu;
|
||||
}
|
||||
|
||||
DEFINE_uint64(ssrc, 0, "Incoming SSRC");
|
||||
DEFINE_uint64(ssrc, test::CallTest::kVideoSendSsrcs[0], "Incoming SSRC");
|
||||
static uint32_t Ssrc() { return static_cast<uint32_t>(FLAGS_ssrc); }
|
||||
static const bool ssrc_dummy =
|
||||
google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrc);
|
||||
|
||||
DEFINE_uint64(ssrc_rtx, test::CallTest::kSendRtxSsrcs[0], "Incoming RTX SSRC");
|
||||
static uint32_t SsrcRtx() {
|
||||
return static_cast<uint32_t>(FLAGS_ssrc_rtx);
|
||||
}
|
||||
static const bool ssrc_rtx_dummy =
|
||||
google::RegisterFlagValidator(&FLAGS_ssrc_rtx, &ValidateSsrc);
|
||||
|
||||
static bool ValidateOptionalPayloadType(const char* flagname,
|
||||
int32_t payload_type) {
|
||||
return payload_type == -1 || ValidatePayloadType(flagname, payload_type);
|
||||
@ -219,6 +237,9 @@ void RtpReplay() {
|
||||
VideoReceiveStream::Config receive_config(&transport);
|
||||
receive_config.rtp.remote_ssrc = flags::Ssrc();
|
||||
receive_config.rtp.local_ssrc = kReceiverLocalSsrc;
|
||||
receive_config.rtp.rtx_ssrc = flags::SsrcRtx();
|
||||
receive_config.rtp.rtx_payload_types[flags::PayloadType()] =
|
||||
flags::PayloadTypeRtx();
|
||||
receive_config.rtp.ulpfec.ulpfec_payload_type = flags::FecPayloadType();
|
||||
receive_config.rtp.ulpfec.red_payload_type = flags::RedPayloadType();
|
||||
receive_config.rtp.nack.rtp_history_ms = 1000;
|
||||
|
||||
@ -52,9 +52,6 @@
|
||||
namespace {
|
||||
|
||||
constexpr int kSendStatsPollingIntervalMs = 1000;
|
||||
constexpr int kPayloadTypeH264 = 122;
|
||||
constexpr int kPayloadTypeVP8 = 123;
|
||||
constexpr int kPayloadTypeVP9 = 124;
|
||||
|
||||
constexpr size_t kMaxComparisons = 10;
|
||||
constexpr char kSyncGroup[] = "av_sync";
|
||||
@ -588,15 +585,15 @@ class VideoAnalyzer : public PacketReceiver,
|
||||
bool IsInSelectedSpatialAndTemporalLayer(const uint8_t* packet,
|
||||
size_t length,
|
||||
const RTPHeader& header) {
|
||||
if (header.payloadType != kPayloadTypeVP9 &&
|
||||
header.payloadType != kPayloadTypeVP8) {
|
||||
if (header.payloadType != test::CallTest::kPayloadTypeVP9 &&
|
||||
header.payloadType != test::CallTest::kPayloadTypeVP8) {
|
||||
return true;
|
||||
} else {
|
||||
// Get VP8 and VP9 specific header to check layers indexes.
|
||||
const uint8_t* payload = packet + header.headerLength;
|
||||
const size_t payload_length = length - header.headerLength;
|
||||
const size_t payload_data_length = payload_length - header.paddingLength;
|
||||
const bool is_vp8 = header.payloadType == kPayloadTypeVP8;
|
||||
const bool is_vp8 = header.payloadType == test::CallTest::kPayloadTypeVP8;
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer(
|
||||
RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9));
|
||||
RtpDepacketizer::ParsedPayload parsed_payload;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user