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

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

Issue 1306813009: H.264 video codec support using OpenH264/FFmpeg (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master Created 4 years, 11 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
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 <stdio.h> 10 #include <stdio.h>
(...skipping 19 matching lines...) Expand all
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 778
778 void VideoQualityTest::SetupCommon(Transport* send_transport, 779 void VideoQualityTest::SetupCommon(Transport* send_transport,
779 Transport* recv_transport) { 780 Transport* recv_transport) {
780 if (params_.logs) 781 if (params_.logs)
781 trace_to_stderr_.reset(new test::TraceToStderr); 782 trace_to_stderr_.reset(new test::TraceToStderr);
782 783
783 size_t num_streams = params_.ss.streams.size(); 784 size_t num_streams = params_.ss.streams.size();
784 CreateSendConfig(num_streams, 0, send_transport); 785 CreateSendConfig(num_streams, 0, send_transport);
785 786
786 int payload_type; 787 int payload_type;
787 if (params_.common.codec == "VP8") { 788 if (params_.common.codec == "H264") {
789 encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264));
790 payload_type = kPayloadTypeH264;
791 } else if (params_.common.codec == "VP8") {
788 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); 792 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8));
789 payload_type = kPayloadTypeVP8; 793 payload_type = kPayloadTypeVP8;
790 } else if (params_.common.codec == "VP9") { 794 } else if (params_.common.codec == "VP9") {
791 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); 795 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9));
792 payload_type = kPayloadTypeVP9; 796 payload_type = kPayloadTypeVP9;
793 } else { 797 } else {
794 RTC_NOTREACHED() << "Codec not supported!"; 798 RTC_NOTREACHED() << "Codec not supported!";
795 return; 799 return;
796 } 800 }
797 video_send_config_.encoder_settings.encoder = encoder_.get(); 801 video_send_config_.encoder_settings.encoder = encoder_.get();
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 video_send_stream_->Stop(); 1068 video_send_stream_->Stop();
1065 receive_stream->Stop(); 1069 receive_stream->Stop();
1066 1070
1067 call->DestroyVideoReceiveStream(receive_stream); 1071 call->DestroyVideoReceiveStream(receive_stream);
1068 call->DestroyVideoSendStream(video_send_stream_); 1072 call->DestroyVideoSendStream(video_send_stream_);
1069 1073
1070 transport.StopSending(); 1074 transport.StopSending();
1071 } 1075 }
1072 1076
1073 } // namespace webrtc 1077 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698