]> git.sesse.net Git - casparcg/commitdiff
* Replaced boost::timer with caspar::timer because of too low resolution on Linux...
authorHelge Norberg <helge.norberg@svt.se>
Mon, 20 Apr 2015 10:34:53 +0000 (12:34 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Mon, 20 Apr 2015 10:34:53 +0000 (12:34 +0200)
* Decoupled copying of runtime dependencies (dll:s and so:s) from shell to the module most directly dependant on the file.

27 files changed:
CMakeLists.txt
accelerator/StdAfx.h
accelerator/ogl/util/buffer.cpp
accelerator/ogl/util/device.cpp
common/CMakeLists.txt
common/timer.h [new file with mode: 0644]
core/StdAfx.h
core/consumer/output.cpp
core/diagnostics/osd_graph.cpp
core/diagnostics/subject_diagnostics.cpp
core/mixer/mixer.cpp
core/producer/stage.cpp
core/video_channel.cpp
dependencies64/ffmpeg/bin/linux/libavdevice.so.55 [new symlink]
dependencies64/ffmpeg/bin/linux/libpostproc.so.52 [new symlink]
modules/decklink/StdAfx.h
modules/decklink/consumer/decklink_consumer.cpp
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/CMakeLists.txt
modules/ffmpeg/StdAfx.h
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/image/CMakeLists.txt
modules/oal/CMakeLists.txt
modules/screen/consumer/screen_consumer.cpp
protocol/amcp/AMCPCommandQueue.cpp
shell/CMakeLists.txt

index 4e01de7259cac95bbb25b95bfae9ebe0be1ca074..7a8e5e4b84c258a496c04b990d2e3f74aa82710c 100644 (file)
@@ -91,6 +91,7 @@ set(CASPARCG_MODULE_INCLUDE_STATEMENTS        "" CACHE INTERNAL "")
 set(CASPARCG_MODULE_INIT_STATEMENTS            "" CACHE INTERNAL "")
 set(CASPARCG_MODULE_UNINIT_STATEMENTS  "" CACHE INTERNAL "")
 set(CASPARCG_MODULE_PROJECTS                   "" CACHE INTERNAL "")
+set(CASPARCG_RUNTIME_DEPENDENCIES              "" CACHE INTERNAL "")
 
 function(casparcg_add_include_statement HEADER_FILE_TO_INCLUDE)
        set(CASPARCG_MODULE_INCLUDE_STATEMENTS "${CASPARCG_MODULE_INCLUDE_STATEMENTS}"
@@ -123,6 +124,10 @@ function(join_list VALUES GLUE OUTPUT)
        set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
 endfunction()
 
+function(casparcg_add_runtime_dependency FILE_TO_COPY)
+       set(CASPARCG_RUNTIME_DEPENDENCIES "${CASPARCG_RUNTIME_DEPENDENCIES}" "${FILE_TO_COPY}" CACHE INTERNAL "")
+endfunction()
+
 add_subdirectory(accelerator)
 add_subdirectory(common)
 add_subdirectory(core)
index e44e81e2602a5942c30231214bb0cf235a966ac7..5ada8be5ebadfcb040173b2fc9f726d6d3cd071f 100644 (file)
@@ -45,7 +45,6 @@
 #include <tbb/concurrent_unordered_map.h>
 
 #include <boost/circular_buffer.hpp>
-#include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/range.hpp>
 #include <boost/range/adaptors.hpp>
@@ -61,3 +60,4 @@
 
 #include <common/log.h>
 #include <common/except.h>
+#include <common/timer.h>
index 6b20ad034fe062736377314de3fd1ac98a87fe5d..063d5bd1e951e160459a32065dd95d479d443df0 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <common/except.h>
 #include <common/gl/gl_check.h>
+#include <common/timer.h>
 
 #include <GL/glew.h>
 
@@ -52,7 +53,7 @@ public:
                , target_(usage == buffer::usage::write_only ? GL_PIXEL_UNPACK_BUFFER : GL_PIXEL_PACK_BUFFER)
                , usage_(usage == buffer::usage::write_only ? GL_STREAM_DRAW : GL_STREAM_READ)
        {
-               boost::timer timer;
+               caspar::timer timer;
 
                data_ = nullptr;
                GL(glGenBuffers(1, &pbo_));
@@ -84,7 +85,7 @@ public:
                if(data_ != nullptr)
                        return data_;
                
-               boost::timer timer;
+               caspar::timer timer;
 
                GL(glBindBuffer(target_, pbo_));
                if(usage_ == GL_STREAM_DRAW)                    
index 6e09628935be35e3410dd6b102bf7bc5bb8c6549..bd14a902d2ae71c854df493db740a3cd229f7e79 100644 (file)
@@ -35,7 +35,7 @@
 #include <common/array.h>
 #include <common/memory.h>
 #include <common/gl/gl_check.h>
-//#include <common/os/windows/windows.h>
+#include <common/timer.h>
 
 #include <GL/glew.h>
 
@@ -160,7 +160,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                std::shared_ptr<buffer> buf;
                if(!pool->try_pop(buf)) 
                {
-                       boost::timer timer;
+                       caspar::timer timer;
 
                        buf = executor_.invoke([&]
                        {
index 5564e79708d2ba6e4c605d4914fd00c1fd35456c..cd3c646a1c136e96398cbcedff74c9175f7111fd 100644 (file)
@@ -79,6 +79,7 @@ set(HEADERS
                reactive.h
                semaphore.h
                stdafx.h
+               timer.h
                tweener.h
                utf.h
 )
@@ -147,3 +148,17 @@ else ()
                pthread
        )
 endif ()
+
+if(MSVC)
+       casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/glew32.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb_debug.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_debug.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
+else()
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbb.so.2")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc_proxy.so.2")
+       casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc.so.2")
+endif()
diff --git a/common/timer.h b/common/timer.h
new file mode 100644 (file)
index 0000000..ce4b3f3
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Helge Norberg, helge.norberg@svt.se
+*/
+
+#pragma once
+
+#include <boost/chrono/system_clocks.hpp>
+
+namespace caspar {
+
+// Replacement of boost::timer because it uses std::clock which has very low resolution in linux.
+class timer
+{
+       boost::int_least64_t _start_time;
+public:
+       timer()
+       {
+               _start_time = now();
+       }
+
+       void restart()
+       {
+               _start_time = now();
+       }
+
+       double elapsed() const
+       {
+               return static_cast<double>(now() - _start_time) / 1000.0;
+       }
+private:
+       static boost::int_least64_t now()
+       {
+               using namespace boost::chrono;
+
+               return duration_cast<milliseconds>(high_resolution_clock::now().time_since_epoch()).count();
+       }
+};
+
+}
index 6bbcf67b6890887f5984109d29e212148f451cdf..2173fffd7e3dfc8c81faada327054c08ad099991 100644 (file)
@@ -46,7 +46,6 @@
 #include <tbb/concurrent_unordered_map.h>
 
 #include <boost/circular_buffer.hpp>
-#include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/range.hpp>
 #include <boost/range/adaptors.hpp>
@@ -63,3 +62,4 @@
 
 #include <common/log.h>
 #include <common/except.h>
+#include <common/timer.h>
index 048b6274c2d86e6390362fa1a389bc27661b6b45..dac35395dc880ae90e3aa01ac1fcb50a40368caf 100644 (file)
 #include <common/memshfl.h>
 #include <common/env.h>
 #include <common/linq.h>
+#include <common/timer.h>
 
 #include <boost/circular_buffer.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/property_tree/ptree.hpp>
-#include <boost/timer.hpp>
 
 #include <functional>
 
@@ -152,7 +152,7 @@ public:
                
        void operator()(const_frame input_frame, const core::video_format_desc& format_desc)
        {
-               boost::timer frame_timer;
+               caspar::timer frame_timer;
 
                set_video_format_desc(format_desc);
 
index 7847f76bfeb529ac1452b0df61a159ee19ac3c9f..bd036ea2aa5747c4a72cf0fb3be80779114a0d99 100644 (file)
@@ -32,6 +32,7 @@
 #include <common/env.h>
 #include <common/prec_timer.h>
 #include <common/os/scheduling.h>
+#include <common/timer.h>
 
 #include <SFML/Graphics.hpp>
 
@@ -98,7 +99,7 @@ class context : public drawable
        
        std::list<std::weak_ptr<drawable>>      drawables_;
        int64_t                                                         refresh_rate_millis_            = 16;
-       boost::timer                                            display_time_;
+       caspar::timer                                           display_time_;
        bool                                                            calculate_view_                         = true;
        int                                                                     scroll_position_                        = 0;
        bool                                                            dragging_                                       = false;
index e5981380c576170ea3bbe8905e854dd8a0f07dd9..c9b8acbf9e780772c62fa1b088e34f8106db59aa 100644 (file)
@@ -26,9 +26,9 @@
 #include "call_context.h"
 
 #include <common/diagnostics/graph.h>
+#include <common/timer.h>
 
 #include <boost/lexical_cast.hpp>
-#include <boost/timer.hpp>
 
 #include <atomic>
 #include <mutex>
@@ -56,7 +56,7 @@ class subject_graph : public caspar::diagnostics::spi::graph_sink
        std::mutex                                                              mutex_;
        std::wstring                                                    text_;
        std::unordered_map<std::string, int>    colors_;
-       boost::timer                                                    time_since_full_state_send_;
+       caspar::timer                                                   time_since_full_state_send_;
 public:
        subject_graph()
        {
index 49c1f4ad0f2e5368f5add930a32f666c061f71c5..4f269b144b528eb54cb3b03fbc69e16025e11b5d 100644 (file)
@@ -33,6 +33,7 @@
 #include <common/diagnostics/graph.h>
 #include <common/except.h>
 #include <common/future.h>
+#include <common/timer.h>
 
 #include <core/frame/draw_frame.h>
 #include <core/frame/frame_factory.h>
@@ -40,7 +41,6 @@
 #include <core/frame/pixel_format.h>
 #include <core/video_format.h>
 
-#include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 
 #include <tbb/concurrent_queue.h>
@@ -71,7 +71,7 @@ public:
        
        const_frame operator()(std::map<int, draw_frame> frames, const video_format_desc& format_desc)
        {               
-               boost::timer frame_timer;
+               caspar::timer frame_timer;
 
                auto frame = executor_.invoke([=]() mutable -> const_frame
                {               
index 29790d0e73d40e5f50218331ef8786999e900aeb..ae015afd8003990425675caf061c546d011b6ed5 100644 (file)
 #include <common/executor.h>
 #include <common/future.h>
 #include <common/diagnostics/graph.h>
+#include <common/timer.h>
 
 #include <core/frame/frame_transform.h>
 
-#include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 
 #include <tbb/parallel_for_each.h>
@@ -68,7 +68,7 @@ public:
                
        std::map<int, draw_frame> operator()(const struct video_format_desc& format_desc)
        {               
-               boost::timer frame_timer;
+               caspar::timer frame_timer;
 
                auto frames = executor_.invoke([=]() -> std::map<int, draw_frame>
                {
index d99bb75b16a9efb0c4e17ece6b3cb454eee4655b..17b1e4df1435348a9390a57cb9b08b953cad7d0e 100644 (file)
@@ -36,6 +36,7 @@
 #include <common/env.h>
 #include <common/lock.h>
 #include <common/executor.h>
+#include <common/timer.h>
 
 #include <core/mixer/image/image_mixer.h>
 #include <core/diagnostics/call_context.h>
@@ -117,7 +118,7 @@ public:
 
                        auto format_desc = video_format_desc();
                        
-                       boost::timer frame_timer;
+                       caspar::timer frame_timer;
 
                        // Produce
                        
diff --git a/dependencies64/ffmpeg/bin/linux/libavdevice.so.55 b/dependencies64/ffmpeg/bin/linux/libavdevice.so.55
new file mode 120000 (symlink)
index 0000000..ab54161
--- /dev/null
@@ -0,0 +1 @@
+libavdevice.so
\ No newline at end of file
diff --git a/dependencies64/ffmpeg/bin/linux/libpostproc.so.52 b/dependencies64/ffmpeg/bin/linux/libpostproc.so.52
new file mode 120000 (symlink)
index 0000000..b97b3f6
--- /dev/null
@@ -0,0 +1 @@
+libpostproc.so
\ No newline at end of file
index 190b39f84972d8c9de44e563838147e2d2770fe7..f84755efc1fe8a6a8fea200b55b9b1c0d3ff6231 100644 (file)
@@ -47,7 +47,6 @@
 #include <tbb/concurrent_queue.h>
 #include <tbb/cache_aligned_allocator.h>
 #include <boost/circular_buffer.hpp>
-#include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/range.hpp>
 #include <boost/range/algorithm.hpp>
@@ -87,6 +86,7 @@ extern "C"
 #include "../common/utf.h"
 #include "../common/except.h"
 #include "../common/log.h"
+#include "../common/timer.h"
 #endif
 
 #if defined(_MSC_VER)
index 69c96d918441c264d3a40aab95f49f510f0c9334..216db31c5c77b133e3adb095e8ae6ef6f5f28ff6 100644 (file)
@@ -38,6 +38,7 @@
 #include <common/array.h>
 #include <common/future.h>
 #include <common/cache_aligned_vector.h>
+#include <common/timer.h>
 
 #include <core/consumer/frame_consumer.h>
 #include <core/diagnostics/call_context.h>
@@ -47,7 +48,6 @@
 #include <common/assert.h>
 #include <boost/lexical_cast.hpp>
 #include <boost/circular_buffer.hpp>
-#include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 
 namespace caspar { namespace decklink { 
@@ -197,7 +197,7 @@ struct decklink_consumer : public IDeckLinkVideoOutputCallback, public IDeckLink
        tbb::concurrent_bounded_queue<core::const_frame>    audio_frame_buffer_;
        
        spl::shared_ptr<diagnostics::graph>                 graph_;
-       boost::timer                                        tick_timer_;
+       caspar::timer                                                                           tick_timer_;
        retry_task<bool>                                    send_completion_;
 
 public:
index 7d3cd84390cfb6ebfe3f1331e440afbd78c2fa3c..6feeca7fa682b214650e40cf4129f617b684897a 100644 (file)
@@ -35,6 +35,7 @@
 #include <common/except.h>
 #include <common/log.h>
 #include <common/param.h>
+#include <common/timer.h>
 
 #include <core/frame/frame.h>
 #include <core/frame/draw_frame.h>
@@ -47,7 +48,6 @@
 
 #include <boost/algorithm/string.hpp>
 #include <boost/property_tree/ptree.hpp>
-#include <boost/timer.hpp>
 
 #if defined(_MSC_VER)
 #pragma warning (push)
@@ -74,7 +74,7 @@ class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback
        const int                                                                               device_index_;
        core::monitor::subject                                                  monitor_subject_;
        spl::shared_ptr<diagnostics::graph>                             graph_;
-       boost::timer                                                                    tick_timer_;
+       caspar::timer                                                                   tick_timer_;
 
        com_ptr<IDeckLink>                                                              decklink_                       = get_device(device_index_);
        com_iface_ptr<IDeckLinkInput>                                   input_                          = iface_cast<IDeckLinkInput>(decklink_);
@@ -178,7 +178,7 @@ public:
                        graph_->set_value("tick-time", tick_timer_.elapsed()*out_format_desc_.fps*0.5);
                        tick_timer_.restart();
 
-                       boost::timer frame_timer;       
+                       caspar::timer frame_timer;
                        
                        // Video
 
index cb92e3e7c59e1329c71b4d5efdbcbccdb3e31f7c..9e338085d8faa7e6835a13b8df157068ac86113c 100644 (file)
@@ -121,3 +121,24 @@ casparcg_add_include_statement("modules/ffmpeg/ffmpeg.h")
 casparcg_add_init_statement("ffmpeg::init" "ffmpeg")
 casparcg_add_uninit_statement("ffmpeg::uninit")
 casparcg_add_module_project("ffmpeg")
+
+if(MSVC)
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avcodec-55.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avdevice-55.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avfilter-4.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avformat-55.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avutil-52.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-52.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-0.dll")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-2.dll")
+else()
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavcodec.so.55")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavdevice.so.55")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavfilter.so.4")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavformat.so.55")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavutil.so.52")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpostproc.so.52")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libswresample.so.0")
+       casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libswscale.so.2")
+endif()
+
index 88ae4e8ad56a14aeefb91bcf54538dcf5a38791a..f7fb536ae90c8c5d638caed16f56e390d6410b20 100644 (file)
@@ -50,7 +50,6 @@
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/once.hpp>
 #include <boost/thread/thread.hpp>
-#include <boost/timer.hpp>
 #include <cstdint>
 #include <cstdio>
 #include <deque>
@@ -73,6 +72,7 @@
 #include <tbb/tbb_thread.h>
 #include <unordered_map>
 #include <vector>
+#include <common/timer.h>
 
 #pragma warning(push, 1)
 
index e5e9898518652b40080d82a65c266e711d8768f7..a345219d8fa5b9019be43f69dfd54e3180977d39 100644 (file)
@@ -44,9 +44,9 @@
 #include <common/utf.h>
 #include <common/assert.h>
 #include <common/memshfl.h>
+#include <common/timer.h>
 
 #include <boost/algorithm/string.hpp>
-#include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/range/algorithm.hpp>
@@ -732,7 +732,7 @@ private:
                        if(frame_number_ % 25 == 0)
                                check_space();
 
-                       boost::timer frame_timer;
+                       caspar::timer frame_timer;
 
                        encode_video_frame(frame);
                        encode_audio_frame(frame);
index faa9bf847f5c686413cc19e2ed391e6c753aaa03..fa93d32fdcc938f3577ee31a50735816a2c3dec1 100644 (file)
@@ -36,6 +36,7 @@
 #include <common/param.h>
 #include <common/diagnostics/graph.h>
 #include <common/future.h>
+#include <common/timer.h>
 
 #include <core/video_format.h>
 #include <core/producer/frame_producer.h>
@@ -46,7 +47,6 @@
 
 #include <boost/algorithm/string.hpp>
 #include <common/assert.h>
-#include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/regex.hpp>
@@ -178,7 +178,7 @@ public:
        {                               
                auto frame = core::draw_frame::late();          
                
-               boost::timer frame_timer;
+               caspar::timer frame_timer;
                
                end_seek();
                                
index 12308ad01f9a9f3693eb7d8f4ef605df5bac514d..347a2ab0ec1a387af8f324d3dc59017cd24f8989 100644 (file)
@@ -42,7 +42,8 @@ source_group(sources\\util util/*)
 source_group(sources ./*)
 
 target_link_libraries(image common core)
-if (MSVC)
+
+if(MSVC)
        target_link_libraries(image
                common
                core
@@ -50,16 +51,23 @@ if (MSVC)
                optimized FreeImage.lib
                debug FreeImaged.lib
        )
-else ()
+else()
        target_link_libraries(image
                common
                core
 
                freeimage
        )
-endif ()
+endif()
 
 casparcg_add_include_statement("modules/image/image.h")
 casparcg_add_init_statement("image::init" "image")
 casparcg_add_uninit_statement("image::uninit")
 casparcg_add_module_project("image")
+
+if(MSVC)
+       casparcg_add_runtime_dependency("${FREEIMAGE_BIN_PATH}/FreeImage.dll")
+       casparcg_add_runtime_dependency("${FREEIMAGE_BIN_PATH}/FreeImaged.dll")
+else()
+       casparcg_add_runtime_dependency("${FREEIMAGE_BIN_PATH}/libfreeimage.so.3")
+endif()
index f534a25d8c64a710d65c981ba326c492d9240d40..7654011403216a46c5794747f7fdee6484f9e681 100644 (file)
@@ -30,3 +30,9 @@ target_link_libraries(oal common core)
 casparcg_add_include_statement("modules/oal/oal.h")
 casparcg_add_init_statement("oal::init" "oal")
 casparcg_add_module_project("oal")
+
+if(MSVC)
+       casparcg_add_runtime_dependency("${OPENAL_BIN_PATH}/OpenAL32.dll")
+       casparcg_add_runtime_dependency("${OPENAL_BIN_PATH}/wrap_oal.dll")
+endif()
+
index a08a5e311c8ae613056c332bdfe77a8ca923ec8d..e2e7d81c8bf84e0de60faf9c8920c17868543bde 100644 (file)
@@ -33,6 +33,7 @@
 #include <common/utf.h>
 #include <common/prec_timer.h>
 #include <common/future.h>
+#include <common/timer.h>
 
 //#include <windows.h>
 
@@ -43,7 +44,6 @@
 #include <core/consumer/frame_consumer.h>
 #include <core/interaction/interaction_sink.h>
 
-#include <boost/timer.hpp>
 #include <boost/circular_buffer.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/property_tree/ptree.hpp>
@@ -124,8 +124,8 @@ struct screen_consumer : boost::noncopyable
        sf::Window                                                                                      window_;
 
        spl::shared_ptr<diagnostics::graph>                                     graph_;
-       boost::timer                                                                            perf_timer_;
-       boost::timer                                                                            tick_timer_;
+       caspar::timer                                                                           perf_timer_;
+       caspar::timer                                                                           tick_timer_;
 
        caspar::prec_timer                                                                      wait_timer_;
 
index 053c9d6adfea1ded15812b7175f65aa9f895d1bc..ac496d1aa2db298533d42a8fa54e12e4446273ae 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "AMCPCommandQueue.h"
 
-#include <boost/timer.hpp>
+#include <common/timer.h>
 
 namespace caspar { namespace protocol { namespace amcp {
        
@@ -62,7 +62,7 @@ void AMCPCommandQueue::AddCommand(AMCPCommand::ptr_type pCurrentCommand)
                {
                        try
                        {
-                               boost::timer timer;
+                               caspar::timer timer;
                                if(pCurrentCommand->Execute()) 
                                        CASPAR_LOG(debug) << "Executed command: " << pCurrentCommand->print() << " " << timer.elapsed();
                                else 
index 44dcab68665cddf774edf1ee227ad11e8101fb10..26fc233cf37585bfa87db6a955b2201e940c97d3 100644 (file)
@@ -18,12 +18,12 @@ elseif (CMAKE_COMPILER_IS_GNUCXX)
        )
 endif ()
 set(SOURCES
+               casparcg.config
                main.cpp
                server.cpp
                stdafx.cpp
 )
 set(HEADERS
-               casparcg.config
                included_modules.h
                platform_specific.h
                server.h
@@ -57,32 +57,12 @@ target_link_libraries(casparcg
                reroute
 )
 
-set(OUTPUT_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
-
-add_custom_command(TARGET casparcg POST_BUILD
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/avcodec-55.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/avdevice-55.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/avfilter-4.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/avformat-55.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/avutil-52.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/postproc-52.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/swresample-0.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FFMPEG_BIN_PATH}/swscale-2.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FREEIMAGE_BIN_PATH}/FreeImage.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${FREEIMAGE_BIN_PATH}/FreeImaged.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${GLEW_BIN_PATH}/glew32.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${OPENAL_BIN_PATH}/OpenAL32.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${OPENAL_BIN_PATH}/wrap_oal.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbb.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbb_debug.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbbmalloc.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbbmalloc_debug.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbbmalloc_proxy.dll\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll\" \"${OUTPUT_FOLDER}/\"
+casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationSans-Regular.ttf")
+casparcg_add_runtime_dependency("${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config")
 
-               COMMAND ${CMAKE_COMMAND} -E copy \"${LIBERATION_FONTS_BIN_PATH}/LiberationSans-Regular.ttf\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${LIBERATION_FONTS_BIN_PATH}/LiberationSans-Regular.ttf\" \"${CMAKE_CURRENT_BINARY_DIR}/\"
+set(OUTPUT_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
 
-               COMMAND ${CMAKE_COMMAND} -E copy \"${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config\" \"${OUTPUT_FOLDER}/\"
-               COMMAND ${CMAKE_COMMAND} -E copy \"${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config\" \"${CMAKE_CURRENT_BINARY_DIR}/\"
-)
+foreach(FILE_TO_COPY ${CASPARCG_RUNTIME_DEPENDENCIES})
+       add_custom_command(TARGET casparcg POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/\")
+       add_custom_command(TARGET casparcg POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/\")
+endforeach(FILE_TO_COPY)