Notify on source and sink create and destroy.

This commit is contained in:
Peter Johnson
2016-11-18 08:49:20 -08:00
parent 154ae5dcbf
commit b245725941
5 changed files with 30 additions and 7 deletions

View File

@@ -18,6 +18,7 @@
#include "cscore_cpp.h"
#include "Handle.h"
#include "Log.h"
#include "Notifier.h"
#include "SourceImpl.h"
using namespace cs;
@@ -696,7 +697,9 @@ CS_Sink CreateMJPEGServer(llvm::StringRef name, llvm::StringRef listenAddress,
name, desc.str(),
std::unique_ptr<wpi::NetworkAcceptor>(
new wpi::TCPAcceptor(port, str.c_str(), Logger::GetInstance())));
return Sinks::GetInstance().Allocate(CS_SINK_MJPEG, sink);
auto handle = Sinks::GetInstance().Allocate(CS_SINK_MJPEG, sink);
Notifier::GetInstance().NotifySink(name, handle, CS_SINK_CREATED);
return handle;
}
} // namespace cs