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

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

Issue 2493133002: Stop using hardcoded payload types for video codecs (Closed)
Patch Set: Created 4 years, 1 month 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 "webrtc/video/video_quality_test.h" 10 #include "webrtc/video/video_quality_test.h"
(...skipping 10 matching lines...) Expand all
21 #include "webrtc/base/event.h" 21 #include "webrtc/base/event.h"
22 #include "webrtc/base/format_macros.h" 22 #include "webrtc/base/format_macros.h"
23 #include "webrtc/base/optional.h" 23 #include "webrtc/base/optional.h"
24 #include "webrtc/base/platform_file.h" 24 #include "webrtc/base/platform_file.h"
25 #include "webrtc/base/timeutils.h" 25 #include "webrtc/base/timeutils.h"
26 #include "webrtc/call.h" 26 #include "webrtc/call.h"
27 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 27 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
28 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 28 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
29 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 29 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
31 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
32 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
33 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
stefan-webrtc 2016/11/15 09:00:08 Sort
magjed_webrtc 2016/11/15 17:18:26 Done.
31 #include "webrtc/system_wrappers/include/cpu_info.h" 34 #include "webrtc/system_wrappers/include/cpu_info.h"
32 #include "webrtc/test/gtest.h" 35 #include "webrtc/test/gtest.h"
33 #include "webrtc/test/layer_filtering_transport.h" 36 #include "webrtc/test/layer_filtering_transport.h"
34 #include "webrtc/test/run_loop.h" 37 #include "webrtc/test/run_loop.h"
35 #include "webrtc/test/statistics.h" 38 #include "webrtc/test/statistics.h"
36 #include "webrtc/test/testsupport/fileutils.h" 39 #include "webrtc/test/testsupport/fileutils.h"
37 #include "webrtc/test/vcm_capturer.h" 40 #include "webrtc/test/vcm_capturer.h"
38 #include "webrtc/test/video_renderer.h" 41 #include "webrtc/test/video_renderer.h"
39 #include "webrtc/voice_engine/include/voe_base.h" 42 #include "webrtc/voice_engine/include/voe_base.h"
40 43
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 void VideoQualityTest::SetupVideo(Transport* send_transport, 1001 void VideoQualityTest::SetupVideo(Transport* send_transport,
999 Transport* recv_transport) { 1002 Transport* recv_transport) {
1000 if (params_.logs) 1003 if (params_.logs)
1001 trace_to_stderr_.reset(new test::TraceToStderr); 1004 trace_to_stderr_.reset(new test::TraceToStderr);
1002 1005
1003 size_t num_streams = params_.ss.streams.size(); 1006 size_t num_streams = params_.ss.streams.size();
1004 CreateSendConfig(num_streams, 0, send_transport); 1007 CreateSendConfig(num_streams, 0, send_transport);
1005 1008
1006 int payload_type; 1009 int payload_type;
1007 if (params_.video.codec == "H264") { 1010 if (params_.video.codec == "H264") {
1008 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264)); 1011 video_encoder_.reset(H264Encoder::Create());
1009 payload_type = kPayloadTypeH264; 1012 payload_type = kPayloadTypeH264;
1010 } else if (params_.video.codec == "VP8") { 1013 } else if (params_.video.codec == "VP8") {
1011 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); 1014 video_encoder_.reset(VP8Encoder::Create());
1012 payload_type = kPayloadTypeVP8; 1015 payload_type = kPayloadTypeVP8;
1013 } else if (params_.video.codec == "VP9") { 1016 } else if (params_.video.codec == "VP9") {
1014 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); 1017 video_encoder_.reset(VP9Encoder::Create());
1015 payload_type = kPayloadTypeVP9; 1018 payload_type = kPayloadTypeVP9;
1016 } else { 1019 } else {
1017 RTC_NOTREACHED() << "Codec not supported!"; 1020 RTC_NOTREACHED() << "Codec not supported!";
1018 return; 1021 return;
1019 } 1022 }
1020 video_send_config_.encoder_settings.encoder = video_encoder_.get(); 1023 video_send_config_.encoder_settings.encoder = video_encoder_.get();
1021 video_send_config_.encoder_settings.payload_name = params_.video.codec; 1024 video_send_config_.encoder_settings.payload_name = params_.video.codec;
1022 video_send_config_.encoder_settings.payload_type = payload_type; 1025 video_send_config_.encoder_settings.payload_type = payload_type;
1023 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 1026 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
1024 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; 1027 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType;
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 std::ostringstream str; 1448 std::ostringstream str;
1446 str << receive_logs_++; 1449 str << receive_logs_++;
1447 std::string path = 1450 std::string path =
1448 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1451 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1449 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1452 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1450 10000000); 1453 10000000);
1451 } 1454 }
1452 } 1455 }
1453 1456
1454 } // namespace webrtc 1457 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698