vcm_capturer.h 1.4 KB

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