1 /*
2  *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include <string>
12 
13 #include "webrtc/config.h"
14 
15 namespace webrtc {
16 
17 class VideoSendStream;
18 class Clock;
19 
20 namespace test {
21 
22 class VideoCapturer;
23 
24 class Loopback {
25  public:
26   struct Config {
27     size_t width;
28     size_t height;
29     int32_t fps;
30     size_t min_bitrate_kbps;
31     size_t start_bitrate_kbps;
32     size_t max_bitrate_kbps;
33     int32_t min_transmit_bitrate_kbps;
34     std::string codec;
35     int32_t loss_percent;
36     int32_t link_capacity_kbps;
37     int32_t queue_size;
38     int32_t avg_propagation_delay_ms;
39     int32_t std_propagation_delay_ms;
40     bool logs;
41   };
42 
43   explicit Loopback(const Config& config);
44   virtual ~Loopback();
45 
46   void Run();
47 
48  protected:
49   virtual VideoEncoderConfig CreateEncoderConfig();
50   virtual VideoCapturer* CreateCapturer(VideoSendStream* send_stream);
51 
52   const Config config_;
53   Clock* const clock_;
54 };
55 
56 }  // namespace test
57 }  // namespace webrtc
58