+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
#include "../StdAfx.h"\r
\r
#include "blue_velvet.h"\r
\r
#include <core/video_format.h>\r
\r
-namespace caspar {\r
+namespace caspar { namespace bluefish {\r
\r
CBlueVelvet4* (*BlueVelvetFactory4)() = nullptr;\r
void (*BlueVelvetDestroy)(CBlueVelvet4* pObj) = nullptr;\r
void blue_velvet_initialize()\r
{\r
#ifdef _DEBUG\r
- auto module = LoadLibrary(L"BlueVelvet3_d.dll");\r
+ std::string module_str = "BlueVelvet3_d.dll";\r
#else\r
- auto module = LoadLibrary(L"BlueVelvet3.dll");\r
+ std::string module_str = "BlueVelvet3.dll";\r
#endif\r
+\r
+ auto module = LoadLibrary(widen(module_str).c_str());\r
+ if(!module)\r
+ LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
+ if(!module)\r
+ LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
if(!module)\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueVelvet3.dll. Required drivers are not installed."));\r
static std::shared_ptr<void> lib(module, FreeLibrary);\r
void blue_hanc_initialize()\r
{\r
#ifdef _DEBUG\r
- auto module = LoadLibrary(L"BlueHancUtils_d.dll");\r
+ std::string module_str = "BlueHancUtils_d.dll";\r
#else\r
- auto module = LoadLibrary(L"BlueHancUtils.dll");\r
+ std::string module_str = "BlueHancUtils.dll";\r
#endif\r
+ \r
+ auto module = LoadLibrary(widen(module_str).c_str());\r
+ if(!module)\r
+ LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
+ if(!module)\r
+ LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
if(!module)\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueHancUtils.dll. Required drivers are not installed."));\r
static std::shared_ptr<void> lib(module, FreeLibrary);\r
\r
void blue_initialize()\r
{\r
- blue_velvet_initialize();\r
blue_hanc_initialize();\r
+ blue_velvet_initialize();\r
}\r
\r
EVideoMode vid_fmt_from_video_format(const core::video_format::type& fmt) \r
case core::video_format::x576p2500: return VID_FMT_INVALID; //not supported\r
case core::video_format::x720p2500: return VID_FMT_720P_2500;\r
case core::video_format::x720p5000: return VID_FMT_720P_5000;\r
+ case core::video_format::x720p2997: return VID_FMT_720P_2997;\r
case core::video_format::x720p5994: return VID_FMT_720P_5994;\r
+ case core::video_format::x720p3000: return VID_FMT_720P_3000;\r
case core::video_format::x720p6000: return VID_FMT_720P_6000;\r
- case core::video_format::x1080p2397: return VID_FMT_1080P_2397;\r
+ case core::video_format::x1080p2398: return VID_FMT_1080P_2397;\r
case core::video_format::x1080p2400: return VID_FMT_1080P_2400;\r
case core::video_format::x1080i5000: return VID_FMT_1080I_5000;\r
case core::video_format::x1080i5994: return VID_FMT_1080I_5994;\r
case core::video_format::x1080p2500: return VID_FMT_1080P_2500;\r
case core::video_format::x1080p2997: return VID_FMT_1080P_2997;\r
case core::video_format::x1080p3000: return VID_FMT_1080P_3000;\r
+ case core::video_format::x1080p5000: return VID_FMT_1080P_5000;\r
default: return VID_FMT_INVALID;\r
}\r
}\r
{\r
switch(blue.has_video_cardtype())\r
{\r
- case CRD_BLUE_EPOCH_2K:\r
case CRD_BLUE_EPOCH_HORIZON:\r
- case CRD_BLUE_EPOCH_2K_CORE:\r
- case CRD_BLUE_EPOCH_2K_ULTRA:\r
case CRD_BLUE_EPOCH_CORE:\r
case CRD_BLUE_EPOCH_ULTRA:\r
+ case CRD_BLUE_EPOCH_2K_HORIZON:\r
+ case CRD_BLUE_EPOCH_2K_CORE:\r
+ case CRD_BLUE_EPOCH_2K_ULTRA:\r
+ case CRD_BLUE_CREATE_HD:\r
+ case CRD_BLUE_CREATE_2K:\r
+ case CRD_BLUE_CREATE_2K_ULTRA:\r
+ case CRD_BLUE_SUPER_NOVA:\r
return true;\r
default:\r
return false;\r
vid_fmt = videoMode; \r
}\r
if(vid_fmt == VID_FMT_INVALID)\r
- BOOST_THROW_EXCEPTION(bluefish_exception() << msg_info("Failed get videomode.") << arg_value_info(narrow(format_desc.name)));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("video-mode not supported.") << arg_value_info(narrow(format_desc.name)));\r
\r
return vid_fmt;\r
}\r
return safe_ptr<CBlueVelvet4>(BlueVelvetFactory4(), BlueVelvetDestroy);\r
}\r
\r
-}
\ No newline at end of file
+safe_ptr<CBlueVelvet4> create_blue(size_t device_index)\r
+{\r
+ auto blue = create_blue();\r
+ \r
+ if(BLUE_FAIL(blue->device_attach(device_index, FALSE))) \r
+ BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to attach device."));\r
+\r
+ return blue;\r
+}\r
+\r
+}}
\ No newline at end of file