#ifndef TGVOIP_WEBRTC_MANAGER_H #define TGVOIP_WEBRTC_MANAGER_H #include "ThreadLocalObject.h" #include "NetworkManager.h" #include "MediaManager.h" #include "TgVoip.h" #ifdef TGVOIP_NAMESPACE namespace TGVOIP_NAMESPACE { #endif class Manager : public std::enable_shared_from_this { public: static rtc::Thread *getMediaThread(); Manager( rtc::Thread *thread, TgVoipEncryptionKey encryptionKey, bool enableP2P, std::vector const &rtcServers, std::shared_ptr videoCapture, std::function stateUpdated, std::function videoStateUpdated, std::function remoteVideoIsActiveUpdated, std::function &)> signalingDataEmitted ); ~Manager(); void start(); void receiveSignalingData(const std::vector &data); void setSendVideo(bool sendVideo); void setMuteOutgoingAudio(bool mute); void notifyIsLocalVideoActive(bool isActive); void setIncomingVideoOutput(std::shared_ptr> sink); private: rtc::Thread *_thread; TgVoipEncryptionKey _encryptionKey; bool _enableP2P; std::vector _rtcServers; std::shared_ptr _videoCapture; std::function _stateUpdated; std::function _videoStateUpdated; std::function _remoteVideoIsActiveUpdated; std::function &)> _signalingDataEmitted; std::unique_ptr> _networkManager; std::unique_ptr> _mediaManager; bool _isVideoRequested; private: }; #ifdef TGVOIP_NAMESPACE } #endif #endif