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

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

Issue 1534233002: Incorrect timestamps used by video analyzer with real camera Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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
OLDNEW
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 #include <stdio.h> 10 #include <stdio.h>
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <deque> 13 #include <deque>
14 #include <map> 14 #include <map>
15 #include <sstream> 15 #include <sstream>
16 #include <string> 16 #include <string>
17 #include <vector> 17 #include <vector>
18 18
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
21 #include "webrtc/base/checks.h" 21 #include "webrtc/base/checks.h"
22 #include "webrtc/base/event.h" 22 #include "webrtc/base/event.h"
23 #include "webrtc/base/format_macros.h" 23 #include "webrtc/base/format_macros.h"
24 #include "webrtc/base/scoped_ptr.h" 24 #include "webrtc/base/scoped_ptr.h"
25 #include "webrtc/call.h" 25 #include "webrtc/call.h"
26 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 26 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
27 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 27 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
29 #include "webrtc/system_wrappers/include/cpu_info.h" 29 #include "webrtc/system_wrappers/include/cpu_info.h"
30 #include "webrtc/system_wrappers/include/tick_util.h"
30 #include "webrtc/test/layer_filtering_transport.h" 31 #include "webrtc/test/layer_filtering_transport.h"
31 #include "webrtc/test/run_loop.h" 32 #include "webrtc/test/run_loop.h"
32 #include "webrtc/test/statistics.h" 33 #include "webrtc/test/statistics.h"
33 #include "webrtc/test/testsupport/fileutils.h" 34 #include "webrtc/test/testsupport/fileutils.h"
34 #include "webrtc/test/video_renderer.h" 35 #include "webrtc/test/video_renderer.h"
36 #include "webrtc/video/video_capture_input.h"
35 #include "webrtc/video/video_quality_test.h" 37 #include "webrtc/video/video_quality_test.h"
36 38
37 namespace webrtc { 39 namespace webrtc {
38 40
39 static const int kSendStatsPollingIntervalMs = 1000; 41 static const int kSendStatsPollingIntervalMs = 1000;
40 static const int kPayloadTypeVP8 = 123; 42 static const int kPayloadTypeVP8 = 123;
41 static const int kPayloadTypeVP9 = 124; 43 static const int kPayloadTypeVP9 = 124;
42 44
43 class VideoAnalyzer : public PacketReceiver, 45 class VideoAnalyzer : public PacketReceiver,
44 public Transport, 46 public Transport,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return receiver_->DeliverPacket(media_type, packet, length, packet_time); 128 return receiver_->DeliverPacket(media_type, packet, length, packet_time);
127 } 129 }
128 130
129 // EncodingTimeObserver. 131 // EncodingTimeObserver.
130 void OnReportEncodedTime(int64_t ntp_time_ms, int encode_time_ms) override { 132 void OnReportEncodedTime(int64_t ntp_time_ms, int encode_time_ms) override {
131 rtc::CritScope crit(&comparison_lock_); 133 rtc::CritScope crit(&comparison_lock_);
132 samples_encode_time_ms_[ntp_time_ms] = encode_time_ms; 134 samples_encode_time_ms_[ntp_time_ms] = encode_time_ms;
133 } 135 }
134 136
135 void IncomingCapturedFrame(const VideoFrame& video_frame) override { 137 void IncomingCapturedFrame(const VideoFrame& video_frame) override {
136 VideoFrame copy = video_frame; 138 VideoFrame copy = static_cast<internal::VideoCaptureInput*>(input_)
137 copy.set_timestamp(copy.ntp_time_ms() * 90); 139 ->UpdateTimestamps(video_frame);
138 140
139 { 141 {
140 rtc::CritScope lock(&crit_); 142 rtc::CritScope lock(&crit_);
141 if (first_send_frame_.IsZeroSize() && rtp_timestamp_delta_ == 0) 143 if (first_send_frame_.IsZeroSize() && rtp_timestamp_delta_ == 0)
142 first_send_frame_ = copy; 144 first_send_frame_ = copy;
143 145
144 frames_.push_back(copy); 146 frames_.push_back(copy);
145 } 147 }
146 148
147 input_->IncomingCapturedFrame(video_frame); 149 input_->IncomingCapturedFrame(copy);
148 } 150 }
149 151
150 bool SendRtp(const uint8_t* packet, 152 bool SendRtp(const uint8_t* packet,
151 size_t length, 153 size_t length,
152 const PacketOptions& options) override { 154 const PacketOptions& options) override {
153 RtpUtility::RtpHeaderParser parser(packet, length); 155 RtpUtility::RtpHeaderParser parser(packet, length);
154 RTPHeader header; 156 RTPHeader header;
155 parser.Parse(header); 157 parser.Parse(header);
156 158
157 int64_t current_time = 159 int64_t current_time =
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 send_stream_->Stop(); 1063 send_stream_->Stop();
1062 receive_stream->Stop(); 1064 receive_stream->Stop();
1063 1065
1064 call->DestroyVideoReceiveStream(receive_stream); 1066 call->DestroyVideoReceiveStream(receive_stream);
1065 call->DestroyVideoSendStream(send_stream_); 1067 call->DestroyVideoSendStream(send_stream_);
1066 1068
1067 transport.StopSending(); 1069 transport.StopSending();
1068 } 1070 }
1069 1071
1070 } // namespace webrtc 1072 } // namespace webrtc
OLDNEW
« webrtc/video/video_capture_input.cc ('K') | « webrtc/video/video_capture_input.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698