mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-16 12:25:50 -04:00
decklink: Add Blackmagic DeckLink capture plugin
This is a cross-platform Blackmagic device capture plugin that makes use of the manufacturer provided DeckLink SDK.
This commit is contained in:
43
plugins/decklink/decklink-device-mode.cpp
Normal file
43
plugins/decklink/decklink-device-mode.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "decklink-device-mode.hpp"
|
||||
|
||||
DeckLinkDeviceMode::DeckLinkDeviceMode(IDeckLinkDisplayMode *mode,
|
||||
long long id) : id(id), mode(mode)
|
||||
{
|
||||
if (mode == nullptr)
|
||||
return;
|
||||
|
||||
mode->AddRef();
|
||||
|
||||
decklink_string_t decklinkStringName;
|
||||
if (mode->GetName(&decklinkStringName) == S_OK)
|
||||
DeckLinkStringToStdString(decklinkStringName, name);
|
||||
}
|
||||
|
||||
DeckLinkDeviceMode::DeckLinkDeviceMode(const std::string& name, long long id) :
|
||||
id(id), mode(nullptr), name(name)
|
||||
{
|
||||
}
|
||||
|
||||
DeckLinkDeviceMode::~DeckLinkDeviceMode(void)
|
||||
{
|
||||
if (mode != nullptr)
|
||||
mode->Release();
|
||||
}
|
||||
|
||||
BMDDisplayMode DeckLinkDeviceMode::GetDisplayMode(void) const
|
||||
{
|
||||
if (mode != nullptr)
|
||||
return mode->GetDisplayMode();
|
||||
|
||||
return bmdModeUnknown;
|
||||
}
|
||||
|
||||
long long DeckLinkDeviceMode::GetId(void) const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
const std::string& DeckLinkDeviceMode::GetName(void) const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
Reference in New Issue
Block a user