diff --git a/video/replay.cc b/video/replay.cc index b9214b8ae6..0638264aa7 100644 --- a/video/replay.cc +++ b/video/replay.cc @@ -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(FLAG_payload_type); } +DEFINE_int(media_payload_type, + test::CallTest::kPayloadTypeVP8, + "Media payload type"); +static int MediaPayloadType() { + return static_cast(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(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(FLAG_ulpfec_payload_type); +} + +DEFINE_int(media_payload_type_rtx, test::CallTest::kSendRtxPayloadType, - "RTX payload type"); -static int PayloadTypeRtx() { - return static_cast(FLAG_payload_type_rtx); + "Media over RTX payload type"); +static int MediaPayloadTypeRtx() { + return static_cast(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(FLAG_red_payload_type_rtx); } // Flag for SSRC. @@ -98,18 +125,6 @@ static uint32_t SsrcRtx() { return rtc::StringToNumber(FLAG_ssrc_rtx).value(); } -// Flag for RED payload type. -DEFINE_int(red_payload_type, -1, "RED payload type"); -static int RedPayloadType() { - return static_cast(FLAG_red_payload_type); -} - -// Flag for ULPFEC payload type. -DEFINE_int(fec_payload_type, -1, "ULPFEC payload type"); -static int FecPayloadType() { - return static_cast(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(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 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));