Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1761)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc

Issue 1412683004: Fix bug in how send timestamps are converted to 24 bits. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: some stuff Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const uint8_t* packet) { 57 const uint8_t* packet) {
58 return packet + rtp_header.headerLength; 58 return packet + rtp_header.headerLength;
59 } 59 }
60 60
61 size_t GetPayloadDataLength(const RTPHeader& rtp_header, 61 size_t GetPayloadDataLength(const RTPHeader& rtp_header,
62 const size_t packet_length) { 62 const size_t packet_length) {
63 return packet_length - rtp_header.headerLength - rtp_header.paddingLength; 63 return packet_length - rtp_header.headerLength - rtp_header.paddingLength;
64 } 64 }
65 65
66 uint64_t ConvertMsToAbsSendTime(int64_t time_ms) { 66 uint64_t ConvertMsToAbsSendTime(int64_t time_ms) {
67 return 0x00fffffful & ((time_ms << 18) / 1000); 67 return (((time_ms << 18) + 500) / 1000) & 0x00ffffff;
68 } 68 }
69 69
70 class LoopbackTransportTest : public webrtc::Transport { 70 class LoopbackTransportTest : public webrtc::Transport {
71 public: 71 public:
72 LoopbackTransportTest() 72 LoopbackTransportTest()
73 : packets_sent_(0), 73 : packets_sent_(0),
74 last_sent_packet_len_(0), 74 last_sent_packet_len_(0),
75 total_bytes_sent_(0), 75 total_bytes_sent_(0),
76 last_sent_packet_(nullptr) {} 76 last_sent_packet_(nullptr) {}
77 77
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()), 1420 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()),
1421 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation); 1421 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation);
1422 1422
1423 // Verify that this packet does have CVO byte. 1423 // Verify that this packet does have CVO byte.
1424 VerifyCVOPacket( 1424 VerifyCVOPacket(
1425 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()), 1425 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()),
1426 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1, 1426 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1,
1427 hdr.rotation); 1427 hdr.rotation);
1428 } 1428 }
1429 } // namespace webrtc 1429 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698