| #include <vector> |
| 6 | #include <string> |
| 7 | #include <memory> |
| 8 | #include <map> |
| 9 |
| 10 | #include "../Instance.h" |
| 11 | #include "GroupInstanceImpl.h" |
| 12 |
| 13 | namespace tgcalls { |
| 14 |
| 15 | class LogSinkImpl; |
| 16 | class GroupInstanceCustomInternal; |
| 17 | class Threads; |
| 18 |
| 19 | class GroupInstanceCustomImpl final : public GroupInstanceInterface { |
| 20 | public: |
| 21 | explicit GroupInstanceCustomImpl(GroupInstanceDescriptor &&descriptor); |
| 22 | ~GroupInstanceCustomImpl(); |
| 23 |
| 24 | void stop(std::function<void()> completion); |
| 25 |
| 26 | void setConnectionMode(GroupConnectionMode connectionMode, bool keepBroadcastIfWasEnabled, bool isUnifiedBroadcast); |
| 27 |
| 28 | void emitJoinPayload(std::function<void(GroupJoinPayload const &)> completion); |
| 29 | void setJoinResponsePayload(std::string const &payload); |
| 30 | void removeSsrcs(std::vector<uint32_t> ssrcs); |
| 31 | void removeIncomingVideoSource(uint32_t ssrc); |
| 32 |
| 33 | void setIsMuted(bool isMuted); |
| 34 | void setIsNoiseSuppressionEnabled(bool isNoiseSuppressionEnabled); |
| 35 | void setVideoCapture(std::shared_ptr<VideoCaptureInterface> videoCapture); |
| 36 | void setVideoSource(std::function<webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface>()> getVideoSource); |
| 37 | void setAudioOutputDevice(std::string id); |
| 38 | void setAudioInputDevice(std::string id); |
| 39 | void addExternalAudioSamples(std::vector<uint8_t> &&samples); |
| 40 |
| 41 | void addOutgoingVideoOutput(std::weak_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink); |
| 42 | void addIncomingVideoOutput(std::string const &endpointId, std::weak_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink); |
| 43 |
| 44 | void setVolume(uint32_t ssrc, double volume); |
| 45 | void setRequestedVideoChannels(std::vector<VideoChannelDescription> &&requestedVideoChannels); |
| 46 |
| 47 | void getStats(std::function<void(GroupInstanceStats)> completion); |
| 48 | void internal_addCustomNetworkEvent(bool isRemoteConnected); |
| 49 |
| 50 | private: |
| 51 | std::shared_ptr<Threads> _threads; |
| 52 | std::unique_ptr<ThreadLocalObject<GroupInstanceCustomInternal>> _internal; |
| 53 | std::unique_ptr<LogSinkImpl> _logSink; |
| 54 |
| 55 | }; |
| 56 |
| 57 | } // namespace tgcalls |
| 58 |
| 59 | #endif |
| 60 |