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

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

Issue 2972423002: Fix video_replay tool to respect RTX stream and fix default parameters. (Closed)
Patch Set: Fix format Created 3 years, 5 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/video/replay.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) 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "webrtc/test/run_loop.h" 45 #include "webrtc/test/run_loop.h"
46 #include "webrtc/test/statistics.h" 46 #include "webrtc/test/statistics.h"
47 #include "webrtc/test/testsupport/fileutils.h" 47 #include "webrtc/test/testsupport/fileutils.h"
48 #include "webrtc/test/vcm_capturer.h" 48 #include "webrtc/test/vcm_capturer.h"
49 #include "webrtc/test/video_renderer.h" 49 #include "webrtc/test/video_renderer.h"
50 #include "webrtc/voice_engine/include/voe_base.h" 50 #include "webrtc/voice_engine/include/voe_base.h"
51 51
52 namespace { 52 namespace {
53 53
54 constexpr int kSendStatsPollingIntervalMs = 1000; 54 constexpr int kSendStatsPollingIntervalMs = 1000;
55 constexpr int kPayloadTypeH264 = 122;
56 constexpr int kPayloadTypeVP8 = 123;
57 constexpr int kPayloadTypeVP9 = 124;
58 55
59 constexpr size_t kMaxComparisons = 10; 56 constexpr size_t kMaxComparisons = 10;
60 constexpr char kSyncGroup[] = "av_sync"; 57 constexpr char kSyncGroup[] = "av_sync";
61 constexpr int kOpusMinBitrateBps = 6000; 58 constexpr int kOpusMinBitrateBps = 6000;
62 constexpr int kOpusBitrateFbBps = 32000; 59 constexpr int kOpusBitrateFbBps = 32000;
63 constexpr int kFramesSentInQuickTest = 1; 60 constexpr int kFramesSentInQuickTest = 1;
64 constexpr uint32_t kThumbnailSendSsrcStart = 0xE0000; 61 constexpr uint32_t kThumbnailSendSsrcStart = 0xE0000;
65 constexpr uint32_t kThumbnailRtxSsrcStart = 0xF0000; 62 constexpr uint32_t kThumbnailRtxSsrcStart = 0xF0000;
66 63
67 constexpr int kDefaultMaxQp = cricket::WebRtcVideoChannel::kDefaultQpMax; 64 constexpr int kDefaultMaxQp = cricket::WebRtcVideoChannel::kDefaultQpMax;
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 parent_->PreEncodeOnFrame(video_frame); 578 parent_->PreEncodeOnFrame(video_frame);
582 } 579 }
583 580
584 private: 581 private:
585 VideoAnalyzer* const parent_; 582 VideoAnalyzer* const parent_;
586 }; 583 };
587 584
588 bool IsInSelectedSpatialAndTemporalLayer(const uint8_t* packet, 585 bool IsInSelectedSpatialAndTemporalLayer(const uint8_t* packet,
589 size_t length, 586 size_t length,
590 const RTPHeader& header) { 587 const RTPHeader& header) {
591 if (header.payloadType != kPayloadTypeVP9 && 588 if (header.payloadType != test::CallTest::kPayloadTypeVP9 &&
592 header.payloadType != kPayloadTypeVP8) { 589 header.payloadType != test::CallTest::kPayloadTypeVP8) {
593 return true; 590 return true;
594 } else { 591 } else {
595 // Get VP8 and VP9 specific header to check layers indexes. 592 // Get VP8 and VP9 specific header to check layers indexes.
596 const uint8_t* payload = packet + header.headerLength; 593 const uint8_t* payload = packet + header.headerLength;
597 const size_t payload_length = length - header.headerLength; 594 const size_t payload_length = length - header.headerLength;
598 const size_t payload_data_length = payload_length - header.paddingLength; 595 const size_t payload_data_length = payload_length - header.paddingLength;
599 const bool is_vp8 = header.payloadType == kPayloadTypeVP8; 596 const bool is_vp8 = header.payloadType == test::CallTest::kPayloadTypeVP8;
600 std::unique_ptr<RtpDepacketizer> depacketizer( 597 std::unique_ptr<RtpDepacketizer> depacketizer(
601 RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9)); 598 RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9));
602 RtpDepacketizer::ParsedPayload parsed_payload; 599 RtpDepacketizer::ParsedPayload parsed_payload;
603 bool result = 600 bool result =
604 depacketizer->Parse(&parsed_payload, payload, payload_data_length); 601 depacketizer->Parse(&parsed_payload, payload, payload_data_length);
605 RTC_DCHECK(result); 602 RTC_DCHECK(result);
606 const int temporal_idx = static_cast<int>( 603 const int temporal_idx = static_cast<int>(
607 is_vp8 ? parsed_payload.type.Video.codecHeader.VP8.temporalIdx 604 is_vp8 ? parsed_payload.type.Video.codecHeader.VP8.temporalIdx
608 : parsed_payload.type.Video.codecHeader.VP9.temporal_idx); 605 : parsed_payload.type.Video.codecHeader.VP9.temporal_idx);
609 const int spatial_idx = static_cast<int>( 606 const int spatial_idx = static_cast<int>(
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 if (!params_.video.encoded_frame_base_path.empty()) { 2041 if (!params_.video.encoded_frame_base_path.empty()) {
2045 std::ostringstream str; 2042 std::ostringstream str;
2046 str << receive_logs_++; 2043 str << receive_logs_++;
2047 std::string path = 2044 std::string path =
2048 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 2045 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
2049 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 2046 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
2050 10000000); 2047 10000000);
2051 } 2048 }
2052 } 2049 }
2053 } // namespace webrtc 2050 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/replay.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698