| 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_VIDEO_CAPTURER_H_ | 10 #ifndef WEBRTC_TEST_VIDEO_CAPTURER_H_ |
| 11 #define WEBRTC_TEST_VIDEO_CAPTURER_H_ | 11 #define WEBRTC_TEST_VIDEO_CAPTURER_H_ |
| 12 | 12 |
| 13 #include <stddef.h> | 13 #include <stddef.h> |
| 14 | 14 |
| 15 #include <memory> | |
| 16 | |
| 17 #include "webrtc/api/video/i420_buffer.h" | |
| 18 #include "webrtc/api/video/video_frame.h" | 15 #include "webrtc/api/video/video_frame.h" |
| 19 #include "webrtc/base/criticalsection.h" | |
| 20 #include "webrtc/base/optional.h" | |
| 21 #include "webrtc/media/base/videoadapter.h" | |
| 22 #include "webrtc/media/base/videosourceinterface.h" | 16 #include "webrtc/media/base/videosourceinterface.h" |
| 23 | 17 |
| 24 namespace cricket { | 18 namespace webrtc { |
| 25 class VideoAdapter; | |
| 26 } // namespace cricket | |
| 27 | 19 |
| 28 namespace webrtc { | |
| 29 class Clock; | 20 class Clock; |
| 21 |
| 30 namespace test { | 22 namespace test { |
| 31 | 23 |
| 32 class VideoCapturer : public rtc::VideoSourceInterface<VideoFrame> { | 24 class VideoCapturer : public rtc::VideoSourceInterface<VideoFrame> { |
| 33 public: | 25 public: |
| 34 VideoCapturer(); | 26 virtual ~VideoCapturer() {} |
| 35 virtual ~VideoCapturer(); | |
| 36 | 27 |
| 37 virtual void Start() = 0; | 28 virtual void Start() = 0; |
| 38 virtual void Stop() = 0; | 29 virtual void Stop() = 0; |
| 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_; | |
| 49 }; | 30 }; |
| 50 } // namespace test | 31 } // test |
| 51 } // namespace webrtc | 32 } // webrtc |
| 52 | 33 |
| 53 #endif // WEBRTC_TEST_VIDEO_CAPTURER_H_ | 34 #endif // WEBRTC_TEST_VIDEO_CAPTURER_H_ |
| OLD | NEW |