blob: 27c7295dda2e679b4e5155eff4ebb27a996c7c4f [file] [log] [blame]
magjedabb84b82017-03-28 01:56:41 -07001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_
12#define SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_
magjedabb84b82017-03-28 01:56:41 -070013
magjed24da37b2017-04-11 04:50:15 -070014#include "WebRTC/RTCMacros.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "media/base/adaptedvideotracksource.h"
16#include "rtc_base/timestampaligner.h"
magjedabb84b82017-03-28 01:56:41 -070017
magjed24da37b2017-04-11 04:50:15 -070018RTC_FWD_DECL_OBJC_CLASS(RTCVideoFrame);
19
magjedabb84b82017-03-28 01:56:41 -070020namespace webrtc {
21
22class 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 Bonadei92ea95e2017-09-15 06:47:31 +020052#endif // SDK_OBJC_FRAMEWORK_CLASSES_VIDEO_OBJCVIDEOTRACKSOURCE_H_