| 6 | #import <CoreVideo/CoreVideo.h> |
| 7 |
| 8 | namespace tgcalls { |
| 9 |
| 10 | class DarwinVideoFrame : public PlatformVideoFrame { |
| 11 | public: |
| 12 | DarwinVideoFrame(CVPixelBufferRef pixelBuffer); |
| 13 | virtual ~DarwinVideoFrame(); |
| 14 |
| 15 | CVPixelBufferRef pixelBuffer() const { |
| 16 | return _pixelBuffer; |
| 17 | } |
| 18 |
| 19 | private: |
| 20 | CVPixelBufferRef _pixelBuffer = nullptr; |
| 21 | }; |
| 22 |
| 23 | class DarwinInterface : public PlatformInterface { |
| 24 | public: |
| 25 | std::unique_ptr<rtc::NetworkMonitorFactory> createNetworkMonitorFactory() override; |
| 26 | void configurePlatformAudio(int numChannels) override; |
| 27 | std::unique_ptr<webrtc::VideoEncoderFactory> makeVideoEncoderFactory(bool preferHardwareEncoding, bool isScreencast) override; |
| 28 | std::unique_ptr<webrtc::VideoDecoderFactory> makeVideoDecoderFactory() override; |
| 29 | bool supportsEncoding(const std::string &codecName) override; |
| 30 | webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> makeVideoSource(rtc::Thread *signalingThread, rtc::Thread *workerThread) override; |
| 31 | virtual void adaptVideoSource(webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> videoSource, int width, int height, int fps) override; |
| 32 | std::unique_ptr<VideoCapturerInterface> makeVideoCapturer(webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source, std::string deviceId, std::function<void(VideoState)> stateUpdated, std::function<void(PlatformCaptureInfo)> captureInfoUpdated, std::shared_ptr<PlatformContext> platformContext, std::pair<int, int> &outResolution) override; |
| 33 | virtual webrtc::scoped_refptr<WrappedAudioDeviceModule> wrapAudioDeviceModule(webrtc::scoped_refptr<webrtc::AudioDeviceModule> module) override; |
| 34 | virtual void setupVideoDecoding(AVCodecContext *codecContext) override; |
| 35 | virtual webrtc::scoped_refptr<webrtc::VideoFrameBuffer> createPlatformFrameFromData(AVFrame const *frame) override; |
| 36 | }; |
| 37 |
| 38 | } // namespace tgcalls |
| 39 |
| 40 | #endif |
| 41 |