]> 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>
Fri, 6 Apr 2012 17:31:39 +0000 (17:31 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 6 Apr 2012 17:31:39 +0000 (17:31 +0000)
accelerator/ogl/util/buffer.cpp
accelerator/ogl/util/device.cpp
core/producer/layer.cpp
core/video_channel.cpp
modules/ffmpeg/producer/input/input.cpp

index 5efdd2f4c3f1379505082a4e9b8edc151fe3ea5f..fa4e18005c9ecb99f8ae59931c51530b10f98bac 100644 (file)
@@ -66,7 +66,7 @@ public:
                        CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer."));\r
                \r
                if(timer.elapsed() > 0.02)\r
-                       CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer allocation blocked more than 20 ms: " << timer.elapsed();\r
+                       CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer allocation blocked: " << timer.elapsed();\r
        \r
                //CASPAR_LOG(trace) << "[buffer] [" << ++(usage_ == buffer::usage::write_only ? g_w_total_count : g_r_total_count) << L"] allocated size:" << size_ << " usage: " << (usage == buffer::usage::write_only ? "write_only" : "read_only");\r
        }       \r
@@ -80,17 +80,17 @@ public:
        {\r
                if(data_ != nullptr)\r
                        return data_;\r
+               \r
+               boost::timer timer;\r
 \r
                GL(glBindBuffer(target_, pbo_));\r
                if(usage_ == GL_STREAM_DRAW)                    \r
                        GL(glBufferData(target_, size_, NULL, usage_)); // Notify OpenGL that we don't care about previous data.\r
                \r
-               boost::timer timer;\r
-\r
                data_ = (uint8_t*)GL2(glMapBuffer(target_, usage_ == GL_STREAM_DRAW ? GL_WRITE_ONLY : GL_READ_ONLY));  \r
 \r
                if(timer.elapsed() > 0.02)\r
-                       CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer mapping blocked more than 20 ms: " << timer.elapsed();\r
+                       CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer mapping blocked: " << timer.elapsed();\r
 \r
                GL(glBindBuffer(target_, 0));\r
                if(!data_)\r
index f09c0ad9a9449740be2f4a38f1d8e290f154064f..8d2dab92b1378c059b0fdc4c9d88fda4146c6a2e 100644 (file)
@@ -155,10 +155,15 @@ struct device::impl : public std::enable_shared_from_this<impl>
                std::shared_ptr<buffer> buf;\r
                if(!pool->try_pop(buf)) \r
                {\r
+                       boost::timer timer;\r
+\r
                        buf = executor_.invoke([&]\r
                        {\r
                                return spl::make_shared<buffer>(size, usage);\r
                        }, task_priority::high_priority);\r
+                       \r
+                       if(timer.elapsed() > 0.02)\r
+                               CASPAR_LOG(debug) << L"[device] Performance warning. Buffer allocation blocked: " << timer.elapsed();\r
                }\r
                \r
                auto self = shared_from_this(); // buffers can leave the device context, take a hold on life-time.\r
@@ -210,7 +215,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                        texture->copy_from(*buf);       \r
 \r
                        texture_cache_.insert(std::make_pair(buf.get(), texture));\r
-\r
+                       \r
                        return texture;\r
                }, task_priority::high_priority);\r
        }\r
@@ -222,7 +227,8 @@ struct device::impl : public std::enable_shared_from_this<impl>
                return executor_.begin_invoke([=]() -> spl::shared_ptr<texture>\r
                {\r
                        auto texture = create_texture(width, height, stride, false);\r
-                       texture->copy_from(*buf);                               \r
+                       texture->copy_from(*buf);       \r
+                       \r
                        return texture;\r
                }, task_priority::high_priority);\r
        }\r
index d53f28242bc3334742b438bbe4cc7c756b348a17..205aad1da009fb0f887ccfaa40c955dd0c1b82f4 100644 (file)
@@ -111,13 +111,8 @@ public:
        {               \r
                try\r
                {               \r
-                       boost::timer timer;\r
-\r
                        auto frame = foreground_->receive();\r
-\r
-                       if(timer.elapsed() > 1.0/format_desc.fps*0.9)\r
-                               CASPAR_LOG(trace) << foreground_->print() << L" Is slowing down channel.";\r
-\r
+                       \r
                        if(frame == core::draw_frame::late())\r
                                return foreground_->last_frame();\r
                                                \r
index 57753c07764b2db41557e8c10caf54bbdb81cf9b..febf5da57f46e398ff893133fef5120c37d7d640 100644 (file)
@@ -108,7 +108,6 @@ public:
        {\r
                try\r
                {\r
-                       boost::timer t;\r
 \r
                        auto format_desc = video_format_desc();\r
                        \r
@@ -117,34 +116,19 @@ public:
                        // Produce\r
                        \r
                        auto stage_frames = stage_(format_desc);\r
-\r
-                       if(t.elapsed() > 1.0/format_desc.fps*0.9)\r
-                               CASPAR_LOG(trace) << print() << L" Stage is slowing down channel: " << t.elapsed();\r
-\r
-                       t.restart();\r
+                       \r
                        // Mix\r
                        \r
                        auto mixed_frame  = mixer_(std::move(stage_frames), format_desc);\r
                        \r
-                       if(t.elapsed() > 1.0/format_desc.fps*0.9)\r
-                               CASPAR_LOG(trace) << print() << L"Mixer is slowing down channel: " << t.elapsed();\r
-\r
-                       t.restart();\r
                        // Consume\r
                                                \r
                        output_(std::move(mixed_frame), format_desc);\r
                \r
-                       t.restart();\r
-\r
                        graph_->set_value("tick-time", frame_timer.elapsed()*format_desc.fps*0.5);\r
 \r
                        event_subject_  << monitor::event("profiler/time")      % frame_timer.elapsed() % (1.0/format_desc_.fps)\r
                                                        << monitor::event("format")                     % format_desc.name;\r
-                       \r
-                       if(t.elapsed() > 0.001)\r
-                               CASPAR_LOG(trace) << L"4## " << t.elapsed();\r
-\r
-                       t.restart();\r
                }\r
                catch(...)\r
                {\r
index f356aa3fa59fe9ded1651248223939599b99addf..a8a5d8be48d7c9e215739c66919b20a473f4a8ba 100644 (file)
@@ -148,6 +148,9 @@ struct input::impl : boost::noncopyable
                graph_->set_color("audio-buffer", diagnostics::color(0.7f, 0.4f, 0.4f));\r
                graph_->set_color("video-buffer", diagnostics::color(1.0f, 1.0f, 0.0f));        \r
                \r
+               for(int n = 0; n < 8; ++n)\r
+                       tick();\r
+\r
                thread_                 = boost::thread([this]{run();});\r
        }\r
 \r