#if defined(_WIN32)
#define GET_PROCADDR_FOR_FUNC(name, module) { name = (pFunc_##name)GetProcAddress(reinterpret_cast<HMODULE>(module), #name); if(!name) { return false; } }
-// #define GET_PROCADDR_FOR_FUNC(name, module) { name = (pFunc_##name)GetProcAddress(module, #name); if(!name) { return false; } }
#elif defined(__APPLE__)
#define GET_PROCADDR_FOR_FUNC(name, module) { name = (pFunc_##name)dlsym(module, #name); if(!name) { return false; } }
#endif
bvc_wrapper::bvc_wrapper()
{
- bvc_ = nullptr;
- h_module_ = nullptr;
- init_function_pointers();
+ if(!init_function_pointers())
+ CASPAR_THROW_EXCEPTION(not_supported() << msg_info("Bluefish drivers not found. Unable to init Funcion Pointers"));
+
bvc_ = std::shared_ptr<void>(bfcFactory(), bfcDestroy);
if (!bvc_)
bool bvc_wrapper::init_function_pointers()
{
bool res = false;
- bfcGetVersion = nullptr;
- bfcFactory = nullptr;
- bfcDestroy = nullptr;
- bfcEnumerate = nullptr;
- bfcQueryCardType = nullptr;
- bfcAttach = nullptr;
- bfcDetach = nullptr;
- bfcQueryCardProperty32 = nullptr;
- bfcQueryCardProperty64 = nullptr;
- bfcSetCardProperty32 = nullptr;
- bfcSetCardProperty64 = nullptr;
- bfcGetCardSerialNumber = nullptr;
- bfcGetCardFwVersion = nullptr;
- bfcWaitVideoSyncAsync = nullptr;
- bfcWaitVideoInputSync = nullptr;
- bfcWaitVideoOutputSync = nullptr;
- bfcGetVideoOutputCurrentFieldCount = nullptr;
- bfcGetVideoInputCurrentFieldCount = nullptr;
- bfcVideoCaptureStart = nullptr;
- bfcVideoCaptureStop = nullptr;
- bfcVideoPlaybackStart = nullptr;
- bfcVideoPlaybackStop = nullptr;
- bfcVideoPlaybackAllocate = nullptr;
- bfcVideoPlaybackPresent = nullptr;
- bfcVideoPlaybackRelease = nullptr;
- bfcGetCaptureVideoFrameInfoEx = nullptr;
- bfcRenderBufferCapture = nullptr;
- bfcRenderBufferUpdate = nullptr;
- bfcGetRenderBufferCount = nullptr;
- bfcEncodeHancFrameEx = nullptr;
- bfcDecodeHancFrameEx = nullptr;
-#if defined(_WIN32)
- bfcSystemBufferReadAsync = nullptr;
- bfcSystemBufferWriteAsync = nullptr;
-#else
- bfcSystemBufferRead = nullptr;
- bfcSystemBufferWrite = nullptr;
-#endif
- bfcGetBytesForGroupPixels = nullptr;
- bfcGetPixelsPerLine = nullptr;
- bfcGetLinesPerFrame = nullptr;
- bfcGetBytesPerLine = nullptr;
- bfcGetBytesPerFrame = nullptr;
- bfcGetGoldenValue = nullptr;
- bfcGetVBILines = nullptr;
- bfcGetVANCGoldenValue = nullptr;
- bfcGetVANCLineBytes = nullptr;
- bfcGetVANCLineCount = nullptr;
- bfcGetWindowsDriverHandle = nullptr;
- bfcUtilsGetStringForCardType = nullptr;
- bfcUtilsGetStringForBlueProductId = nullptr;
- bfcUtilsGetStringForVideoMode = nullptr;
- bfcUtilsGetStringForMemoryFormat = nullptr;
- bfcUtilsGetMR2Routing = nullptr;
- bfcUtilsSetMR2Routing = nullptr;
- bfcUtilsGetAudioOutputRouting = nullptr;
- bfcUtilsSetAudioOutputRouting = nullptr;
- bfcUtilsIsVideoModeProgressive = nullptr;
- bfcUtilsIsVideoMode1001Framerate = nullptr;
- bfcUtilsGetFpsForVideoMode = nullptr;
- bfcUtilsGetVideoModeForFrameInfo = nullptr;
- bfcUtilsGetFrameInfoForVideoMode = nullptr;
- bfcUtilsGetAudioSamplesPerFrame = nullptr;
-
#if defined(_WIN32)
#ifdef _DEBUG
h_module_ = std::shared_ptr<void>(LoadLibraryExA("BlueVelvetC64_d.dll", NULL, 0), FreeLibrary);
BLUE_UINT32 bvc_wrapper::get_card_property32(const int iProperty, unsigned int & nValue)
{
- if (bvc_)
- return (BLUE_UINT32)bfcQueryCardProperty32((BLUEVELVETC_HANDLE)bvc_.get(), iProperty, nValue);
- else
- return 0;
+ return (BLUE_UINT32)bfcQueryCardProperty32((BLUEVELVETC_HANDLE)bvc_.get(), iProperty, nValue);
}
BLUE_UINT32 bvc_wrapper::set_card_property32(const int iProperty, const unsigned int nValue)