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 <stdio.h> | 13 #include <stdio.h> |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 16 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
| 17 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
17 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" | 18 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
18 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" | 19 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" |
19 #include "webrtc/test/rtp_file_reader.h" | 20 #include "webrtc/test/rtp_file_reader.h" |
20 | 21 |
21 const int kMinBitrateBps = 30000; | 22 const int kMinBitrateBps = 30000; |
22 | 23 |
23 bool ParseArgsAndSetupEstimator(int argc, | 24 bool ParseArgsAndSetupEstimator(int argc, |
24 char** argv, | 25 char** argv, |
25 webrtc::Clock* clock, | 26 webrtc::Clock* clock, |
26 webrtc::RemoteBitrateObserver* observer, | 27 webrtc::RemoteBitrateObserver* observer, |
(...skipping 17 matching lines...) Expand all Loading... |
44 fprintf(stderr, "Extension: abs\n"); | 45 fprintf(stderr, "Extension: abs\n"); |
45 } | 46 } |
46 int id = atoi(argv[2]); | 47 int id = atoi(argv[2]); |
47 | 48 |
48 // Setup the RTP header parser and the bitrate estimator. | 49 // Setup the RTP header parser and the bitrate estimator. |
49 *parser = webrtc::RtpHeaderParser::Create(); | 50 *parser = webrtc::RtpHeaderParser::Create(); |
50 (*parser)->RegisterRtpHeaderExtension(extension, id); | 51 (*parser)->RegisterRtpHeaderExtension(extension, id); |
51 if (estimator) { | 52 if (estimator) { |
52 switch (extension) { | 53 switch (extension) { |
53 case webrtc::kRtpExtensionAbsoluteSendTime: { | 54 case webrtc::kRtpExtensionAbsoluteSendTime: { |
54 webrtc::AbsoluteSendTimeRemoteBitrateEstimatorFactory factory; | 55 *estimator = new webrtc::RemoteBitrateEstimatorAbsSendTime( |
55 *estimator = factory.Create(observer, clock, webrtc::kAimdControl, | 56 observer, clock, kMinBitrateBps); |
56 kMinBitrateBps); | |
57 *estimator_used = "AbsoluteSendTimeRemoteBitrateEstimator"; | 57 *estimator_used = "AbsoluteSendTimeRemoteBitrateEstimator"; |
58 break; | 58 break; |
59 } | 59 } |
60 case webrtc::kRtpExtensionTransmissionTimeOffset: { | 60 case webrtc::kRtpExtensionTransmissionTimeOffset: { |
61 webrtc::RemoteBitrateEstimatorFactory factory; | 61 *estimator = new webrtc::RemoteBitrateEstimatorSingleStream( |
62 *estimator = factory.Create(observer, clock, webrtc::kAimdControl, | 62 observer, clock, kMinBitrateBps); |
63 kMinBitrateBps); | |
64 *estimator_used = "RemoteBitrateEstimator"; | 63 *estimator_used = "RemoteBitrateEstimator"; |
65 break; | 64 break; |
66 } | 65 } |
67 default: | 66 default: |
68 assert(false); | 67 assert(false); |
69 } | 68 } |
70 } | 69 } |
71 return true; | 70 return true; |
72 } | 71 } |
OLD | NEW |