]> git.sesse.net Git - casparcg/commitdiff
Added template-host version query.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 23 Feb 2012 10:33:01 +0000 (10:33 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 23 Feb 2012 10:33:01 +0000 (10:33 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/trunk@2483 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/flash/flash.cpp
modules/flash/producer/flash_producer.cpp
protocol/amcp/AMCPCommandsImpl.cpp
protocol/protocol.vcxproj
shell/main.cpp

index 8c072b7b8bd455fc29b22ab45226af6b9aaa4b0a..fbbc63b092109f6b5058bb8af22e64bd53874fe3 100644 (file)
 #include "producer/cg_producer.h"\r
 #include "producer/flash_producer.h"\r
 \r
+#include <core/producer/frame/frame_factory.h>\r
+#include <core/mixer/write_frame.h>\r
+\r
 #include <common/env.h>\r
 \r
+#include <boost/regex.hpp>\r
+\r
+#include <string>\r
+#include <vector>\r
+\r
 namespace caspar { namespace flash {\r
 \r
 void init()\r
@@ -38,6 +46,30 @@ void init()
 \r
 std::wstring get_cg_version()\r
 {\r
+       struct dummy_factory : public core::frame_factory\r
+       {\r
+               \r
+               virtual safe_ptr<core::write_frame> create_frame(const void* video_stream_tag, const core::pixel_format_desc& desc) \r
+               {\r
+                       return make_safe<core::write_frame>(nullptr);\r
+               }\r
+       \r
+               virtual core::video_format_desc get_video_format_desc() const\r
+               {\r
+                       return core::video_format_desc::get(L"PAL");\r
+               }\r
+       };\r
+\r
+       std::vector<std::wstring> params;\r
+       auto producer = make_safe<cg_producer>(flash::create_producer(make_safe<dummy_factory>(), params));\r
+\r
+       auto info = producer->template_host_info();\r
+       \r
+       boost::wregex ver_exp(L"version=&quot;(?<VERSION>[^&]*)");\r
+       boost::wsmatch what;\r
+       if(boost::regex_search(info, what, ver_exp))\r
+               return what[L"VERSION"];\r
+\r
        return L"Unknown";\r
 }\r
 \r
index d0a4c1592d62473d2de94da9b881671f987e5093..74ba5ba71f5a2515b4a445012d3caf803e5c1824 100644 (file)
@@ -275,9 +275,12 @@ public:
                        desc.planes.push_back(core::pixel_format_desc::plane(width_, height_, 4));\r
                        auto frame = frame_factory_->create_frame(this, desc);\r
 \r
-                       fast_memcpy(frame->image_data().begin(), bmp_.data(), width_*height_*4);\r
-                       frame->commit();\r
-                       head_ = frame;\r
+                       if(frame->image_data().size() == static_cast<int>(width_*height_*4))\r
+                       {\r
+                               fast_memcpy(frame->image_data().begin(), bmp_.data(), width_*height_*4);\r
+                               frame->commit();\r
+                               head_ = frame;\r
+                       }\r
                }               \r
                                        \r
                MSG msg;\r
index fbf21d48c21f3e63563784298295630adc61dbf3..700533e6fd0c5f4269bae10bd24e8716d92d7583 100644 (file)
@@ -43,6 +43,7 @@
 #include <core/producer/stage.h>\r
 #include <core/producer/layer.h>\r
 #include <core/mixer/mixer.h>\r
+#include <core/mixer/gpu/ogl_device.h>\r
 #include <core/consumer/output.h>\r
 \r
 #include <modules/bluefish/bluefish.h>\r
@@ -1398,24 +1399,25 @@ bool InfoCommand::DoExecute()
                        info.add(L"system.cpu",                                         caspar::get_cpu_info());\r
        \r
                        BOOST_FOREACH(auto device, caspar::decklink::get_device_list())\r
-                               info.add(L"system.decklink.device", device);\r
+                               info.add(L"system.caspar.decklink.device", device);\r
 \r
                        BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
-                               info.add(L"system.bluefish.device", device);\r
+                               info.add(L"system.caspar.bluefish.device", device);\r
                                \r
-                       info.add(L"system.flash",                                       caspar::flash::get_version());\r
-                       info.add(L"system.free-image",                          caspar::image::get_version());\r
-                       info.add(L"system.ffmpeg.avcodec",                      caspar::ffmpeg::get_avcodec_version());\r
-                       info.add(L"system.ffmpeg.avformat",                     caspar::ffmpeg::get_avformat_version());\r
-                       info.add(L"system.ffmpeg.avfilter",                     caspar::ffmpeg::get_avfilter_version());\r
-                       info.add(L"system.ffmpeg.avutil",                       caspar::ffmpeg::get_avutil_version());\r
-                       info.add(L"system.ffmpeg.swscale",                      caspar::ffmpeg::get_swscale_version());\r
-                                               \r
+                       info.add(L"system.caspar.flash",                                        caspar::flash::get_version());\r
+                       info.add(L"system.caspar.template-host",                        caspar::flash::get_cg_version());\r
+                       info.add(L"system.caspar.free-image",                           caspar::image::get_version());\r
+                       info.add(L"system.caspar.ffmpeg.avcodec",                       caspar::ffmpeg::get_avcodec_version());\r
+                       info.add(L"system.caspar.ffmpeg.avformat",                      caspar::ffmpeg::get_avformat_version());\r
+                       info.add(L"system.caspar.ffmpeg.avfilter",                      caspar::ffmpeg::get_avfilter_version());\r
+                       info.add(L"system.caspar.ffmpeg.avutil",                        caspar::ffmpeg::get_avutil_version());\r
+                       info.add(L"system.caspar.ffmpeg.swscale",                       caspar::ffmpeg::get_swscale_version());\r
+                                                                       \r
                        boost::property_tree::write_xml(replyString, info, w);\r
                }\r
                else if(_parameters.size() >= 1 && _parameters[0] == L"SERVER")\r
                {\r
-                       replyString << L"201 INFO SYSTEM OK\r\n";\r
+                       replyString << L"201 INFO SERVER OK\r\n";\r
                        \r
                        boost::property_tree::wptree info;\r
 \r
index 4977c49a11f9a0a1f13e74807a7d47c5b267b639..92d2fc2e3879ee4a1dfb6cb64e5bb7eb3999ce7e 100644 (file)
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
   </ImportGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;$(IncludePath)</IncludePath>\r
+    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;..\dependencies\glew-1.6.0\include;..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
     <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
     <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;$(IncludePath)</IncludePath>\r
+    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;..\dependencies\glew-1.6.0\include;..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
     <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
     <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">\r
-    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;$(IncludePath)</IncludePath>\r
+    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;..\dependencies\glew-1.6.0\include;..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
     <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
     <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">\r
-    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;$(IncludePath)</IncludePath>\r
+    <IncludePath>../;..\dependencies/tbb/include;..\dependencies\boost;..\dependencies\glew-1.6.0\include;..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
     <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
     <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
   </PropertyGroup>\r
index 10eaa7acd5c3271b4eb58d4bd67650d38f428f49..b381dedfd1d44314de285ab1447e08a96d133efd 100644 (file)
@@ -134,13 +134,14 @@ void print_info()
        BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
                CASPAR_LOG(info) << L" - " << device;   \r
        \r
-       CASPAR_LOG(info) << L"Flash "                   << caspar::flash::get_version();\r
        CASPAR_LOG(info) << L"FreeImage "               << caspar::image::get_version();\r
        CASPAR_LOG(info) << L"FFMPEG-avcodec "  << caspar::ffmpeg::get_avcodec_version();\r
        CASPAR_LOG(info) << L"FFMPEG-avformat " << caspar::ffmpeg::get_avformat_version();\r
        CASPAR_LOG(info) << L"FFMPEG-avfilter " << caspar::ffmpeg::get_avfilter_version();\r
        CASPAR_LOG(info) << L"FFMPEG-avutil "   << caspar::ffmpeg::get_avutil_version();\r
        CASPAR_LOG(info) << L"FFMPEG-swscale "  << caspar::ffmpeg::get_swscale_version();\r
+       CASPAR_LOG(info) << L"Flash "                   << caspar::flash::get_version();\r
+       CASPAR_LOG(info) << L"Template-Host "   << caspar::flash::get_cg_version();\r
 }\r
 \r
 LONG WINAPI UserUnhandledExceptionFilter(EXCEPTION_POINTERS* info)\r