blob: 40ad47e4e2032dca6fcc26a57cab0de671cbf2c1 [file] [log] [blame]
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +00001/*
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 WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_CAPTURER_H_
11#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_CAPTURER_H_
12
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000013#include "webrtc/system_wrappers/interface/scoped_ptr.h"
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000014#include "webrtc/typedefs.h"
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000015#include "webrtc/video_engine/test/common/video_capturer.h"
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000016
17namespace webrtc {
18
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000019class CriticalSectionWrapper;
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000020class EventWrapper;
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000021class ThreadWrapper;
22
23namespace test {
24
25class FrameGenerator;
26
27class FrameGeneratorCapturer : public VideoCapturer {
28 public:
29 static FrameGeneratorCapturer* Create(newapi::VideoSendStreamInput* input,
30 FrameGenerator* frame_generator,
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000031 int target_fps);
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000032 virtual ~FrameGeneratorCapturer();
33
34 virtual void Start() OVERRIDE;
35 virtual void Stop() OVERRIDE;
36
37 private:
38 FrameGeneratorCapturer(newapi::VideoSendStreamInput* input,
39 FrameGenerator* frame_generator,
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000040 int target_fps);
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000041 bool Init();
42 void InsertFrame();
43 static bool Run(void* obj);
44
45 bool sending_;
46
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000047 scoped_ptr<EventWrapper> tick_;
48 scoped_ptr<CriticalSectionWrapper> lock_;
49 scoped_ptr<ThreadWrapper> thread_;
pbos@webrtc.orgc1506a22013-05-29 13:41:03 +000050 FrameGenerator* frame_generator_;
51
52 int target_fps_;
53};
54} // test
55} // webrtc
56
57#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_CAPTURER_H_