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

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

Issue 2794243002: Making FakeNetworkPipe demux audio and video packets. (Closed)
Patch Set: further fixing Created 3 years, 8 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 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ 10 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_
11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ 11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_
12 12
13 #include <memory> 13 #include <memory>
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h" 17 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
18 #include "webrtc/test/call_test.h" 18 #include "webrtc/test/call_test.h"
19 #include "webrtc/test/frame_generator.h" 19 #include "webrtc/test/frame_generator.h"
20 #include "webrtc/test/testsupport/trace_to_stderr.h" 20 #include "webrtc/test/testsupport/trace_to_stderr.h"
21 21
22 namespace webrtc { 22 namespace webrtc {
23 23
24 // Helper class to ensure we deliver correct media_type to the receiving call.
nisse-webrtc 2017/04/04 09:57:28 I wasn't aware of this class. I think we can dele
25 class MediaTypePacketReceiver : public PacketReceiver {
26 public:
27 MediaTypePacketReceiver(PacketReceiver* packet_receiver, MediaType media_type)
28 : packet_receiver_(packet_receiver), media_type_(media_type) {}
29
30 DeliveryStatus DeliverPacket(MediaType media_type,
31 const uint8_t* packet,
32 size_t length,
33 const PacketTime& packet_time) override {
34 return packet_receiver_->DeliverPacket(media_type_, packet, length,
35 packet_time);
36 }
37
38 private:
39 PacketReceiver* packet_receiver_;
40 const MediaType media_type_;
41
42 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaTypePacketReceiver);
43 };
44
24 class VideoQualityTest : public test::CallTest { 45 class VideoQualityTest : public test::CallTest {
25 public: 46 public:
26 // Parameters are grouped into smaller structs to make it easier to set 47 // Parameters are grouped into smaller structs to make it easier to set
27 // the desired elements and skip unused, using aggregate initialization. 48 // the desired elements and skip unused, using aggregate initialization.
28 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, 49 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs,
29 // which makes the implementation of VideoQualityTest a bit uglier. 50 // which makes the implementation of VideoQualityTest a bit uglier.
30 struct Params { 51 struct Params {
31 Params(); 52 Params();
32 ~Params(); 53 ~Params();
33 struct CallConfig { 54 struct CallConfig {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 int send_logs_; 167 int send_logs_;
147 168
148 VideoSendStream::DegradationPreference degradation_preference_ = 169 VideoSendStream::DegradationPreference degradation_preference_ =
149 VideoSendStream::DegradationPreference::kMaintainFramerate; 170 VideoSendStream::DegradationPreference::kMaintainFramerate;
150 Params params_; 171 Params params_;
151 }; 172 };
152 173
153 } // namespace webrtc 174 } // namespace webrtc
154 175
155 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ 176 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698