]> 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>
Thu, 5 Apr 2012 21:55:13 +0000 (21:55 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 5 Apr 2012 21:55:13 +0000 (21:55 +0000)
accelerator/ogl/util/buffer.cpp
accelerator/ogl/util/device.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp

index e7d1b2bf74a15aecc3f3052cf69e8d81328f3d57..3d9e5a81e443959570119ac5a03c4e7e1a8cf643 100644 (file)
@@ -52,6 +52,8 @@ public:
                , target_(usage == buffer::usage::write_only ? GL_PIXEL_UNPACK_BUFFER : GL_PIXEL_PACK_BUFFER)\r
                , usage_(usage == buffer::usage::write_only ? GL_STREAM_DRAW : GL_STREAM_READ)\r
        {\r
+               boost::timer timer;\r
+\r
                data_ = nullptr;\r
                GL(glGenBuffers(1, &pbo_));\r
                bind(); \r
@@ -62,7 +64,9 @@ public:
 \r
                if(!pbo_)\r
                        CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer."));\r
-\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(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
 \r
index 490ab6629a2239679bc7fc31db70de9a7b6fd88c..9b463ea45e0f8525a6053d7768a0a30062f3577a 100644 (file)
@@ -75,7 +75,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                                \r
        impl(executor& executor) \r
                : render_executor_(executor)\r
-               , alloc_executor_(L"OpenGL allocation context.")\r
+               , alloc_executor_(L"OpenGL allocation context")\r
        {\r
                render_executor_.set_capacity(128);\r
                alloc_executor_.set_capacity(256);\r
@@ -117,7 +117,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                {               \r
                        device_->SetActive(true);\r
                });\r
-               \r
+                               \r
                CASPAR_LOG(info) << L"Successfully initialized OpenGL " << version();\r
        }\r
 \r
@@ -277,7 +277,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
 };\r
 \r
 device::device() \r
-       : executor_(L"OpenGL Rendering Context.")\r
+       : executor_(L"OpenGL Rendering Context")\r
        , impl_(new impl(executor_)){}\r
 device::~device(){}\r
 spl::shared_ptr<texture>                                                       device::create_texture(int width, int height, int stride){return impl_->create_texture(width, height, stride, true);}\r
index 29b6d6ee7e22580c305e88e7469d35b02bb05c9c..d9f37b3588e3d8c66f8b2b4f6f084b030870f756 100644 (file)
@@ -149,6 +149,8 @@ public:
                        CASPAR_LOG(warning) << print() << " Failed to open audio-stream. Running without audio.";               \r
                }       \r
                \r
+               decode_next_frame();\r
+\r
                CASPAR_LOG(info) << print() << L" Initialized";\r
        }\r
 \r