Added red_payload_type_rtx flag to the video_replay tool.

Also renamed some command line flags to avoid confussion.
payload_type --> media_payload_type
payload_type_rtx --> media_payload_type_rtx
fec_payload_type --> ulpfec_payload_type

Bug: None
Change-Id: Id2750e5b47190ebdd77f44bf7f44418c24535f62
Reviewed-on: https://webrtc-review.googlesource.com/29681
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21122}
This commit is contained in:
philipel 2017-12-05 12:40:28 +01:00 committed by Commit Bot
parent 3714d4b5ad
commit 752968ee35

View File

@ -67,14 +67,41 @@ namespace flags {
// TODO(pbos): Multiple receivers.
// Flag for payload type.
DEFINE_int(payload_type, test::CallTest::kPayloadTypeVP8, "Payload type");
static int PayloadType() { return static_cast<int>(FLAG_payload_type); }
DEFINE_int(media_payload_type,
test::CallTest::kPayloadTypeVP8,
"Media payload type");
static int MediaPayloadType() {
return static_cast<int>(FLAG_media_payload_type);
}
DEFINE_int(payload_type_rtx,
// Flag for RED payload type.
DEFINE_int(red_payload_type,
test::CallTest::kRedPayloadType,
"RED payload type");
static int RedPayloadType() {
return static_cast<int>(FLAG_red_payload_type);
}
// Flag for ULPFEC payload type.
DEFINE_int(ulpfec_payload_type,
test::CallTest::kUlpfecPayloadType,
"ULPFEC payload type");
static int UlpfecPayloadType() {
return static_cast<int>(FLAG_ulpfec_payload_type);
}
DEFINE_int(media_payload_type_rtx,
test::CallTest::kSendRtxPayloadType,
"RTX payload type");
static int PayloadTypeRtx() {
return static_cast<int>(FLAG_payload_type_rtx);
"Media over RTX payload type");
static int MediaPayloadTypeRtx() {
return static_cast<int>(FLAG_media_payload_type_rtx);
}
DEFINE_int(red_payload_type_rtx,
test::CallTest::kRtxRedPayloadType,
"RED over RTX payload type");
static int RedPayloadTypeRtx() {
return static_cast<int>(FLAG_red_payload_type_rtx);
}
// Flag for SSRC.
@ -98,18 +125,6 @@ static uint32_t SsrcRtx() {
return rtc::StringToNumber<uint32_t>(FLAG_ssrc_rtx).value();
}
// Flag for RED payload type.
DEFINE_int(red_payload_type, -1, "RED payload type");
static int RedPayloadType() {
return static_cast<int>(FLAG_red_payload_type);
}
// Flag for ULPFEC payload type.
DEFINE_int(fec_payload_type, -1, "ULPFEC payload type");
static int FecPayloadType() {
return static_cast<int>(FLAG_fec_payload_type);
}
// Flag for abs-send-time id.
DEFINE_int(abs_send_time_id, -1, "RTP extension ID for abs-send-time");
static int AbsSendTimeId() { return static_cast<int>(FLAG_abs_send_time_id); }
@ -213,9 +228,12 @@ void RtpReplay() {
receive_config.rtp.remote_ssrc = flags::Ssrc();
receive_config.rtp.local_ssrc = kReceiverLocalSsrc;
receive_config.rtp.rtx_ssrc = flags::SsrcRtx();
receive_config.rtp.rtx_associated_payload_types[flags::PayloadTypeRtx()] =
flags::PayloadType();
receive_config.rtp.ulpfec_payload_type = flags::FecPayloadType();
receive_config.rtp
.rtx_associated_payload_types[flags::MediaPayloadTypeRtx()] =
flags::MediaPayloadType();
receive_config.rtp.rtx_associated_payload_types[flags::RedPayloadTypeRtx()] =
flags::RedPayloadType();
receive_config.rtp.ulpfec_payload_type = flags::UlpfecPayloadType();
receive_config.rtp.red_payload_type = flags::RedPayloadType();
receive_config.rtp.nack.rtp_history_ms = 1000;
if (flags::TransmissionOffsetId() != -1) {
@ -230,7 +248,7 @@ void RtpReplay() {
VideoSendStream::Config::EncoderSettings encoder_settings;
encoder_settings.payload_name = flags::Codec();
encoder_settings.payload_type = flags::PayloadType();
encoder_settings.payload_type = flags::MediaPayloadType();
VideoReceiveStream::Decoder decoder;
std::unique_ptr<DecoderBitstreamFileWriter> bitstream_writer;
if (!flags::DecoderBitstreamFilename().empty()) {
@ -333,12 +351,15 @@ int main(int argc, char* argv[]) {
return 0;
}
RTC_CHECK(ValidatePayloadType(webrtc::flags::FLAG_payload_type));
RTC_CHECK(ValidatePayloadType(webrtc::flags::FLAG_payload_type_rtx));
RTC_CHECK(ValidatePayloadType(webrtc::flags::FLAG_media_payload_type));
RTC_CHECK(ValidatePayloadType(webrtc::flags::FLAG_media_payload_type_rtx));
RTC_CHECK(ValidateOptionalPayloadType(webrtc::flags::FLAG_red_payload_type));
RTC_CHECK(
ValidateOptionalPayloadType(webrtc::flags::FLAG_red_payload_type_rtx));
RTC_CHECK(
ValidateOptionalPayloadType(webrtc::flags::FLAG_ulpfec_payload_type));
RTC_CHECK(ValidateSsrc(webrtc::flags::FLAG_ssrc));
RTC_CHECK(ValidateSsrc(webrtc::flags::FLAG_ssrc_rtx));
RTC_CHECK(ValidateOptionalPayloadType(webrtc::flags::FLAG_red_payload_type));
RTC_CHECK(ValidateOptionalPayloadType(webrtc::flags::FLAG_fec_payload_type));
RTC_CHECK(ValidateRtpHeaderExtensionId(webrtc::flags::FLAG_abs_send_time_id));
RTC_CHECK(ValidateRtpHeaderExtensionId(
webrtc::flags::FLAG_transmission_offset_id));