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

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

Issue 2852463002: Fix video_loopback to work with -duration flag: add missing ntp_timestamp to frames (Closed)
Patch Set: Created 3 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 | « no previous file | 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) 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 "webrtc/video/video_quality_test.h" 10 #include "webrtc/video/video_quality_test.h"
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 public: 902 public:
903 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer) 903 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer)
904 : analyzer_(analyzer), send_stream_input_(nullptr) {} 904 : analyzer_(analyzer), send_stream_input_(nullptr) {}
905 905
906 private: 906 private:
907 void OnFrame(const VideoFrame& video_frame) override { 907 void OnFrame(const VideoFrame& video_frame) override {
908 VideoFrame copy = video_frame; 908 VideoFrame copy = video_frame;
909 // Frames from the capturer does not have a rtp timestamp. 909 // Frames from the capturer does not have a rtp timestamp.
910 // Create one so it can be used for comparison. 910 // Create one so it can be used for comparison.
911 RTC_DCHECK_EQ(0, video_frame.timestamp()); 911 RTC_DCHECK_EQ(0, video_frame.timestamp());
912 if (copy.ntp_time_ms() == 0)
913 copy.set_ntp_time_ms(rtc::TimeMillis());
912 copy.set_timestamp(copy.ntp_time_ms() * 90); 914 copy.set_timestamp(copy.ntp_time_ms() * 90);
913 analyzer_->AddCapturedFrameForComparison(copy); 915 analyzer_->AddCapturedFrameForComparison(copy);
914 rtc::CritScope lock(&crit_); 916 rtc::CritScope lock(&crit_);
915 if (send_stream_input_) 917 if (send_stream_input_)
916 send_stream_input_->OnFrame(video_frame); 918 send_stream_input_->OnFrame(copy);
917 } 919 }
918 920
919 // Called when |send_stream_.SetSource()| is called. 921 // Called when |send_stream_.SetSource()| is called.
920 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 922 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
921 const rtc::VideoSinkWants& wants) override { 923 const rtc::VideoSinkWants& wants) override {
922 rtc::CritScope lock(&crit_); 924 rtc::CritScope lock(&crit_);
923 RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink); 925 RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink);
924 send_stream_input_ = sink; 926 send_stream_input_ = sink;
925 } 927 }
926 928
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 if (!params_.video.encoded_frame_base_path.empty()) { 1908 if (!params_.video.encoded_frame_base_path.empty()) {
1907 std::ostringstream str; 1909 std::ostringstream str;
1908 str << receive_logs_++; 1910 str << receive_logs_++;
1909 std::string path = 1911 std::string path =
1910 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1912 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1911 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1913 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1912 10000000); 1914 10000000);
1913 } 1915 }
1914 } 1916 }
1915 } // namespace webrtc 1917 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698