| 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 |
| 11 #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" | 11 #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" |
| 12 | 12 |
| 13 #include <sstream> | 13 #include <sstream> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "gflags/gflags.h" | 17 #include "gflags/gflags.h" |
| 18 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 18 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
| 19 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" | 19 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
| 20 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" | 20 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
| 21 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" | 21 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" |
| 22 #include "webrtc/test/rtp_file_reader.h" | 22 #include "webrtc/test/rtp_file_reader.h" |
| 23 | 23 |
| 24 const int kMinBitrateBps = 30000; | |
| 25 | |
| 26 namespace flags { | 24 namespace flags { |
| 27 | 25 |
| 28 DEFINE_string(extension_type, | 26 DEFINE_string(extension_type, |
| 29 "abs", | 27 "abs", |
| 30 "Extension type, either abs for absolute send time or tsoffset " | 28 "Extension type, either abs for absolute send time or tsoffset " |
| 31 "for timestamp offset."); | 29 "for timestamp offset."); |
| 32 std::string ExtensionType() { | 30 std::string ExtensionType() { |
| 33 return static_cast<std::string>(FLAGS_extension_type); | 31 return static_cast<std::string>(FLAGS_extension_type); |
| 34 } | 32 } |
| 35 | 33 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 fprintf(stderr, "Unknown extension type\n"); | 107 fprintf(stderr, "Unknown extension type\n"); |
| 110 return false; | 108 return false; |
| 111 } | 109 } |
| 112 | 110 |
| 113 // Setup the RTP header parser and the bitrate estimator. | 111 // Setup the RTP header parser and the bitrate estimator. |
| 114 *parser = webrtc::RtpHeaderParser::Create(); | 112 *parser = webrtc::RtpHeaderParser::Create(); |
| 115 (*parser)->RegisterRtpHeaderExtension(extension, flags::ExtensionId()); | 113 (*parser)->RegisterRtpHeaderExtension(extension, flags::ExtensionId()); |
| 116 if (estimator) { | 114 if (estimator) { |
| 117 switch (extension) { | 115 switch (extension) { |
| 118 case webrtc::kRtpExtensionAbsoluteSendTime: { | 116 case webrtc::kRtpExtensionAbsoluteSendTime: { |
| 119 *estimator = new webrtc::RemoteBitrateEstimatorAbsSendTime( | 117 *estimator = |
| 120 observer, clock, kMinBitrateBps); | 118 new webrtc::RemoteBitrateEstimatorAbsSendTime(observer, clock); |
| 121 *estimator_used = "AbsoluteSendTimeRemoteBitrateEstimator"; | 119 *estimator_used = "AbsoluteSendTimeRemoteBitrateEstimator"; |
| 122 break; | 120 break; |
| 123 } | 121 } |
| 124 case webrtc::kRtpExtensionTransmissionTimeOffset: { | 122 case webrtc::kRtpExtensionTransmissionTimeOffset: { |
| 125 *estimator = new webrtc::RemoteBitrateEstimatorSingleStream( | 123 *estimator = |
| 126 observer, clock, kMinBitrateBps); | 124 new webrtc::RemoteBitrateEstimatorSingleStream(observer, clock); |
| 127 *estimator_used = "RemoteBitrateEstimator"; | 125 *estimator_used = "RemoteBitrateEstimator"; |
| 128 break; | 126 break; |
| 129 } | 127 } |
| 130 default: | 128 default: |
| 131 assert(false); | 129 assert(false); |
| 132 } | 130 } |
| 133 } | 131 } |
| 134 return true; | 132 return true; |
| 135 } | 133 } |
| OLD | NEW |