\r
#include <common/log/log.h>\r
#include <common/env.h>\r
+#include <common/utility/assert.h>\r
\r
#include <tbb/task.h>\r
#include <tbb/atomic.h>\r
+#include <tbb/parallel_for.h>\r
+#include <tbb/tbb_thread.h>\r
\r
-#include <regex>\r
-#include <boost/algorithm/string.hpp>\r
-\r
+#if defined(_MSC_VER)\r
+#pragma warning (push)\r
+#pragma warning (disable : 4244)\r
+#endif\r
extern "C" \r
{\r
#define __STDC_CONSTANT_MACROS\r
#define __STDC_LIMIT_MACROS\r
#include <libavformat/avformat.h>\r
}\r
+#if defined(_MSC_VER)\r
+#pragma warning (pop)\r
+#endif\r
\r
-namespace caspar {\r
+namespace caspar { namespace ffmpeg {\r
\r
int thread_execute(AVCodecContext* s, int (*func)(AVCodecContext *c2, void *arg2), void* arg, int* ret, int count, int size)\r
{\r
tbb::atomic<int> counter; \r
counter = 0; \r
\r
+ CASPAR_ASSERT(tbb::tbb_thread::hardware_concurrency() < 16);\r
// Note: this will probably only work when tbb::task_scheduler_init::num_threads() < 16.\r
tbb::parallel_for(tbb::blocked_range<int>(0, count, 2), [&](const tbb::blocked_range<int> &r) \r
{ \r
{\r
avctx->thread_count = 1;\r
// Some codecs don't like to have multiple multithreaded decoding instances. Only enable for those we know work.\r
- if((codec->id == CODEC_ID_MPEG2VIDEO ||\r
- codec->id == CODEC_ID_H264) && \r
+ if((codec->id == CODEC_ID_MPEG2VIDEO) && \r
(codec->capabilities & CODEC_CAP_SLICE_THREADS) && \r
(avctx->thread_type & FF_THREAD_SLICE))\r
{\r
return avcodec_close(avctx); \r
}\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file