* Decoupled copying of runtime dependencies (dll:s and so:s) from shell to the module most directly dependant on the file.
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}"
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)
#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>
#include <common/log.h>
#include <common/except.h>
+#include <common/timer.h>
#include <common/except.h>
#include <common/gl/gl_check.h>
+#include <common/timer.h>
#include <GL/glew.h>
, 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_));
if(data_ != nullptr)
return data_;
- boost::timer timer;
+ caspar::timer timer;
GL(glBindBuffer(target_, pbo_));
if(usage_ == GL_STREAM_DRAW)
#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>
std::shared_ptr<buffer> buf;
if(!pool->try_pop(buf))
{
- boost::timer timer;
+ caspar::timer timer;
buf = executor_.invoke([&]
{
reactive.h
semaphore.h
stdafx.h
+ timer.h
tweener.h
utf.h
)
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()
--- /dev/null
+/*
+* 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();
+ }
+};
+
+}
#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>
#include <common/log.h>
#include <common/except.h>
+#include <common/timer.h>
#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>
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);
#include <common/env.h>
#include <common/prec_timer.h>
#include <common/os/scheduling.h>
+#include <common/timer.h>
#include <SFML/Graphics.hpp>
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;
#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>
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()
{
#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>
#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>
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
{
#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>
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>
{
#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>
auto format_desc = video_format_desc();
- boost::timer frame_timer;
+ caspar::timer frame_timer;
// Produce
--- /dev/null
+libavdevice.so
\ No newline at end of file
--- /dev/null
+libpostproc.so
\ No newline at end of file
#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>
#include "../common/utf.h"
#include "../common/except.h"
#include "../common/log.h"
+#include "../common/timer.h"
#endif
#if defined(_MSC_VER)
#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>
#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 {
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:
#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>
#include <boost/algorithm/string.hpp>
#include <boost/property_tree/ptree.hpp>
-#include <boost/timer.hpp>
#if defined(_MSC_VER)
#pragma warning (push)
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_);
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
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()
+
#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>
#include <tbb/tbb_thread.h>
#include <unordered_map>
#include <vector>
+#include <common/timer.h>
#pragma warning(push, 1)
#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>
if(frame_number_ % 25 == 0)
check_space();
- boost::timer frame_timer;
+ caspar::timer frame_timer;
encode_video_frame(frame);
encode_audio_frame(frame);
#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>
#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>
{
auto frame = core::draw_frame::late();
- boost::timer frame_timer;
+ caspar::timer frame_timer;
end_seek();
source_group(sources ./*)
target_link_libraries(image common core)
-if (MSVC)
+
+if(MSVC)
target_link_libraries(image
common
core
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()
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()
+
#include <common/utf.h>
#include <common/prec_timer.h>
#include <common/future.h>
+#include <common/timer.h>
//#include <windows.h>
#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>
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_;
#include "AMCPCommandQueue.h"
-#include <boost/timer.hpp>
+#include <common/timer.h>
namespace caspar { namespace protocol { namespace amcp {
{
try
{
- boost::timer timer;
+ caspar::timer timer;
if(pCurrentCommand->Execute())
CASPAR_LOG(debug) << "Executed command: " << pCurrentCommand->print() << " " << timer.elapsed();
else
)
endif ()
set(SOURCES
+ casparcg.config
main.cpp
server.cpp
stdafx.cpp
)
set(HEADERS
- casparcg.config
included_modules.h
platform_specific.h
server.h
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)