2021-03-19 10:25:58 +00:00
|
|
|
#ifndef TGCALLS_GROUP_INSTANCE_CUSTOM_IMPL_H
|
|
|
|
#define TGCALLS_GROUP_INSTANCE_CUSTOM_IMPL_H
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "../Instance.h"
|
|
|
|
#include "GroupInstanceImpl.h"
|
|
|
|
|
|
|
|
namespace tgcalls {
|
|
|
|
|
|
|
|
class LogSinkImpl;
|
|
|
|
class GroupInstanceCustomInternal;
|
|
|
|
class Threads;
|
|
|
|
|
|
|
|
class GroupInstanceCustomImpl final : public GroupInstanceInterface {
|
|
|
|
public:
|
2021-08-20 20:23:27 +00:00
|
|
|
static int customAudioBitrate;
|
2021-03-19 10:25:58 +00:00
|
|
|
explicit GroupInstanceCustomImpl(GroupInstanceDescriptor &&descriptor);
|
|
|
|
~GroupInstanceCustomImpl();
|
|
|
|
|
|
|
|
void stop();
|
|
|
|
|
2022-03-11 16:49:54 +00:00
|
|
|
void setConnectionMode(GroupConnectionMode connectionMode, bool keepBroadcastIfWasEnabled, bool isUnifiedBroadcast);
|
2021-03-19 10:25:58 +00:00
|
|
|
|
2021-06-25 00:43:10 +00:00
|
|
|
void emitJoinPayload(std::function<void(GroupJoinPayload const &)> completion);
|
|
|
|
void setJoinResponsePayload(std::string const &payload);
|
2021-03-19 10:25:58 +00:00
|
|
|
void removeSsrcs(std::vector<uint32_t> ssrcs);
|
2021-06-25 00:43:10 +00:00
|
|
|
void removeIncomingVideoSource(uint32_t ssrc);
|
2021-03-19 10:25:58 +00:00
|
|
|
|
|
|
|
void setIsMuted(bool isMuted);
|
2021-06-25 00:43:10 +00:00
|
|
|
void setIsNoiseSuppressionEnabled(bool isNoiseSuppressionEnabled);
|
|
|
|
void setVideoCapture(std::shared_ptr<VideoCaptureInterface> videoCapture);
|
|
|
|
void setVideoSource(std::function<webrtc::VideoTrackSourceInterface*()> getVideoSource);
|
2021-03-19 10:25:58 +00:00
|
|
|
void setAudioOutputDevice(std::string id);
|
|
|
|
void setAudioInputDevice(std::string id);
|
2021-07-15 14:24:57 +00:00
|
|
|
void addExternalAudioSamples(std::vector<uint8_t> &&samples);
|
2021-03-19 10:25:58 +00:00
|
|
|
|
2022-03-11 16:49:54 +00:00
|
|
|
void addOutgoingVideoOutput(std::weak_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink);
|
2021-06-25 00:43:10 +00:00
|
|
|
void addIncomingVideoOutput(std::string const &endpointId, std::weak_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink);
|
2021-03-19 10:25:58 +00:00
|
|
|
|
|
|
|
void setVolume(uint32_t ssrc, double volume);
|
2021-06-25 00:43:10 +00:00
|
|
|
void setRequestedVideoChannels(std::vector<VideoChannelDescription> &&requestedVideoChannels);
|
2021-03-19 10:25:58 +00:00
|
|
|
|
2021-08-05 20:35:18 +00:00
|
|
|
void getStats(std::function<void(GroupInstanceStats)> completion);
|
|
|
|
|
2021-03-19 10:25:58 +00:00
|
|
|
private:
|
|
|
|
std::shared_ptr<Threads> _threads;
|
|
|
|
std::unique_ptr<ThreadLocalObject<GroupInstanceCustomInternal>> _internal;
|
|
|
|
std::unique_ptr<LogSinkImpl> _logSink;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace tgcalls
|
|
|
|
|
|
|
|
#endif
|