#include <boost/filesystem.hpp>\r
\r
#include <functional>\r
+#include <boost/thread.hpp>\r
\r
namespace caspar { namespace core { namespace flash {\r
\r
\r
safe_ptr<diagnostics::graph> graph_;\r
timer perf_timer_;\r
-\r
+ \r
std::wstring print()\r
{\r
return parent_printer_();\r
\r
if(FAILED(spFlash->put_ScaleMode(2))) //Exact fit. Scale without respect to the aspect ratio.\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + "Failed to Set Scale Mode"));\r
- \r
+ \r
ax_->SetFormat(format_desc_);\r
\r
BITMAPINFO info;\r
{\r
return ax_->GetFPS(); \r
}\r
-\r
+ \r
private:\r
\r
safe_ptr<draw_frame> render_simple_frame(bool underflow)\r
return L"";\r
}\r
\r
+std::wstring g_version = L"Unknown";\r
+void setup_version()\r
+{\r
+ CComObject<caspar::flash::FlashAxContainer>* ax_ = nullptr; \r
+ {\r
+ CComPtr<IShockwaveFlash> spFlash;\r
+ try\r
+ {\r
+ ::CoInitialize(nullptr);\r
+ if(FAILED(CComObject<caspar::flash::FlashAxContainer>::CreateInstance(&ax_)))\r
+ BOOST_THROW_EXCEPTION(caspar_exception());\r
+ \r
+ if(FAILED(ax_->CreateAxControl()))\r
+ BOOST_THROW_EXCEPTION(caspar_exception());\r
+ \r
+ if(FAILED(ax_->QueryControl(&spFlash)))\r
+ BOOST_THROW_EXCEPTION(caspar_exception());\r
+ }\r
+ catch(...){}\r
+ \r
+ if(!spFlash)\r
+ return;\r
+\r
+ long ver;\r
+ if(SUCCEEDED(spFlash->FlashVersion(&ver)))\r
+ {\r
+ auto min = boost::lexical_cast<std::wstring>((ver >> 0) & 0xFF);\r
+ auto may = boost::lexical_cast<std::wstring>((ver >> 16) & 0xFF);\r
+ g_version = may + L"." + min;\r
+ }\r
+ }\r
+\r
+ if(ax_)\r
+ {\r
+ ax_->DestroyAxControl();\r
+ ax_->Release();\r
+ }\r
+ \r
+ ::CoUninitialize();\r
+}\r
+\r
+std::wstring flash_producer::version()\r
+{ \r
+ boost::once_flag flag = BOOST_ONCE_INIT;\r
+ boost::call_once(setup_version, flag);\r
+\r
+ return g_version;\r
+}\r
+\r
}}}
\ No newline at end of file
\r
#include "bootstrapper.h"\r
\r
+#include <core/producer/flash/flash_producer.h>\r
+\r
#include <common/exception/win32_exception.h>\r
#include <common/exception/exceptions.h>\r
#include <common/log/log.h>\r
SetConsoleWindowInfo(hOut, TRUE, &DisplayArea);\r
\r
std::wstringstream str;\r
- str << "CasparCG Server " << env::version();\r
+ str << "CasparCG Server " << env::version() << L" Flash " << flash::flash_producer::version();\r
SetConsoleTitle(str.str().c_str());\r
\r
std::wcout << L"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n" << std::endl;\r