| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 11 matching lines...) Expand all Loading... |
| 22 void TimestampScaler::ToInternal(Packet* packet) { | 22 void TimestampScaler::ToInternal(Packet* packet) { |
| 23 if (!packet) { | 23 if (!packet) { |
| 24 return; | 24 return; |
| 25 } | 25 } |
| 26 packet->timestamp = ToInternal(packet->timestamp, packet->payload_type); | 26 packet->timestamp = ToInternal(packet->timestamp, packet->payload_type); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TimestampScaler::ToInternal(PacketList* packet_list) { | 29 void TimestampScaler::ToInternal(PacketList* packet_list) { |
| 30 PacketList::iterator it; | 30 PacketList::iterator it; |
| 31 for (it = packet_list->begin(); it != packet_list->end(); ++it) { | 31 for (it = packet_list->begin(); it != packet_list->end(); ++it) { |
| 32 ToInternal(*it); | 32 ToInternal(&(*it)); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 uint32_t TimestampScaler::ToInternal(uint32_t external_timestamp, | 36 uint32_t TimestampScaler::ToInternal(uint32_t external_timestamp, |
| 37 uint8_t rtp_payload_type) { | 37 uint8_t rtp_payload_type) { |
| 38 const DecoderDatabase::DecoderInfo* info = | 38 const DecoderDatabase::DecoderInfo* info = |
| 39 decoder_database_.GetDecoderInfo(rtp_payload_type); | 39 decoder_database_.GetDecoderInfo(rtp_payload_type); |
| 40 if (!info) { | 40 if (!info) { |
| 41 // Payload type is unknown. Do not scale. | 41 // Payload type is unknown. Do not scale. |
| 42 return external_timestamp; | 42 return external_timestamp; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } else { | 78 } else { |
| 79 const int64_t internal_diff = int64_t{internal_timestamp} - internal_ref_; | 79 const int64_t internal_diff = int64_t{internal_timestamp} - internal_ref_; |
| 80 assert(numerator_ > 0); // Should not be possible. | 80 assert(numerator_ > 0); // Should not be possible. |
| 81 // Do not update references in this method. | 81 // Do not update references in this method. |
| 82 // Switch |denominator_| and |numerator_| to convert the other way. | 82 // Switch |denominator_| and |numerator_| to convert the other way. |
| 83 return external_ref_ + (internal_diff * denominator_) / numerator_; | 83 return external_ref_ + (internal_diff * denominator_) / numerator_; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace webrtc | 87 } // namespace webrtc |
| OLD | NEW |