]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 14 Mar 2011 20:13:34 +0000 (20:13 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 14 Mar 2011 20:13:34 +0000 (20:13 +0000)
common/common.vcxproj
common/common.vcxproj.filters
common/diagnostics/graph.cpp
common/utility/timer.h [deleted file]
modules/bluefish/consumer/bluefish_consumer.cpp
modules/flash/producer/flash_producer.cpp
shell/caspar.config

index c183cef41db252999f9d895f58a9b5c1f9a8a918..1c48447dfd3942077713166a648d91a089a27d9d 100644 (file)
     <ClInclude Include="utility\assert.h" />\r
     <ClInclude Include="utility\printer.h" />\r
     <ClInclude Include="utility\string.h" />\r
-    <ClInclude Include="utility\timer.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="diagnostics\graph.cpp">\r
index 0504c22f9d727ca4b99bbd074f7eeabadd09914d..696f82a3c6a3f7c87569b84ea600b693f1922e0c 100644 (file)
@@ -81,8 +81,5 @@
     <ClInclude Include="utility\string.h">\r
       <Filter>utility</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="utility\timer.h">\r
-      <Filter>utility</Filter>\r
-    </ClInclude>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index 928d7c24505359b92ac160e37c4bf96c74903b67..63b5dd82d240beb1e036a14b5a7747a9177bb7d6 100644 (file)
@@ -5,7 +5,6 @@
 #pragma warning (disable : 4244)\r
 \r
 #include "../concurrency/executor.h"\r
-#include "../utility/timer.h"\r
 #include "../env.h"\r
 \r
 #include <SFML/Graphics.hpp>\r
@@ -30,7 +29,6 @@ struct drawable : public sf::Drawable
 \r
 class context : public drawable\r
 {      \r
-       timer timer_;\r
        sf::RenderWindow window_;\r
        \r
        std::list<std::shared_ptr<drawable>> drawables_;\r
@@ -79,7 +77,7 @@ private:
                glClear(GL_COLOR_BUFFER_BIT);\r
                window_.Draw(*this);\r
                window_.Display();\r
-               timer_.tick(1.0/50.0);\r
+               boost::this_thread::sleep(boost::posix_time::milliseconds(20));\r
                executor_.begin_invoke([this]{tick();});\r
        }\r
 \r
diff --git a/common/utility/timer.h b/common/utility/timer.h
deleted file mode 100644 (file)
index 6d5a15d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#pragma once\r
-\r
-#include <windows.h>\r
-\r
-namespace caspar {\r
-       \r
-class timer\r
-{\r
-public:\r
-       timer()\r
-       {\r
-               QueryPerformanceFrequency(&freq_);\r
-               QueryPerformanceCounter(&time_);\r
-       }\r
-\r
-       double elapsed()\r
-       {\r
-               LARGE_INTEGER t;\r
-               QueryPerformanceCounter(&t);\r
-               int ticks_passed = static_cast<int>(static_cast<__int64>(t.QuadPart) - static_cast<__int64>(time_.QuadPart));\r
-               return static_cast<double>(ticks_passed)/static_cast<double>(freq_.QuadPart);\r
-       }\r
-       \r
-       void reset()\r
-       {\r
-               QueryPerformanceCounter(&time_);\r
-       }\r
-\r
-       // Author: Ryan M. Geiss\r
-       // http://www.geisswerks.com/ryan/FAQS/timing.html\r
-       void tick(double interval)\r
-       {       \r
-               LARGE_INTEGER t;\r
-               QueryPerformanceCounter(&t);\r
-\r
-               if (time_.QuadPart != 0)\r
-               {\r
-                       int ticks_to_wait = static_cast<int>(static_cast<double>(freq_.QuadPart) * interval);\r
-                       int done = 0;\r
-                       do\r
-                       {\r
-                               QueryPerformanceCounter(&t);\r
-                               \r
-                               int ticks_passed = static_cast<int>(static_cast<__int64>(t.QuadPart) - static_cast<__int64>(time_.QuadPart));\r
-                               int ticks_left = ticks_to_wait - ticks_passed;\r
-\r
-                               if (t.QuadPart < time_.QuadPart)    // time wrap\r
-                                       done = 1;\r
-                               if (ticks_passed >= ticks_to_wait)\r
-                                       done = 1;\r
-                               \r
-                               if (!done)\r
-                               {\r
-                                       // if > 0.002s left, do Sleep(1), which will actually sleep some \r
-                                       //   steady amount, probably 1-2 ms,\r
-                                       //   and do so in a nice way (cpu meter drops; laptop battery spared).\r
-                                       // otherwise, do a few Sleep(0)'s, which just give up the timeslice,\r
-                                       //   but don't really save cpu or battery, but do pass a tiny\r
-                                       //   amount of time.\r
-                                       if (ticks_left > static_cast<int>((freq_.QuadPart*2)/1000))\r
-                                               Sleep(1);\r
-                                       else                        \r
-                                               for (int i = 0; i < 10; ++i) \r
-                                                       Sleep(0);  // causes thread to give up its timeslice\r
-                               }\r
-                       }\r
-                       while (!done);            \r
-               }\r
-\r
-               time_ = t;\r
-       }               \r
-private:       \r
-       LARGE_INTEGER freq_;\r
-       LARGE_INTEGER time_;\r
-};\r
-\r
-}
\ No newline at end of file
index 14f0ac3532c4e12fcaa50e68f22395d237fe1310..8bbfafc4b9e5b5828b661a7874e0dc1fc0962473 100644 (file)
@@ -271,9 +271,6 @@ public:
                        try\r
                        {\r
                                std::copy_n(frame->image_data().begin(), frame->image_data().size(), reserved_frames_.front()->image_data());\r
-\r
-                               unsigned long n_field = 0;\r
-                               blue_->wait_output_video_synch(UPD_FMT_FRAME, n_field);\r
                                \r
                                if(embed_audio_)\r
                                {               \r
@@ -305,6 +302,9 @@ public:
                                                CASPAR_LOG(warning) << print() << TEXT(" render_buffer_update failed.");\r
                                }\r
 \r
+                               unsigned long n_field = 0;\r
+                               blue_->wait_output_video_synch(UPD_FMT_FRAME, n_field);\r
+\r
                                std::rotate(reserved_frames_.begin(), reserved_frames_.begin() + 1, reserved_frames_.end());\r
                                graph_->update_value("tick-time", static_cast<float>(perf_timer_.elapsed()/format_desc_.interval*0.5));\r
                                perf_timer_.reset();\r
index 033a5d9ced15f04530bee6f0e7687a0008b80e74..f09e5cb08d7086113ec7a3bd5d455d8af445365e 100644 (file)
@@ -177,7 +177,7 @@ private:
                        graph_->add_tag("underflow");\r
 \r
                double frame_time = 1.0/ax_->GetFPS()*(underflow ? 0.90 : 1.0); // Reduce sync-time if in underflow.\r
-               timer_.tick(frame_time); // Tick doesnt work on nested timelines, force an actual sync\r
+               //timer_.tick(frame_time); // Tick doesnt work on nested timelines, force an actual sync\r
 \r
                perf_timer_.reset();\r
                ax_->Tick();\r
index 0bf5fd4e640a43e9ed794b19e44938939151bc98..c99fdedc4b18a83924a6e30dafb72892d05aecfd 100644 (file)
     <channel>\r
       <videomode>PAL</videomode>\r
       <consumers>\r
-        <ogl>\r
+        <!--ogl>\r
           <device>1</device>\r
           <stretch>uniform</stretch>\r
           <windowed>true</windowed>\r
-        </ogl>\r
+        </ogl-->\r
         <audio/>\r
         <!--decklink>\r
           <device>1</device>\r
           <embedded-audio>true</embedded-audio>\r
           <internal-key>false</internal-key>\r
         </decklink-->\r
-        <!--<bluefish>\r
+        <bluefish>\r
           <device>1</device>\r
-          <embedded-audio>true</embedded-audio>\r
-        </bluefish>-->\r
+          <embedded-audio>false</embedded-audio>\r
+        </bluefish>\r
       </consumers>\r
     </channel>\r
 </channels>\r