blob: 0b1e4bafdf8d9571b4c35b9d514ab412b9c16134 [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
14#import <WebRTC/RTCVideoFrame.h>
15
16#include "webrtc/base/timestampaligner.h"
17#include "webrtc/media/base/adaptedvideotracksource.h"
18
19namespace webrtc {
20
21class ObjcVideoTrackSource : public rtc::AdaptedVideoTrackSource {
22 public:
23 ObjcVideoTrackSource();
24
25 // This class can not be used for implementing screen casting. Hopefully, this
26 // function will be removed before we add that to iOS/Mac.
27 bool is_screencast() const override { return false; }
28
29 // Indicates that the encoder should denoise video before encoding it.
30 // If it is not set, the default configuration is used which is different
31 // depending on video codec.
32 rtc::Optional<bool> needs_denoising() const override {
33 return rtc::Optional<bool>(false);
34 }
35
36 SourceState state() const override { return SourceState::kLive; }
37
38 bool remote() const override { return false; }
39
40 // Called by RTCVideoSource.
41 void OnCapturedFrame(RTCVideoFrame* frame);
42 void OnOutputFormatRequest(int width, int height, int fps);
43
44 private:
45 rtc::VideoBroadcaster broadcaster_;
46 rtc::TimestampAligner timestamp_aligner_;
47};
48
49} // namespace webrtc
50
51#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_