add addDelegate with std::function, remove FrameWriterInterfaceHelper

This commit is contained in:
cqm
2022-11-01 08:54:56 +08:00
parent d2c64b1f09
commit ac3d7bd21f
8 changed files with 25 additions and 23 deletions

View File

@@ -318,6 +318,12 @@ public:
_delegates.emplace(delegate.get(), delegate);
}
FrameWriterInterface* addDelegate(const std::function<bool(const Frame::Ptr &frame)> &cb) {
auto delegate = std::make_shared<FrameWriterInterfaceHelper>(cb);
std::lock_guard<std::mutex> lck(_mtx);
_delegates.emplace(delegate.get(), delegate);
return delegate.get();
}
/**
* 删除代理
*/