| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 SendSideBweReceiver::SendSideBweReceiver(int flow_id) | 120 SendSideBweReceiver::SendSideBweReceiver(int flow_id) |
| 121 : BweReceiver(flow_id), last_feedback_ms_(0) { | 121 : BweReceiver(flow_id), last_feedback_ms_(0) { |
| 122 } | 122 } |
| 123 | 123 |
| 124 SendSideBweReceiver::~SendSideBweReceiver() { | 124 SendSideBweReceiver::~SendSideBweReceiver() { |
| 125 } | 125 } |
| 126 | 126 |
| 127 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, | 127 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, |
| 128 const MediaPacket& media_packet) { | 128 const MediaPacket& media_packet) { |
| 129 packet_feedback_vector_.push_back(PacketInfo( | 129 packet_feedback_vector_.push_back(PacketInfo( |
| 130 arrival_time_ms, media_packet.sender_timestamp_us() / 1000, | 130 arrival_time_ms, media_packet.sender_timestamp_ms(), |
| 131 media_packet.header().sequenceNumber, media_packet.payload_size(), true)); | 131 media_packet.header().sequenceNumber, media_packet.payload_size(), true)); |
| 132 | 132 |
| 133 received_packets_.Insert(media_packet.sequence_number(), | 133 // Log received packet information. |
| 134 media_packet.send_time_ms(), arrival_time_ms, | 134 BweReceiver::ReceivePacket(arrival_time_ms, media_packet); |
| 135 media_packet.payload_size()); | |
| 136 } | 135 } |
| 137 | 136 |
| 138 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { | 137 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { |
| 139 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) | 138 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) |
| 140 return NULL; | 139 return NULL; |
| 141 last_feedback_ms_ = now_ms; | 140 last_feedback_ms_ = now_ms; |
| 142 int64_t corrected_send_time_ms = | 141 int64_t corrected_send_time_ms = |
| 143 packet_feedback_vector_.back().send_time_ms + now_ms - | 142 packet_feedback_vector_.back().send_time_ms + now_ms - |
| 144 packet_feedback_vector_.back().arrival_time_ms; | 143 packet_feedback_vector_.back().arrival_time_ms; |
| 145 FeedbackPacket* fb = new SendSideBweFeedback( | 144 FeedbackPacket* fb = new SendSideBweFeedback( |
| 146 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); | 145 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); |
| 147 packet_feedback_vector_.clear(); | 146 packet_feedback_vector_.clear(); |
| 148 return fb; | 147 return fb; |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace bwe | 150 } // namespace bwe |
| 152 } // namespace testing | 151 } // namespace testing |
| 153 } // namespace webrtc | 152 } // namespace webrtc |
| OLD | NEW |