Transparency

This commit is contained in:
2026-05-02 19:29:18 +10:00
parent 1d9bf151ce
commit 8ce556330f
5 changed files with 204 additions and 5 deletions

View File

@@ -320,10 +320,14 @@ bool OpenGLComposite::InitDeckLink()
BSTR modelNameBstr = NULL;
if (deckLinkAttributes->GetString(BMDDeckLinkModelName, &modelNameBstr) == S_OK && modelNameBstr != NULL)
{
_bstr_t modelNameWrapper(modelNameBstr, false);
const char* modelNameChars = modelNameWrapper;
if (modelNameChars != NULL)
modelName = modelNameChars;
const int requiredBytes = WideCharToMultiByte(CP_UTF8, 0, modelNameBstr, -1, NULL, 0, NULL, NULL);
if (requiredBytes > 1)
{
std::vector<char> utf8Name(static_cast<std::size_t>(requiredBytes), '\0');
if (WideCharToMultiByte(CP_UTF8, 0, modelNameBstr, -1, utf8Name.data(), requiredBytes, NULL, NULL) > 0)
modelName.assign(utf8Name.data());
}
SysFreeString(modelNameBstr);
}
deckLinkAttributes->Release();
deckLinkAttributes = NULL;
@@ -525,6 +529,13 @@ bool OpenGLComposite::InitDeckLink()
error:
if (!bSuccess)
{
if (mDLKeyer != NULL)
{
mDLKeyer->Disable();
mDLKeyer->Release();
mDLKeyer = NULL;
mDeckLinkExternalKeyingActive = false;
}
if (mDLInput != NULL)
{
mDLInput->Release();
@@ -990,6 +1001,23 @@ bool OpenGLComposite::Stop()
if (mControlServer)
mControlServer->Stop();
if (mDLKeyer != NULL)
{
mDLKeyer->Disable();
mDeckLinkExternalKeyingActive = false;
if (mRuntimeHost)
{
mRuntimeHost->SetDeckLinkOutputStatus(
mDeckLinkOutputModelName,
mDeckLinkSupportsInternalKeying,
mDeckLinkSupportsExternalKeying,
mDeckLinkKeyerInterfaceAvailable,
mRuntimeHost->ExternalKeyingEnabled(),
mDeckLinkExternalKeyingActive,
"External keying has been disabled.");
}
}
mDLInput->StopStreams();
mDLInput->DisableVideoInput();