OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 namespace webrtc { | 37 namespace webrtc { |
38 namespace flags { | 38 namespace flags { |
39 | 39 |
40 // TODO(pbos): Multiple receivers. | 40 // TODO(pbos): Multiple receivers. |
41 | 41 |
42 // Flag for payload type. | 42 // Flag for payload type. |
43 static bool ValidatePayloadType(const char* flagname, int32_t payload_type) { | 43 static bool ValidatePayloadType(const char* flagname, int32_t payload_type) { |
44 return payload_type > 0 && payload_type <= 127; | 44 return payload_type > 0 && payload_type <= 127; |
45 } | 45 } |
46 DEFINE_int32(payload_type, 0, "Payload type"); | 46 DEFINE_int32(payload_type, 123, "Payload type"); |
sprang_webrtc
2017/07/10 16:00:48
The new default values, do they need to be literal
ilnik
2017/07/10 16:17:49
Done.
| |
47 static int PayloadType() { return static_cast<int>(FLAGS_payload_type); } | 47 static int PayloadType() { return static_cast<int>(FLAGS_payload_type); } |
48 static const bool payload_dummy = | 48 static const bool payload_dummy = |
49 google::RegisterFlagValidator(&FLAGS_payload_type, &ValidatePayloadType); | 49 google::RegisterFlagValidator(&FLAGS_payload_type, &ValidatePayloadType); |
50 | 50 |
51 DEFINE_int32(payload_type_rtx, 98, "Payload type"); | |
52 static int PayloadTypeRtx() { | |
53 return static_cast<int>(FLAGS_payload_type_rtx); | |
54 } | |
55 static const bool payload_rtx_dummy = | |
56 google::RegisterFlagValidator(&FLAGS_payload_type_rtx, | |
57 &ValidatePayloadType); | |
58 | |
51 // Flag for SSRC. | 59 // Flag for SSRC. |
52 static bool ValidateSsrc(const char* flagname, uint64_t ssrc) { | 60 static bool ValidateSsrc(const char* flagname, uint64_t ssrc) { |
53 return ssrc > 0 && ssrc <= 0xFFFFFFFFu; | 61 return ssrc > 0 && ssrc <= 0xFFFFFFFFu; |
54 } | 62 } |
55 | 63 |
56 DEFINE_uint64(ssrc, 0, "Incoming SSRC"); | 64 DEFINE_uint64(ssrc, 0xC0FFED, "Incoming SSRC"); |
57 static uint32_t Ssrc() { return static_cast<uint32_t>(FLAGS_ssrc); } | 65 static uint32_t Ssrc() { return static_cast<uint32_t>(FLAGS_ssrc); } |
58 static const bool ssrc_dummy = | 66 static const bool ssrc_dummy = |
59 google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrc); | 67 google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrc); |
60 | 68 |
69 DEFINE_uint64(ssrc_rtx, 0xBADCAFD, "Incoming RTX SSRC"); | |
70 static uint32_t SsrcRtx() { | |
71 return static_cast<uint32_t>(FLAGS_ssrc_rtx); | |
72 } | |
73 static const bool ssrc_rtx_dummy = | |
74 google::RegisterFlagValidator(&FLAGS_ssrc_rtx, &ValidateSsrc); | |
75 | |
61 static bool ValidateOptionalPayloadType(const char* flagname, | 76 static bool ValidateOptionalPayloadType(const char* flagname, |
62 int32_t payload_type) { | 77 int32_t payload_type) { |
63 return payload_type == -1 || ValidatePayloadType(flagname, payload_type); | 78 return payload_type == -1 || ValidatePayloadType(flagname, payload_type); |
64 } | 79 } |
65 | 80 |
66 // Flag for RED payload type. | 81 // Flag for RED payload type. |
67 DEFINE_int32(red_payload_type, -1, "RED payload type"); | 82 DEFINE_int32(red_payload_type, -1, "RED payload type"); |
68 static int RedPayloadType() { | 83 static int RedPayloadType() { |
69 return static_cast<int>(FLAGS_red_payload_type); | 84 return static_cast<int>(FLAGS_red_payload_type); |
70 } | 85 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 FileRenderPassthrough file_passthrough(flags::OutBase(), | 227 FileRenderPassthrough file_passthrough(flags::OutBase(), |
213 playback_video.get()); | 228 playback_video.get()); |
214 | 229 |
215 webrtc::RtcEventLogNullImpl event_log; | 230 webrtc::RtcEventLogNullImpl event_log; |
216 std::unique_ptr<Call> call(Call::Create(Call::Config(&event_log))); | 231 std::unique_ptr<Call> call(Call::Create(Call::Config(&event_log))); |
217 | 232 |
218 test::NullTransport transport; | 233 test::NullTransport transport; |
219 VideoReceiveStream::Config receive_config(&transport); | 234 VideoReceiveStream::Config receive_config(&transport); |
220 receive_config.rtp.remote_ssrc = flags::Ssrc(); | 235 receive_config.rtp.remote_ssrc = flags::Ssrc(); |
221 receive_config.rtp.local_ssrc = kReceiverLocalSsrc; | 236 receive_config.rtp.local_ssrc = kReceiverLocalSsrc; |
237 receive_config.rtp.rtx_ssrc = flags::SsrcRtx(); | |
238 receive_config.rtp.rtx_payload_types[flags::PayloadType()] = | |
239 flags::PayloadTypeRtx(); | |
222 receive_config.rtp.ulpfec.ulpfec_payload_type = flags::FecPayloadType(); | 240 receive_config.rtp.ulpfec.ulpfec_payload_type = flags::FecPayloadType(); |
223 receive_config.rtp.ulpfec.red_payload_type = flags::RedPayloadType(); | 241 receive_config.rtp.ulpfec.red_payload_type = flags::RedPayloadType(); |
224 receive_config.rtp.nack.rtp_history_ms = 1000; | 242 receive_config.rtp.nack.rtp_history_ms = 1000; |
225 if (flags::TransmissionOffsetId() != -1) { | 243 if (flags::TransmissionOffsetId() != -1) { |
226 receive_config.rtp.extensions.push_back(RtpExtension( | 244 receive_config.rtp.extensions.push_back(RtpExtension( |
227 RtpExtension::kTimestampOffsetUri, flags::TransmissionOffsetId())); | 245 RtpExtension::kTimestampOffsetUri, flags::TransmissionOffsetId())); |
228 } | 246 } |
229 if (flags::AbsSendTimeId() != -1) { | 247 if (flags::AbsSendTimeId() != -1) { |
230 receive_config.rtp.extensions.push_back( | 248 receive_config.rtp.extensions.push_back( |
231 RtpExtension(RtpExtension::kAbsSendTimeUri, flags::AbsSendTimeId())); | 249 RtpExtension(RtpExtension::kAbsSendTimeUri, flags::AbsSendTimeId())); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 } | 345 } |
328 } // namespace webrtc | 346 } // namespace webrtc |
329 | 347 |
330 int main(int argc, char* argv[]) { | 348 int main(int argc, char* argv[]) { |
331 ::testing::InitGoogleTest(&argc, argv); | 349 ::testing::InitGoogleTest(&argc, argv); |
332 google::ParseCommandLineFlags(&argc, &argv, true); | 350 google::ParseCommandLineFlags(&argc, &argv, true); |
333 | 351 |
334 webrtc::test::RunTest(webrtc::RtpReplay); | 352 webrtc::test::RunTest(webrtc::RtpReplay); |
335 return 0; | 353 return 0; |
336 } | 354 } |
OLD | NEW |