OLD | NEW |
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 <stdio.h> | 10 #include <stdio.h> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "webrtc/test/layer_filtering_transport.h" | 30 #include "webrtc/test/layer_filtering_transport.h" |
31 #include "webrtc/test/run_loop.h" | 31 #include "webrtc/test/run_loop.h" |
32 #include "webrtc/test/statistics.h" | 32 #include "webrtc/test/statistics.h" |
33 #include "webrtc/test/testsupport/fileutils.h" | 33 #include "webrtc/test/testsupport/fileutils.h" |
34 #include "webrtc/test/video_renderer.h" | 34 #include "webrtc/test/video_renderer.h" |
35 #include "webrtc/video/video_quality_test.h" | 35 #include "webrtc/video/video_quality_test.h" |
36 | 36 |
37 namespace webrtc { | 37 namespace webrtc { |
38 | 38 |
39 static const int kSendStatsPollingIntervalMs = 1000; | 39 static const int kSendStatsPollingIntervalMs = 1000; |
| 40 static const int kPayloadTypeH264 = 122; |
40 static const int kPayloadTypeVP8 = 123; | 41 static const int kPayloadTypeVP8 = 123; |
41 static const int kPayloadTypeVP9 = 124; | 42 static const int kPayloadTypeVP9 = 124; |
42 | 43 |
43 class VideoAnalyzer : public PacketReceiver, | 44 class VideoAnalyzer : public PacketReceiver, |
44 public Transport, | 45 public Transport, |
45 public VideoRenderer, | 46 public VideoRenderer, |
46 public VideoCaptureInput, | 47 public VideoCaptureInput, |
47 public EncodedFrameObserver, | 48 public EncodedFrameObserver, |
48 public EncodingTimeObserver { | 49 public EncodingTimeObserver { |
49 public: | 50 public: |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 | 774 |
774 void VideoQualityTest::SetupCommon(Transport* send_transport, | 775 void VideoQualityTest::SetupCommon(Transport* send_transport, |
775 Transport* recv_transport) { | 776 Transport* recv_transport) { |
776 if (params_.logs) | 777 if (params_.logs) |
777 trace_to_stderr_.reset(new test::TraceToStderr); | 778 trace_to_stderr_.reset(new test::TraceToStderr); |
778 | 779 |
779 size_t num_streams = params_.ss.streams.size(); | 780 size_t num_streams = params_.ss.streams.size(); |
780 CreateSendConfig(num_streams, 0, send_transport); | 781 CreateSendConfig(num_streams, 0, send_transport); |
781 | 782 |
782 int payload_type; | 783 int payload_type; |
783 if (params_.common.codec == "VP8") { | 784 if (params_.common.codec == "H264") { |
| 785 encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264)); |
| 786 payload_type = kPayloadTypeH264; |
| 787 } else if (params_.common.codec == "VP8") { |
784 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); | 788 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); |
785 payload_type = kPayloadTypeVP8; | 789 payload_type = kPayloadTypeVP8; |
786 } else if (params_.common.codec == "VP9") { | 790 } else if (params_.common.codec == "VP9") { |
787 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); | 791 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); |
788 payload_type = kPayloadTypeVP9; | 792 payload_type = kPayloadTypeVP9; |
789 } else { | 793 } else { |
790 RTC_NOTREACHED() << "Codec not supported!"; | 794 RTC_NOTREACHED() << "Codec not supported!"; |
791 return; | 795 return; |
792 } | 796 } |
793 video_send_config_.encoder_settings.encoder = encoder_.get(); | 797 video_send_config_.encoder_settings.encoder = encoder_.get(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 video_send_stream_->Stop(); | 1064 video_send_stream_->Stop(); |
1061 receive_stream->Stop(); | 1065 receive_stream->Stop(); |
1062 | 1066 |
1063 call->DestroyVideoReceiveStream(receive_stream); | 1067 call->DestroyVideoReceiveStream(receive_stream); |
1064 call->DestroyVideoSendStream(video_send_stream_); | 1068 call->DestroyVideoSendStream(video_send_stream_); |
1065 | 1069 |
1066 transport.StopSending(); | 1070 transport.StopSending(); |
1067 } | 1071 } |
1068 | 1072 |
1069 } // namespace webrtc | 1073 } // namespace webrtc |
OLD | NEW |