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

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

Issue 2511933002: Reland of Stop using hardcoded payload types for video codecs (Closed)
Patch Set: Remove singleton pattern for InternalEncoderFactory 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
« no previous file with comments | « webrtc/video/video_encoder.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | 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 11 matching lines...) Expand all
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/audio_mixer/audio_mixer_impl.h" 29 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
30 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 30 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
32 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
33 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
34 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
32 #include "webrtc/system_wrappers/include/cpu_info.h" 35 #include "webrtc/system_wrappers/include/cpu_info.h"
33 #include "webrtc/test/gtest.h" 36 #include "webrtc/test/gtest.h"
34 #include "webrtc/test/layer_filtering_transport.h" 37 #include "webrtc/test/layer_filtering_transport.h"
35 #include "webrtc/test/run_loop.h" 38 #include "webrtc/test/run_loop.h"
36 #include "webrtc/test/statistics.h" 39 #include "webrtc/test/statistics.h"
37 #include "webrtc/test/testsupport/fileutils.h" 40 #include "webrtc/test/testsupport/fileutils.h"
38 #include "webrtc/test/vcm_capturer.h" 41 #include "webrtc/test/vcm_capturer.h"
39 #include "webrtc/test/video_renderer.h" 42 #include "webrtc/test/video_renderer.h"
40 #include "webrtc/voice_engine/include/voe_base.h" 43 #include "webrtc/voice_engine/include/voe_base.h"
41 44
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 void VideoQualityTest::SetupVideo(Transport* send_transport, 1002 void VideoQualityTest::SetupVideo(Transport* send_transport,
1000 Transport* recv_transport) { 1003 Transport* recv_transport) {
1001 if (params_.logs) 1004 if (params_.logs)
1002 trace_to_stderr_.reset(new test::TraceToStderr); 1005 trace_to_stderr_.reset(new test::TraceToStderr);
1003 1006
1004 size_t num_streams = params_.ss.streams.size(); 1007 size_t num_streams = params_.ss.streams.size();
1005 CreateSendConfig(num_streams, 0, 0, send_transport); 1008 CreateSendConfig(num_streams, 0, 0, send_transport);
1006 1009
1007 int payload_type; 1010 int payload_type;
1008 if (params_.video.codec == "H264") { 1011 if (params_.video.codec == "H264") {
1009 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264)); 1012 video_encoder_.reset(H264Encoder::Create());
1010 payload_type = kPayloadTypeH264; 1013 payload_type = kPayloadTypeH264;
1011 } else if (params_.video.codec == "VP8") { 1014 } else if (params_.video.codec == "VP8") {
1012 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); 1015 video_encoder_.reset(VP8Encoder::Create());
1013 payload_type = kPayloadTypeVP8; 1016 payload_type = kPayloadTypeVP8;
1014 } else if (params_.video.codec == "VP9") { 1017 } else if (params_.video.codec == "VP9") {
1015 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); 1018 video_encoder_.reset(VP9Encoder::Create());
1016 payload_type = kPayloadTypeVP9; 1019 payload_type = kPayloadTypeVP9;
1017 } else { 1020 } else {
1018 RTC_NOTREACHED() << "Codec not supported!"; 1021 RTC_NOTREACHED() << "Codec not supported!";
1019 return; 1022 return;
1020 } 1023 }
1021 video_send_config_.encoder_settings.encoder = video_encoder_.get(); 1024 video_send_config_.encoder_settings.encoder = video_encoder_.get();
1022 video_send_config_.encoder_settings.payload_name = params_.video.codec; 1025 video_send_config_.encoder_settings.payload_name = params_.video.codec;
1023 video_send_config_.encoder_settings.payload_type = payload_type; 1026 video_send_config_.encoder_settings.payload_type = payload_type;
1024 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 1027 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
1025 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; 1028 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType;
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 std::ostringstream str; 1485 std::ostringstream str;
1483 str << receive_logs_++; 1486 str << receive_logs_++;
1484 std::string path = 1487 std::string path =
1485 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1488 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1486 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1489 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1487 10000000); 1490 10000000);
1488 } 1491 }
1489 } 1492 }
1490 1493
1491 } // namespace webrtc 1494 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_encoder.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698