magjed | abb84b8 | 2017-03-28 01:56:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame^] | 11 | #ifndef SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_ |
| 12 | #define SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_ |
magjed | abb84b8 | 2017-03-28 01:56:41 -0700 | [diff] [blame] | 13 | |
magjed | 24da37b | 2017-04-11 04:50:15 -0700 | [diff] [blame] | 14 | #include "WebRTC/RTCMacros.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame^] | 15 | #include "media/base/adaptedvideotracksource.h" |
| 16 | #include "rtc_base/timestampaligner.h" |
magjed | abb84b8 | 2017-03-28 01:56:41 -0700 | [diff] [blame] | 17 | |
magjed | 24da37b | 2017-04-11 04:50:15 -0700 | [diff] [blame] | 18 | RTC_FWD_DECL_OBJC_CLASS(RTCVideoFrame); |
| 19 | |
magjed | abb84b8 | 2017-03-28 01:56:41 -0700 | [diff] [blame] | 20 | namespace webrtc { |
| 21 | |
| 22 | class ObjcVideoTrackSource : public rtc::AdaptedVideoTrackSource { |
| 23 | public: |
| 24 | ObjcVideoTrackSource(); |
| 25 | |
| 26 | // This class can not be used for implementing screen casting. Hopefully, this |
| 27 | // function will be removed before we add that to iOS/Mac. |
| 28 | bool is_screencast() const override { return false; } |
| 29 | |
| 30 | // Indicates that the encoder should denoise video before encoding it. |
| 31 | // If it is not set, the default configuration is used which is different |
| 32 | // depending on video codec. |
| 33 | rtc::Optional<bool> needs_denoising() const override { |
| 34 | return rtc::Optional<bool>(false); |
| 35 | } |
| 36 | |
| 37 | SourceState state() const override { return SourceState::kLive; } |
| 38 | |
| 39 | bool remote() const override { return false; } |
| 40 | |
| 41 | // Called by RTCVideoSource. |
| 42 | void OnCapturedFrame(RTCVideoFrame* frame); |
| 43 | void OnOutputFormatRequest(int width, int height, int fps); |
| 44 | |
| 45 | private: |
| 46 | rtc::VideoBroadcaster broadcaster_; |
| 47 | rtc::TimestampAligner timestamp_aligner_; |
| 48 | }; |
| 49 | |
| 50 | } // namespace webrtc |
| 51 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame^] | 52 | #endif // SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_ |