blob: 9bde63fcff1f9288a71735be0f6f063b0cfc540e [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
11#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
12#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
13
magjed24da37b2017-04-11 04:50:15 -070014#include "WebRTC/RTCMacros.h"
magjedabb84b82017-03-28 01:56:41 -070015#include "webrtc/base/timestampaligner.h"
16#include "webrtc/media/base/adaptedvideotracksource.h"
17
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
52#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_