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

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

Issue 1569853002: Measure encoding time on encode callbacks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add extended overuse time Created 4 years, 11 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
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 <map> 11 #include <map>
12 #include <sstream> 12 #include <sstream>
13 #include <string> 13 #include <string>
14 14
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 #include "webrtc/base/checks.h" 17 #include "webrtc/base/checks.h"
18 #include "webrtc/base/event.h" 18 #include "webrtc/base/event.h"
19 #include "webrtc/base/logging.h"
mflodman 2016/01/21 08:00:04 What is this needed for?
pbos-webrtc 2016/01/21 14:18:33 Local printf debugging. Gone.
19 #include "webrtc/base/scoped_ptr.h" 20 #include "webrtc/base/scoped_ptr.h"
20 #include "webrtc/call.h" 21 #include "webrtc/call.h"
21 #include "webrtc/call/transport_adapter.h" 22 #include "webrtc/call/transport_adapter.h"
22 #include "webrtc/frame_callback.h" 23 #include "webrtc/frame_callback.h"
23 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
24 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
25 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 26 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
26 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" 27 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
27 #include "webrtc/modules/video_coding/include/video_coding_defines.h" 28 #include "webrtc/modules/video_coding/include/video_coding_defines.h"
28 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 29 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
(...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 } 2456 }
2456 2457
2457 bool CheckSendStats() { 2458 bool CheckSendStats() {
2458 RTC_DCHECK(send_stream_ != nullptr); 2459 RTC_DCHECK(send_stream_ != nullptr);
2459 VideoSendStream::Stats stats = send_stream_->GetStats(); 2460 VideoSendStream::Stats stats = send_stream_->GetStats();
2460 2461
2461 send_stats_filled_["NumStreams"] |= 2462 send_stats_filled_["NumStreams"] |=
2462 stats.substreams.size() == expected_send_ssrcs_.size(); 2463 stats.substreams.size() == expected_send_ssrcs_.size();
2463 2464
2464 send_stats_filled_["CpuOveruseMetrics"] |= 2465 send_stats_filled_["CpuOveruseMetrics"] |=
2465 stats.avg_encode_time_ms != 0 || stats.encode_usage_percent != 0; 2466 stats.avg_encode_time_ms != 0 && stats.encode_usage_percent != 0;
2466 2467
2467 send_stats_filled_["EncoderImplementationName"] |= 2468 send_stats_filled_["EncoderImplementationName"] |=
2468 stats.encoder_implementation_name == 2469 stats.encoder_implementation_name ==
2469 test::FakeEncoder::kImplementationName; 2470 test::FakeEncoder::kImplementationName;
2470 2471
2471 for (std::map<uint32_t, VideoSendStream::StreamStats>::const_iterator it = 2472 for (std::map<uint32_t, VideoSendStream::StreamStats>::const_iterator it =
2472 stats.substreams.begin(); 2473 stats.substreams.begin();
2473 it != stats.substreams.end(); ++it) { 2474 it != stats.substreams.end(); ++it) {
2474 EXPECT_TRUE(expected_send_ssrcs_.find(it->first) != 2475 EXPECT_TRUE(expected_send_ssrcs_.find(it->first) !=
2475 expected_send_ssrcs_.end()); 2476 expected_send_ssrcs_.end());
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
3323 private: 3324 private:
3324 bool video_observed_; 3325 bool video_observed_;
3325 bool audio_observed_; 3326 bool audio_observed_;
3326 SequenceNumberUnwrapper unwrapper_; 3327 SequenceNumberUnwrapper unwrapper_;
3327 std::set<int64_t> received_packet_ids_; 3328 std::set<int64_t> received_packet_ids_;
3328 } test; 3329 } test;
3329 3330
3330 RunBaseTest(&test); 3331 RunBaseTest(&test);
3331 } 3332 }
3332 } // namespace webrtc 3333 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698