#include <common/prec_timer.h>
#include <common/linq.h>
#include <common/os/filesystem.h>
+#include <common/memcpy.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
tbb::concurrent_queue<std::wstring> javascript_before_load_;
tbb::atomic<bool> loaded_;
tbb::atomic<bool> removed_;
- tbb::atomic<bool> animation_frame_requested_;
std::queue<core::draw_frame> frames_;
mutable boost::mutex frames_mutex_;
{
graph_->set_color("browser-tick-time", diagnostics::color(0.1f, 1.0f, 0.1f));
graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));
- graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.9f));
+ graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));
graph_->set_text(print());
diagnostics::register_graph(graph_);
loaded_ = false;
removed_ = false;
- animation_frame_requested_ = false;
executor_.begin_invoke([&]{ update(); });
}
void close()
{
- if (!animation_frame_requested_)
- CASPAR_LOG(warning) << print()
- << " window.requestAnimationFrame() never called. "
- << "Animations might have been laggy";
-
html::invoke([=]
{
if (browser_ != nullptr)
paint_timer_.restart();
CASPAR_ASSERT(CefCurrentlyOn(TID_UI));
- boost::timer copy_timer;
core::pixel_format_desc pixel_desc;
pixel_desc.format = core::pixel_format::bgra;
pixel_desc.planes.push_back(
core::pixel_format_desc::plane(width, height, 4));
auto frame = frame_factory_->create_frame(this, pixel_desc, core::audio_channel_layout::invalid());
- A_memcpy(frame.image_data().begin(), buffer, width * height * 4);
+ fast_memcpy(frame.image_data().begin(), buffer, width * height * 4);
lock(frames_mutex_, [&]
{
graph_->set_tag(diagnostics::tag_severity::WARNING, "dropped-frame");
}
});
- graph_->set_value("copy-time", copy_timer.elapsed()
- * format_desc_.fps
- * format_desc_.field_count
- * 0.5);
}
void OnAfterCreated(CefRefPtr<CefBrowser> browser) override
{
auto name = message->GetName().ToString();
- if (name == ANIMATION_FRAME_REQUESTED_MESSAGE_NAME)
- {
- CASPAR_LOG(trace)
- << print() << L" Requested animation frame";
- animation_frame_requested_ = true;
-
- return true;
- }
- else if (name == REMOVE_MESSAGE_NAME)
+ if (name == REMOVE_MESSAGE_NAME)
{
remove();
browser_->SendProcessMessage(
CefProcessId::PID_RENDERER,
CefProcessMessage::Create(TICK_MESSAGE_NAME));
+
graph_->set_value("tick-time", tick_timer_.elapsed()
* format_desc_.fps
* format_desc_.field_count
}
else
{
- graph_->set_tag(diagnostics::tag_severity::INFO, "late-frame");
-
if (format_desc_.field_mode != core::field_mode::progressive)
lock(last_frame_mutex_, [&]
{