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

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

Issue 2474993002: Pass selected cricket::VideoCodec down to internal H264 encoder (Closed)
Patch Set: Fix. 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 void VideoQualityTest::SetupVideo(Transport* send_transport, 998 void VideoQualityTest::SetupVideo(Transport* send_transport,
999 Transport* recv_transport) { 999 Transport* recv_transport) {
1000 if (params_.logs) 1000 if (params_.logs)
1001 trace_to_stderr_.reset(new test::TraceToStderr); 1001 trace_to_stderr_.reset(new test::TraceToStderr);
1002 1002
1003 size_t num_streams = params_.ss.streams.size(); 1003 size_t num_streams = params_.ss.streams.size();
1004 CreateSendConfig(num_streams, 0, send_transport); 1004 CreateSendConfig(num_streams, 0, send_transport);
1005 1005
1006 int payload_type; 1006 int payload_type;
1007 if (params_.video.codec == "H264") { 1007 if (params_.video.codec == "H264") {
1008 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264));
1009 payload_type = kPayloadTypeH264; 1008 payload_type = kPayloadTypeH264;
1010 } else if (params_.video.codec == "VP8") { 1009 } else if (params_.video.codec == "VP8") {
1011 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8));
1012 payload_type = kPayloadTypeVP8; 1010 payload_type = kPayloadTypeVP8;
1013 } else if (params_.video.codec == "VP9") { 1011 } else if (params_.video.codec == "VP9") {
1014 video_encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9));
1015 payload_type = kPayloadTypeVP9; 1012 payload_type = kPayloadTypeVP9;
1016 } else { 1013 } else {
1017 RTC_NOTREACHED() << "Codec not supported!"; 1014 RTC_NOTREACHED() << "Codec not supported!";
1018 return; 1015 return;
1019 } 1016 }
1017 video_encoder_.reset(
1018 VideoEncoder::Create(cricket::VideoCodec(params_.video.codec)));
1019
1020 video_send_config_.encoder_settings.encoder = video_encoder_.get(); 1020 video_send_config_.encoder_settings.encoder = video_encoder_.get();
1021 video_send_config_.encoder_settings.payload_name = params_.video.codec; 1021 video_send_config_.encoder_settings.payload_name = params_.video.codec;
1022 video_send_config_.encoder_settings.payload_type = payload_type; 1022 video_send_config_.encoder_settings.payload_type = payload_type;
1023 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 1023 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
1024 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; 1024 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType;
1025 for (size_t i = 0; i < num_streams; ++i) 1025 for (size_t i = 0; i < num_streams; ++i)
1026 video_send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]); 1026 video_send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]);
1027 1027
1028 video_send_config_.rtp.extensions.clear(); 1028 video_send_config_.rtp.extensions.clear();
1029 if (params_.call.send_side_bwe) { 1029 if (params_.call.send_side_bwe) {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 std::ostringstream str; 1445 std::ostringstream str;
1446 str << receive_logs_++; 1446 str << receive_logs_++;
1447 std::string path = 1447 std::string path =
1448 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1448 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1449 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1449 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1450 10000000); 1450 10000000);
1451 } 1451 }
1452 } 1452 }
1453 1453
1454 } // namespace webrtc 1454 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698