| 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 <stdio.h> | 11 #include <stdio.h> |
| 12 | 12 |
| 13 #include "webrtc/base/format_macros.h" | 13 #include "webrtc/base/format_macros.h" |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
| 15 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 15 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
| 16 #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" | 16 #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" |
| 17 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 17 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 18 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 18 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
| 19 #include "webrtc/test/rtp_file_reader.h" | 19 #include "webrtc/test/rtp_file_reader.h" |
| 20 | 20 |
| 21 class Observer : public webrtc::RemoteBitrateObserver { | 21 class Observer : public webrtc::RemoteBitrateObserver { |
| 22 public: | 22 public: |
| 23 explicit Observer(webrtc::Clock* clock) : clock_(clock) {} | 23 explicit Observer(webrtc::Clock* clock) : clock_(clock) {} |
| 24 | 24 |
| 25 // Called when a receive channel group has a new bitrate estimate for the | 25 // Called when a receive channel group has a new bitrate estimate for the |
| 26 // incoming streams. | 26 // incoming streams. |
| 27 virtual void OnReceiveBitrateChanged(const std::vector<unsigned int>& ssrcs, | 27 virtual void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, |
| 28 unsigned int bitrate) { | 28 uint32_t bitrate) { |
| 29 printf("[%u] Num SSRCs: %d, bitrate: %u\n", | 29 printf("[%u] Num SSRCs: %d, bitrate: %u\n", |
| 30 static_cast<uint32_t>(clock_->TimeInMilliseconds()), | 30 static_cast<uint32_t>(clock_->TimeInMilliseconds()), |
| 31 static_cast<int>(ssrcs.size()), bitrate); | 31 static_cast<int>(ssrcs.size()), bitrate); |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual ~Observer() {} | 34 virtual ~Observer() {} |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 webrtc::Clock* clock_; | 37 webrtc::Clock* clock_; |
| 38 }; | 38 }; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 clock.TimeInMilliseconds()); | 104 clock.TimeInMilliseconds()); |
| 105 printf("Estimator used: %s\n", estimator_used.c_str()); | 105 printf("Estimator used: %s\n", estimator_used.c_str()); |
| 106 printf("Packets with absolute send time: %d\n", | 106 printf("Packets with absolute send time: %d\n", |
| 107 abs_send_time_count); | 107 abs_send_time_count); |
| 108 printf("Packets with timestamp offset: %d\n", | 108 printf("Packets with timestamp offset: %d\n", |
| 109 ts_offset_count); | 109 ts_offset_count); |
| 110 printf("Packets with no extension: %d\n", | 110 printf("Packets with no extension: %d\n", |
| 111 packet_counter - ts_offset_count - abs_send_time_count); | 111 packet_counter - ts_offset_count - abs_send_time_count); |
| 112 return 0; | 112 return 0; |
| 113 } | 113 } |
| OLD | NEW |