| 1 | #ifndef TGCALLS_ANDROID_INTERFACE_H |
| 2 | #define TGCALLS_ANDROID_INTERFACE_H |
| 3 | |
| 4 | #include "sdk/android/native_api/video/video_source.h" |
| 5 | #include "platform/PlatformInterface.h" |
| 6 | #include "VideoCapturerInterface.h" |
| 7 | |
| 8 | namespace tgcalls { |
| 9 | |
| 10 | class AndroidInterface : public PlatformInterface { |
| 11 | public: |
| 12 | void configurePlatformAudio(int numChannels = 1) override; |
| 13 | std::unique_ptr<webrtc::VideoEncoderFactory> makeVideoEncoderFactory(std::shared_ptr<PlatformContext> platformContext, bool preferHardwareEncoding = false, bool isScreencast = false) override; |
| 14 | std::unique_ptr<webrtc::VideoDecoderFactory> makeVideoDecoderFactory(std::shared_ptr<PlatformContext> platformContext) override; |
| 15 | bool supportsEncoding(const std::string &codecName, std::shared_ptr<PlatformContext> platformContext) override; |
| 16 | rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> makeVideoSource(rtc::Thread *signalingThread, rtc::Thread *workerThread, bool screencapture) override; |
| 17 | void adaptVideoSource(rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> videoSource, int width, int height, int fps) override; |
| 18 | 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> & |
| 19 | std::unique_ptr<rtc::NetworkMonitorFactory> createNetworkMonitorFactory() override; |
| 20 | |
| 21 | private: |
| 22 | rtc::scoped_refptr<webrtc::JavaVideoTrackSourceInterface> _source[2]; |
| 23 | std::unique_ptr<webrtc::VideoEncoderFactory> hardwareVideoEncoderFactory; |
| 24 | std::unique_ptr<webrtc::VideoEncoderFactory> softwareVideoEncoderFactory; |
| 25 | |
| 26 | }; |
| 27 | |
| 28 | } // namespace tgcalls |
| 29 | |
| 30 | #endif |
| 31 | |