| 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 <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "webrtc/base/criticalsection.h" | 15 #include "webrtc/base/criticalsection.h" |
| 16 #include "webrtc/base/platform_thread.h" | 16 #include "webrtc/base/platform_thread.h" |
| 17 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
| 18 #include "webrtc/common_video/rotation.h" |
| 18 #include "webrtc/test/video_capturer.h" | 19 #include "webrtc/test/video_capturer.h" |
| 19 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
| 20 | 21 |
| 21 namespace webrtc { | 22 namespace webrtc { |
| 22 | 23 |
| 23 class CriticalSectionWrapper; | 24 class CriticalSectionWrapper; |
| 24 class EventTimerWrapper; | 25 class EventTimerWrapper; |
| 25 | 26 |
| 26 namespace test { | 27 namespace test { |
| 27 | 28 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 const std::string& file_name, | 40 const std::string& file_name, |
| 40 size_t width, | 41 size_t width, |
| 41 size_t height, | 42 size_t height, |
| 42 int target_fps, | 43 int target_fps, |
| 43 Clock* clock); | 44 Clock* clock); |
| 44 virtual ~FrameGeneratorCapturer(); | 45 virtual ~FrameGeneratorCapturer(); |
| 45 | 46 |
| 46 void Start() override; | 47 void Start() override; |
| 47 void Stop() override; | 48 void Stop() override; |
| 48 void ForceFrame(); | 49 void ForceFrame(); |
| 50 void SetFakeRotation(VideoRotation rotation); |
| 49 | 51 |
| 50 int64_t first_frame_capture_time() const { return first_frame_capture_time_; } | 52 int64_t first_frame_capture_time() const { return first_frame_capture_time_; } |
| 51 | 53 |
| 52 FrameGeneratorCapturer(Clock* clock, | 54 FrameGeneratorCapturer(Clock* clock, |
| 53 VideoCaptureInput* input, | 55 VideoCaptureInput* input, |
| 54 FrameGenerator* frame_generator, | 56 FrameGenerator* frame_generator, |
| 55 int target_fps); | 57 int target_fps); |
| 56 bool Init(); | 58 bool Init(); |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 void InsertFrame(); | 61 void InsertFrame(); |
| 60 static bool Run(void* obj); | 62 static bool Run(void* obj); |
| 61 | 63 |
| 62 Clock* const clock_; | 64 Clock* const clock_; |
| 63 bool sending_; | 65 bool sending_; |
| 64 | 66 |
| 65 rtc::scoped_ptr<EventTimerWrapper> tick_; | 67 rtc::scoped_ptr<EventTimerWrapper> tick_; |
| 66 rtc::CriticalSection lock_; | 68 rtc::CriticalSection lock_; |
| 67 rtc::PlatformThread thread_; | 69 rtc::PlatformThread thread_; |
| 68 rtc::scoped_ptr<FrameGenerator> frame_generator_; | 70 rtc::scoped_ptr<FrameGenerator> frame_generator_; |
| 69 | 71 |
| 70 int target_fps_; | 72 int target_fps_; |
| 73 VideoRotation fake_rotation_ = kVideoRotation_0; |
| 71 | 74 |
| 72 int64_t first_frame_capture_time_; | 75 int64_t first_frame_capture_time_; |
| 73 }; | 76 }; |
| 74 } // test | 77 } // test |
| 75 } // webrtc | 78 } // webrtc |
| 76 | 79 |
| 77 #endif // WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ | 80 #endif // WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_ |
| OLD | NEW |