54 lines
2.0 KiB
C++
54 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "DeckLinkAPI_h.h"
|
|
#include "DeckLinkDisplayMode.h"
|
|
#include "DeckLinkFrameTransfer.h"
|
|
#include "DeckLinkVideoIOFormat.h"
|
|
#include "VideoIOFormat.h"
|
|
#include "VideoIOTypes.h"
|
|
#include "VideoPlayoutScheduler.h"
|
|
|
|
#include <atlbase.h>
|
|
#include <deque>
|
|
#include <string>
|
|
|
|
class OpenGLComposite;
|
|
|
|
class DeckLinkSession : public VideoIODevice
|
|
{
|
|
public:
|
|
DeckLinkSession() = default;
|
|
~DeckLinkSession();
|
|
|
|
VideoIOBackendId BackendId() const override { return VideoIOBackendId::DeckLink; }
|
|
void ReleaseResources() override;
|
|
bool DiscoverDevicesAndModes(const VideoIOConfiguration& config, std::string& error) override;
|
|
bool SelectPreferredFormats(const VideoIOConfiguration& config, std::string& error) override;
|
|
bool ConfigureInput(InputFrameCallback callback, std::string& error) override;
|
|
bool ConfigureOutput(OutputFrameCallback callback, std::string& error) override;
|
|
bool Start() override;
|
|
bool Stop() override;
|
|
const VideoIOState& State() const override { return mState; }
|
|
VideoIOState& MutableState() override { return mState; }
|
|
double FrameBudgetMilliseconds() const;
|
|
void AccountForCompletionResult(VideoIOCompletionResult completionResult) override;
|
|
bool BeginOutputFrame(VideoIOOutputFrame& frame) override;
|
|
void EndOutputFrame(VideoIOOutputFrame& frame) override;
|
|
bool ScheduleOutputFrame(const VideoIOOutputFrame& frame) override;
|
|
void HandleVideoInputFrame(IDeckLinkVideoInputFrame* inputFrame, bool hasNoInputSource);
|
|
void HandlePlayoutFrameCompleted(IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult completionResult);
|
|
|
|
private:
|
|
CComPtr<CaptureDelegate> captureDelegate;
|
|
CComPtr<PlayoutDelegate> playoutDelegate;
|
|
CComPtr<IDeckLinkInput> input;
|
|
CComPtr<IDeckLinkOutput> output;
|
|
CComPtr<IDeckLinkKeyer> keyer;
|
|
std::deque<CComPtr<IDeckLinkMutableVideoFrame>> outputVideoFrameQueue;
|
|
VideoIOState mState;
|
|
VideoPlayoutScheduler mScheduler;
|
|
InputFrameCallback mInputFrameCallback;
|
|
OutputFrameCallback mOutputFrameCallback;
|
|
DeckLinkVideoModeSelection mConfiguredModes;
|
|
};
|