Nagram/TMessagesProj/jni/voip/tgcalls/StaticThreads.h

39 lines
852 B
C
Raw Normal View History

2021-03-19 10:25:58 +00:00
#pragma once
#include <cstddef>
#include <memory>
namespace rtc {
class Thread;
2021-04-09 13:17:32 +00:00
template <class T>
class scoped_refptr;
}
namespace webrtc {
class SharedModuleThread;
2021-03-19 10:25:58 +00:00
}
namespace tgcalls {
class Threads {
public:
virtual ~Threads() = default;
virtual rtc::Thread *getNetworkThread() = 0;
virtual rtc::Thread *getMediaThread() = 0;
virtual rtc::Thread *getWorkerThread() = 0;
2021-04-09 13:17:32 +00:00
virtual rtc::scoped_refptr<webrtc::SharedModuleThread> getSharedModuleThread() = 0;
2021-03-19 10:25:58 +00:00
// it is not possible to decrease pool size
static void setPoolSize(size_t size);
static std::shared_ptr<Threads> getThreads();
};
namespace StaticThreads {
rtc::Thread *getNetworkThread();
rtc::Thread *getMediaThread();
rtc::Thread *getWorkerThread();
2021-04-09 13:17:32 +00:00
rtc::scoped_refptr<webrtc::SharedModuleThread> getSharedMoudleThread();
2021-03-19 10:25:58 +00:00
std::shared_ptr<Threads> &getThreads();
}
};