]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: - tbb_avcodec: Multithreading only enabled from MPEG2 until other codecs...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 19 May 2011 23:31:17 +0000 (23:31 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 19 May 2011 23:31:17 +0000 (23:31 +0000)
         - diagnoatics: Thread priority set to "below_normal".

git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@793 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

common/diagnostics/graph.cpp
modules/ffmpeg/tbb_avcodec.cpp
shell/caspar.config

index f7d66843af532303b900a1d4cd3d1577504d9a38..a1f96350b76d1fe13a166c99eedd2ee4214cfc8d 100644 (file)
@@ -77,7 +77,8 @@ private:
        {\r
                executor_.start();\r
                executor_.begin_invoke([this]\r
-               {\r
+               {                       \r
+                       SetThreadPriority(GetCurrentThread(), BELOW_NORMAL_PRIORITY_CLASS);\r
                        window_.Create(sf::VideoMode(600, 1000), "CasparCG Diagnostics");\r
                        window_.SetPosition(0, 0);\r
                        window_.SetActive();\r
index 98b320c6adb6f6ce976b49bf499c8909b5d0eb7f..14d6588b051f460a7c3835a0c27238c8b5787344 100644 (file)
@@ -81,25 +81,11 @@ void thread_free(AVCodecContext* s)
        CASPAR_LOG(info) << "Released ffmpeg tbb context.";\r
 }\r
 \r
-std::regex get_slice_regex()\r
-{\r
-       auto s = env::properties().get("configuration.ffmpeg.slice-threads-regex", "");\r
-       boost::algorithm::erase_all(s, " ");\r
-       boost::algorithm::erase_all(s, "\n");\r
-       return std::regex(s);\r
-}\r
-\r
-bool allow_slice_thread(int id)\r
-{\r
-       static std::regex e = get_slice_regex();\r
-       return std::regex_match(boost::lexical_cast<std::string>(id), e);\r
-}\r
-\r
 int tbb_avcodec_open(AVCodecContext* avctx, AVCodec* codec)\r
 {\r
-       auto id = codec->id;\r
        avctx->thread_count = 1;\r
-       if(allow_slice_thread(id) && // Some codecs don't like to have multiple multithreaded decoding instances. Only enable for those we know work.\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->capabilities & CODEC_CAP_SLICE_THREADS) && \r
          (avctx->thread_type & FF_THREAD_SLICE))\r
        {\r
index 915a21b03316b2532509f30eedc0e903cc80eb90..1083ec8970c915c39748cf57dcd690ecfe6bcfbb 100644 (file)
   <diagnostics>\r
     <graphs>true</graphs> <!-- [true/false] Displays diagnostics window with real-time graphs. -->\r
   </diagnostics>\r
-  <ffmpeg>\r
-    <slice-threads-regex>\r
-      <!-- Use slice threads only for tested codecs. Some codecs do not like to have multiple multithreaded decoders running simultaneously.-->\r
-      <!-- Match the provided regex expression against the codec-id.-->\r
-      2 <!-- mpeg2 --> | \r
-      28 <!-- h264 -->\r
-    </slice-threads-regex>\r
-  </ffmpeg>\r
   <channels>\r
     <channel>\r
       <!--\r