pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 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 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #ifndef TEST_VIDEO_CAPTURER_H_ |
| 11 | #define TEST_VIDEO_CAPTURER_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 12 | |
pbos@webrtc.org | 26d1210 | 2013-05-29 13:41:03 +0000 | [diff] [blame] | 13 | #include <stddef.h> |
| 14 | |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 15 | #include <memory> |
| 16 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "api/optional.h" |
| 18 | #include "api/video/i420_buffer.h" |
| 19 | #include "api/video/video_frame.h" |
Patrik Höglund | 9e19403 | 2018-01-04 15:58:20 +0100 | [diff] [blame] | 20 | #include "api/videosourceinterface.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 21 | #include "media/base/videoadapter.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 22 | #include "rtc_base/criticalsection.h" |
perkj | a49cbd3 | 2016-09-16 07:53:41 -0700 | [diff] [blame] | 23 | |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 24 | namespace cricket { |
| 25 | class VideoAdapter; |
| 26 | } // namespace cricket |
| 27 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 28 | namespace webrtc { |
pbos@webrtc.org | 26d1210 | 2013-05-29 13:41:03 +0000 | [diff] [blame] | 29 | class Clock; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 30 | namespace test { |
| 31 | |
perkj | a49cbd3 | 2016-09-16 07:53:41 -0700 | [diff] [blame] | 32 | class VideoCapturer : public rtc::VideoSourceInterface<VideoFrame> { |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 33 | public: |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 34 | VideoCapturer(); |
| 35 | virtual ~VideoCapturer(); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 36 | |
| 37 | virtual void Start() = 0; |
| 38 | virtual void Stop() = 0; |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 39 | |
| 40 | void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
| 41 | const rtc::VideoSinkWants& wants) override; |
| 42 | |
| 43 | protected: |
| 44 | rtc::Optional<VideoFrame> AdaptFrame(const VideoFrame& frame); |
| 45 | rtc::VideoSinkWants GetSinkWants(); |
| 46 | |
| 47 | private: |
| 48 | const std::unique_ptr<cricket::VideoAdapter> video_adapter_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 49 | }; |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 50 | } // namespace test |
| 51 | } // namespace webrtc |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 52 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 53 | #endif // TEST_VIDEO_CAPTURER_H_ |