修复低版本gcc编译器lambda不支持可变长度模板参数捕获导致的编译问题:#2295

This commit is contained in:
xia-chu 2023-03-12 09:39:49 +08:00
parent 843e3423cf
commit d818cad3c0

View File

@ -19,11 +19,10 @@ using namespace mediakit;
class MediaHelper : public MediaSourceEvent , public std::enable_shared_from_this<MediaHelper> { class MediaHelper : public MediaSourceEvent , public std::enable_shared_from_this<MediaHelper> {
public: public:
using Ptr = std::shared_ptr<MediaHelper>; using Ptr = std::shared_ptr<MediaHelper>;
template<typename ...ArgsType> MediaHelper(const char *vhost, const char *app, const char *stream, float duration, const ProtocolOption &option) {
MediaHelper(ArgsType &&...args) {
_poller = EventPollerPool::Instance().getPoller(); _poller = EventPollerPool::Instance().getPoller();
// 在poller线程中创建DevChannel(MultiMediaSourceMuxer)对象,确保严格的线程安全限制 // 在poller线程中创建DevChannel(MultiMediaSourceMuxer)对象,确保严格的线程安全限制
_poller->sync([&]() { _channel = std::make_shared<DevChannel>(std::forward<ArgsType>(args)...); }); _poller->sync([&]() { _channel = std::make_shared<DevChannel>(vhost, app, stream, duration, option); });
} }
~MediaHelper() = default; ~MediaHelper() = default;