<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
<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
#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
\r
class context : public drawable\r
{ \r
- timer timer_;\r
sf::RenderWindow window_;\r
\r
std::list<std::shared_ptr<drawable>> drawables_;\r
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
+++ /dev/null
-#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
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
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
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
<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