OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ | 10 #ifndef WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ |
11 #define WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ | 11 #define WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "webrtc/api/video/video_frame.h" | 16 #include "webrtc/api/video/video_frame.h" |
17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
18 #include "webrtc/base/task_queue.h" | 18 #include "webrtc/base/platform_thread.h" |
19 #include "webrtc/test/video_capturer.h" | 19 #include "webrtc/test/video_capturer.h" |
20 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 class CriticalSectionWrapper; | 24 class CriticalSectionWrapper; |
25 class EventTimerWrapper; | 25 class EventTimerWrapper; |
26 | 26 |
27 namespace test { | 27 namespace test { |
28 | 28 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void SetFakeRotation(VideoRotation rotation); | 67 void SetFakeRotation(VideoRotation rotation); |
68 | 68 |
69 int64_t first_frame_capture_time() const { return first_frame_capture_time_; } | 69 int64_t first_frame_capture_time() const { return first_frame_capture_time_; } |
70 | 70 |
71 FrameGeneratorCapturer(Clock* clock, | 71 FrameGeneratorCapturer(Clock* clock, |
72 std::unique_ptr<FrameGenerator> frame_generator, | 72 std::unique_ptr<FrameGenerator> frame_generator, |
73 int target_fps); | 73 int target_fps); |
74 bool Init(); | 74 bool Init(); |
75 | 75 |
76 private: | 76 private: |
77 class InsertFrameTask; | |
78 | |
79 void InsertFrame(); | 77 void InsertFrame(); |
80 static bool Run(void* obj); | 78 static bool Run(void* obj); |
81 | 79 |
82 Clock* const clock_; | 80 Clock* const clock_; |
83 bool sending_; | 81 bool sending_; |
84 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(&lock_); | 82 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(&lock_); |
85 SinkWantsObserver* sink_wants_observer_ GUARDED_BY(&lock_); | 83 SinkWantsObserver* sink_wants_observer_ GUARDED_BY(&lock_); |
86 | 84 |
87 rtc::TaskQueue task_queue_; | 85 std::unique_ptr<EventTimerWrapper> tick_; |
88 rtc::CriticalSection lock_; | 86 rtc::CriticalSection lock_; |
| 87 rtc::PlatformThread thread_; |
89 std::unique_ptr<FrameGenerator> frame_generator_; | 88 std::unique_ptr<FrameGenerator> frame_generator_; |
90 | 89 |
91 int target_fps_; | 90 int target_fps_; |
92 VideoRotation fake_rotation_ = kVideoRotation_0; | 91 VideoRotation fake_rotation_ = kVideoRotation_0; |
93 | 92 |
94 int64_t first_frame_capture_time_; | 93 int64_t first_frame_capture_time_; |
95 }; | 94 }; |
96 } // namespace test | 95 } // test |
97 } // namespace webrtc | 96 } // webrtc |
98 | 97 |
99 #endif // WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ | 98 #endif // WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ |
OLD | NEW |