blob: 383f7245d5f2fb83961bb08b49776b7c9ef700c4 [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
13#include "webrtc/video_engine/test/common/video_capturer.h"
14#include "webrtc/typedefs.h"
15
16namespace webrtc {
17
18class Clock;
19class CriticalSectionWrapper;
20class ThreadWrapper;
21
22namespace test {
23
24class FrameGenerator;
25
26class FrameGeneratorCapturer : public VideoCapturer {
27 public:
28 static FrameGeneratorCapturer* Create(newapi::VideoSendStreamInput* input,
29 FrameGenerator* frame_generator,
30 int target_fps,
31 Clock* clock);
32 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,
40 int target_fps,
41 Clock* clock);
42 bool Init();
43 void InsertFrame();
44 static bool Run(void* obj);
45
46 bool sending_;
47
48 Clock* clock_;
49 CriticalSectionWrapper* lock_;
50 ThreadWrapper* thread_;
51 FrameGenerator* frame_generator_;
52
53 int target_fps_;
54};
55} // test
56} // webrtc
57
58#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_CAPTURER_H_