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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 1835053002: Change default timestamp to 64 bits in all webrtc directories. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Add TODO for timestamp. Created 4 years, 7 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/pc/srtpfilter.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
11 #include <list> 11 #include <list>
12 #include <map> 12 #include <map>
13 #include <memory> 13 #include <memory>
14 #include <sstream> 14 #include <sstream>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 #include "webrtc/base/checks.h" 20 #include "webrtc/base/checks.h"
21 #include "webrtc/base/event.h" 21 #include "webrtc/base/event.h"
22 #include "webrtc/base/timeutils.h"
23 #include "webrtc/call.h" 22 #include "webrtc/call.h"
24 #include "webrtc/call/transport_adapter.h" 23 #include "webrtc/call/transport_adapter.h"
25 #include "webrtc/common_video/include/frame_callback.h" 24 #include "webrtc/common_video/include/frame_callback.h"
26 #include "webrtc/modules/include/module_common_types.h" 25 #include "webrtc/modules/include/module_common_types.h"
27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
28 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 27 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
30 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" 29 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
31 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 30 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
32 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" 31 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
(...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 } 2925 }
2927 } 2926 }
2928 2927
2929 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; 2928 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90;
2930 auto timestamp_it = last_observed_timestamp_.find(ssrc); 2929 auto timestamp_it = last_observed_timestamp_.find(ssrc);
2931 if (timestamp_it == last_observed_timestamp_.end()) { 2930 if (timestamp_it == last_observed_timestamp_.end()) {
2932 last_observed_timestamp_[ssrc] = timestamp; 2931 last_observed_timestamp_[ssrc] = timestamp;
2933 } else { 2932 } else {
2934 // Verify timestamps are reasonably close. 2933 // Verify timestamps are reasonably close.
2935 uint32_t latest_observed = timestamp_it->second; 2934 uint32_t latest_observed = timestamp_it->second;
2936 int32_t timestamp_gap = rtc::TimeDiff(timestamp, latest_observed); 2935 // Wraparound handling is unnecessary here as long as an int variable
2936 // is used to store the result.
2937 int32_t timestamp_gap = timestamp - latest_observed;
2937 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) 2938 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap)
2938 << "Gap in timestamps (" << latest_observed << " -> " 2939 << "Gap in timestamps (" << latest_observed << " -> "
2939 << timestamp << ") too large for SSRC: " << ssrc << "."; 2940 << timestamp << ") too large for SSRC: " << ssrc << ".";
2940 timestamp_it->second = timestamp; 2941 timestamp_it->second = timestamp;
2941 } 2942 }
2942 2943
2943 rtc::CritScope lock(&crit_); 2944 rtc::CritScope lock(&crit_);
2944 // Wait for media packets on all ssrcs. 2945 // Wait for media packets on all ssrcs.
2945 if (!ssrc_observed_[ssrc] && !only_padding) { 2946 if (!ssrc_observed_[ssrc] && !only_padding) {
2946 ssrc_observed_[ssrc] = true; 2947 ssrc_observed_[ssrc] = true;
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
3501 private: 3502 private:
3502 bool video_observed_; 3503 bool video_observed_;
3503 bool audio_observed_; 3504 bool audio_observed_;
3504 SequenceNumberUnwrapper unwrapper_; 3505 SequenceNumberUnwrapper unwrapper_;
3505 std::set<int64_t> received_packet_ids_; 3506 std::set<int64_t> received_packet_ids_;
3506 } test; 3507 } test;
3507 3508
3508 RunBaseTest(&test); 3509 RunBaseTest(&test);
3509 } 3510 }
3510 } // namespace webrtc 3511 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/srtpfilter.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698