NDI output
This commit is contained in:
52
src/video/ndi/NdiOutput.h
Normal file
52
src/video/ndi/NdiOutput.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "video/core/VideoIOEdges.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace RenderCadenceCompositor
|
||||
{
|
||||
using NdiOutputMetrics = VideoOutputEdgeMetrics;
|
||||
|
||||
class NdiOutput final : public IVideoOutputEdge
|
||||
{
|
||||
public:
|
||||
explicit NdiOutput(std::string senderName);
|
||||
NdiOutput(const NdiOutput&) = delete;
|
||||
NdiOutput& operator=(const NdiOutput&) = delete;
|
||||
~NdiOutput() override;
|
||||
|
||||
bool Initialize(const VideoOutputEdgeConfig& config, CompletionCallback completionCallback, std::string& error) override;
|
||||
bool StartScheduledPlayback(std::string& error) override;
|
||||
bool ScheduleFrame(const VideoIOOutputFrame& frame) override;
|
||||
bool RequiresPreroll() const override { return false; }
|
||||
void Stop() override;
|
||||
void ReleaseResources() override;
|
||||
|
||||
const VideoIOState& State() const override { return mState; }
|
||||
NdiOutputMetrics Metrics() const override;
|
||||
|
||||
private:
|
||||
void CompletePendingLocked(VideoIOCompletionResult result);
|
||||
void FlushPendingLocked();
|
||||
static void PopulateState(VideoIOState& state, const VideoOutputEdgeConfig& config, const std::string& senderName);
|
||||
|
||||
std::string mSenderName;
|
||||
CompletionCallback mCompletionCallback;
|
||||
mutable std::mutex mMutex;
|
||||
void* mSender = nullptr;
|
||||
void* mPendingBuffer = nullptr;
|
||||
VideoOutputEdgeConfig mConfig;
|
||||
VideoIOState mState;
|
||||
std::atomic<bool> mInitialized{ false };
|
||||
std::atomic<bool> mRunning{ false };
|
||||
std::atomic<uint64_t> mCompletions{ 0 };
|
||||
std::atomic<uint64_t> mDropped{ 0 };
|
||||
std::atomic<uint64_t> mFlushed{ 0 };
|
||||
std::atomic<uint64_t> mScheduleFailures{ 0 };
|
||||
std::atomic<double> mScheduleCallMilliseconds{ 0.0 };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user