2015-02-28 17:17:32 -08:00
|
|
|
#include "../platform.hpp"
|
|
|
|
|
|
|
|
|
|
#include <util/platform.h>
|
|
|
|
|
|
|
|
|
|
IDeckLinkDiscovery *CreateDeckLinkDiscoveryInstance(void)
|
|
|
|
|
{
|
|
|
|
|
IDeckLinkDiscovery *instance;
|
|
|
|
|
const HRESULT result = CoCreateInstance(CLSID_CDeckLinkDiscovery, nullptr, CLSCTX_ALL, IID_IDeckLinkDiscovery,
|
|
|
|
|
(void **)&instance);
|
|
|
|
|
return result == S_OK ? instance : nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-09 16:22:05 -06:00
|
|
|
IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
|
|
|
|
|
{
|
|
|
|
|
IDeckLinkIterator *iterator;
|
2020-02-09 16:51:05 -08:00
|
|
|
const HRESULT result = CoCreateInstance(CLSID_CDeckLinkIterator, nullptr, CLSCTX_ALL, IID_IDeckLinkIterator,
|
|
|
|
|
(void **)&iterator);
|
2020-02-09 16:22:05 -06:00
|
|
|
return result == S_OK ? iterator : nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-26 17:58:20 -05:00
|
|
|
IDeckLinkVideoConversion *CreateVideoConversionInstance(void)
|
|
|
|
|
{
|
|
|
|
|
IDeckLinkVideoConversion *conversion;
|
|
|
|
|
const HRESULT result = CoCreateInstance(CLSID_CDeckLinkVideoConversion, nullptr, CLSCTX_ALL,
|
|
|
|
|
IID_IDeckLinkVideoConversion, (void **)&conversion);
|
|
|
|
|
return result == S_OK ? conversion : nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-28 17:17:32 -08:00
|
|
|
bool DeckLinkStringToStdString(decklink_string_t input, std::string &output)
|
|
|
|
|
{
|
|
|
|
|
if (input == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
size_t len = wcslen(input);
|
|
|
|
|
size_t utf8_len = os_wcs_to_utf8(input, len, nullptr, 0);
|
|
|
|
|
|
|
|
|
|
output.resize(utf8_len);
|
|
|
|
|
os_wcs_to_utf8(input, len, &output[0], utf8_len);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|