NDI output
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "NdiInput.h"
|
||||
|
||||
#include "NdiInputFormat.h"
|
||||
#include "NdiRuntime.h"
|
||||
#include "logging/Logger.h"
|
||||
#include "video/core/VideoIOFormat.h"
|
||||
|
||||
@@ -17,28 +18,6 @@ namespace
|
||||
constexpr std::chrono::milliseconds kDiscoveryRetry(500);
|
||||
constexpr uint32_t kCaptureTimeoutMilliseconds = 250;
|
||||
|
||||
std::mutex gNdiRuntimeMutex;
|
||||
unsigned gNdiRuntimeUsers = 0;
|
||||
|
||||
bool AcquireNdiRuntime()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(gNdiRuntimeMutex);
|
||||
if (gNdiRuntimeUsers == 0 && !NDIlib_initialize())
|
||||
return false;
|
||||
++gNdiRuntimeUsers;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReleaseNdiRuntime()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(gNdiRuntimeMutex);
|
||||
if (gNdiRuntimeUsers == 0)
|
||||
return;
|
||||
--gNdiRuntimeUsers;
|
||||
if (gNdiRuntimeUsers == 0)
|
||||
NDIlib_destroy();
|
||||
}
|
||||
|
||||
bool IsDefaultDeviceName(const std::string& device)
|
||||
{
|
||||
return device.empty() || device == "default" || device == "auto";
|
||||
|
||||
Reference in New Issue
Block a user