executor_.start();\r
active_ = executor_.begin_invoke([]{});\r
\r
- static boost::once_flag av_register_all_flag = BOOST_ONCE_INIT;\r
- boost::call_once(av_register_all, av_register_all_flag); \r
- \r
- static boost::once_flag avcodec_init_flag = BOOST_ONCE_INIT;\r
- boost::call_once(avcodec_init, avcodec_init_flag); \r
-\r
fmt_ = av_guess_format(nullptr, filename_.c_str(), nullptr);\r
if (!fmt_) \r
{\r
, video_s_index_(-1)\r
, audio_s_index_(-1)\r
, filename_(filename)\r
- { \r
- static boost::once_flag av_register_all_flag = BOOST_ONCE_INIT;\r
- boost::call_once(av_register_all, av_register_all_flag); \r
- \r
- static boost::once_flag avcodec_init_flag = BOOST_ONCE_INIT;\r
- boost::call_once(avcodec_init, avcodec_init_flag); \r
- \r
+ { \r
int errn;\r
AVFormatContext* weak_format_context_;\r
if((errn = -av_open_input_file(&weak_format_context_, narrow(filename).c_str(), nullptr, 0, nullptr)) > 0)\r
double param;\r
sws_context_.reset(sws_getContext(width_, height_, pix_fmt_, width_, height_, PIX_FMT_BGRA, SWS_BILINEAR, nullptr, nullptr, ¶m), sws_freeContext);\r
if(!sws_context_)\r
- BOOST_THROW_EXCEPTION( operation_failed() <<\r
- msg_info("Could not create software scaling context.") << \r
- boost::errinfo_api_function("sws_getContext"));\r
+ BOOST_THROW_EXCEPTION(operation_failed() <<\r
+ msg_info("Could not create software scaling context.") << \r
+ boost::errinfo_api_function("sws_getContext"));\r
}\r
}\r
\r
std::copy_n(decoded + y*decoded_linesize, plane.linesize, result + y*plane.linesize);\r
});\r
});\r
-\r
- if(codec_context_->codec_id == CODEC_ID_DVVIDEO && frame_factory_->get_video_format_desc().mode == video_mode::upper)\r
- write->get_image_transform().set_image_translation(0.0f, 1.0/static_cast<double>(height_));\r
}\r
else\r
{\r
\r
sws_scale(sws_context_.get(), decoded_frame->data, decoded_frame->linesize, 0, height_, av_frame->data, av_frame->linesize); \r
} \r
+\r
+ if(codec_context_->codec_id == CODEC_ID_DVVIDEO && frame_factory_->get_video_format_desc().mode == video_mode::upper)\r
+ write->get_image_transform().set_image_translation(0.0f, 1.0/static_cast<double>(height_));\r
+\r
return write;\r
}\r
};\r
\r
#include "ogl_device.h"\r
\r
+#include <common/utility/assert.h>\r
+\r
#include <Glee.h>\r
#include <SFML/Window.hpp>\r
\r
\r
safe_ptr<device_buffer> ogl_device::create_device_buffer(size_t width, size_t height, size_t stride)\r
{\r
+ CASPAR_ASSERT(stride > 0 && stride < 5);\r
+ CASPAR_ASSERT(width > 0 && height > 0);\r
auto pool = &device_pools_[stride-1][((width << 16) & 0xFFFF0000) | (height & 0x0000FFFF)];\r
std::shared_ptr<device_buffer> buffer;\r
if(!pool->try_pop(buffer)) \r
\r
safe_ptr<host_buffer> ogl_device::create_host_buffer(size_t size, host_buffer::usage_t usage)\r
{\r
+ CASPAR_ASSERT(usage == host_buffer::write_only || usage == host_buffer::read_only);\r
+ CASPAR_ASSERT(size > 0);\r
auto pool = &host_pools_[usage][size];\r
std::shared_ptr<host_buffer> buffer;\r
if(!pool->try_pop(buffer))\r
#include <common/utility/assert.h>\r
#include <protocol/amcp/AMCPProtocolStrategy.h>\r
\r
+#if defined(_MSC_VER)\r
+#pragma warning (disable : 4244)\r
+#endif\r
+\r
+extern "C" \r
+{\r
+ #define __STDC_CONSTANT_MACROS\r
+ #define __STDC_LIMIT_MACROS\r
+ #include <libavformat/avformat.h>\r
+}\r
+\r
#include <atlbase.h>\r
\r
using namespace caspar;\r
\r
int main(int argc, wchar_t* argv[])\r
{\r
+ // Init FFMPEG\r
+ av_register_all();\r
+ avcodec_init();\r
+\r
+ // Increase time precision\r
timeBeginPeriod(1);\r
\r
+ // Start caspar\r
std::wstringstream str;\r
str << "CasparCG " << env::version() << " " << env::version_tag();\r
SetConsoleTitle(str.str().c_str());\r