1 /*
2  *  Copyright (c) 2013 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 #ifndef TEST_VCM_CAPTURER_H_
11 #define TEST_VCM_CAPTURER_H_
12 
13 #include <memory>
14 #include <vector>
15 
16 #include "api/scoped_refptr.h"
17 #include "modules/video_capture/video_capture.h"
18 #include "test/test_video_capturer.h"
19 
20 namespace webrtc {
21 namespace test {
22 
23 class VcmCapturer : public TestVideoCapturer,
24                     public rtc::VideoSinkInterface<VideoFrame> {
25  public:
26   static VcmCapturer* Create(size_t width,
27                              size_t height,
28                              size_t target_fps,
29                              size_t capture_device_index);
30   virtual ~VcmCapturer();
31 
32   void OnFrame(const VideoFrame& frame) override;
33 
34  private:
35   VcmCapturer();
36   bool Init(size_t width,
37             size_t height,
38             size_t target_fps,
39             size_t capture_device_index);
40   void Destroy();
41 
42   rtc::scoped_refptr<VideoCaptureModule> vcm_;
43   VideoCaptureCapability capability_;
44 };
45 
46 }  // namespace test
47 }  // namespace webrtc
48 
49 #endif  // TEST_VCM_CAPTURER_H_
50