#include "../mixer/read_frame.h"\r
\r
#include <common/concurrency/executor.h>\r
-#include <common/diagnostics/graph.h>\r
#include <common/utility/assert.h>\r
#include <common/utility/timer.h>\r
#include <common/memory/memshfl.h>\r
\r
#include <boost/circular_buffer.hpp>\r
-#include <boost/timer.hpp>\r
\r
namespace caspar { namespace core {\r
\r
typedef std::map<int, safe_ptr<frame_consumer>>::value_type layer_t;\r
\r
high_prec_timer timer_;\r
- \r
- safe_ptr<diagnostics::graph> diag_;\r
-\r
- boost::timer frame_timer_;\r
- boost::timer tick_timer_;\r
\r
public:\r
implementation(video_channel_context& video_channel) \r
: channel_(video_channel)\r
- , diag_(diagnostics::create_graph(std::string("frame_consumer_device")))\r
{ \r
- diag_->add_guide("frame-time", 0.5f); \r
- diag_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
- diag_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f));\r
}\r
\r
std::pair<size_t, size_t> buffer_depth()\r
{ \r
if(!has_synchronization_clock())\r
timer_.tick(1.0/channel_.get_format_desc().fps);\r
-\r
- frame_timer_.restart();\r
- \r
+ \r
auto fill = frame;\r
auto key = get_key_frame(frame);\r
\r
if(static_cast<size_t>(frame->image_data().size()) == consumer->get_video_format_desc().size)\r
consumer->send(frame);\r
});\r
-\r
- diag_->update_value("frame-time", frame_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
- \r
- diag_->update_value("tick-time", tick_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
- tick_timer_.restart();\r
}\r
\r
private:\r
\r
#include <common/exception/exceptions.h>\r
#include <common/concurrency/executor.h>\r
-#include <common/diagnostics/graph.h>\r
#include <common/utility/tweener.h>\r
\r
\r
\r
#include <boost/fusion/container/map.hpp>\r
#include <boost/fusion/include/at_key.hpp>\r
-#include <boost/timer.hpp>\r
\r
#include <unordered_map>\r
\r
struct frame_mixer_device::implementation : boost::noncopyable\r
{ \r
video_channel_context& channel_;\r
-\r
- safe_ptr<diagnostics::graph> diag_;\r
- boost::timer frame_timer_;\r
- boost::timer tick_timer_;\r
-\r
+ \r
audio_mixer audio_mixer_;\r
image_mixer image_mixer_;\r
\r
public:\r
implementation(video_channel_context& video_channel) \r
: channel_(video_channel)\r
- , diag_(diagnostics::create_graph(narrow(print())))\r
, image_mixer_(channel_)\r
- {\r
- diag_->add_guide("frame-time", 0.5f); \r
- diag_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
- diag_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f));\r
- \r
+ { \r
CASPAR_LOG(info) << print() << L" Successfully initialized."; \r
}\r
\r
safe_ptr<read_frame> execute(const std::map<int, safe_ptr<core::basic_frame>>& frames)\r
{ \r
- frame_timer_.restart();\r
-\r
auto image = mix_image(frames);\r
auto audio = mix_audio(frames);\r
\r
- diag_->update_value("frame-time", frame_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
- \r
- diag_->update_value("tick-time", tick_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
- tick_timer_.restart();\r
-\r
return make_safe<read_frame>(std::move(image), std::move(audio));\r
}\r
\r
#include <core/producer/frame/basic_frame.h>\r
#include <core/producer/frame/frame_factory.h>\r
\r
-#include <common/diagnostics/graph.h>\r
#include <common/concurrency/executor.h>\r
\r
-#include <boost/timer.hpp>\r
#include <boost/range/algorithm.hpp>\r
\r
#include <tbb/parallel_for.h>\r
{ \r
std::map<int, layer> layers_; \r
typedef std::map<int, layer>::value_type layer_t;\r
- \r
- safe_ptr<diagnostics::graph> diag_;\r
- boost::timer frame_timer_;\r
- boost::timer tick_timer_;\r
- boost::timer output_timer_;\r
- \r
+ \r
video_channel_context& channel_;\r
public:\r
implementation(video_channel_context& video_channel) \r
- : diag_(diagnostics::create_graph(std::string("frame_producer_device")))\r
- , channel_(video_channel)\r
+ : channel_(video_channel)\r
{\r
- diag_->add_guide("frame-time", 0.5f); \r
- diag_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
- diag_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f)); \r
}\r
\r
std::map<int, safe_ptr<basic_frame>> execute()\r
- { \r
- frame_timer_.restart();\r
- \r
+ { \r
std::map<int, safe_ptr<basic_frame>> frames;\r
\r
// Allocate placeholders.\r
frames[layer.first] = layer.second.receive();\r
});\r
\r
- diag_->update_value("frame-time", frame_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
-\r
- diag_->update_value("tick-time", tick_timer_.elapsed()*channel_.get_format_desc().fps*0.5);\r
- tick_timer_.restart();\r
-\r
return frames;\r
}\r
\r
#include "producer/layer.h"\r
\r
#include <common/concurrency/executor.h>\r
+#include <common/diagnostics/graph.h>\r
\r
#include <boost/range/algorithm_ext/erase.hpp>\r
+#include <boost/timer.hpp>\r
\r
#ifdef _MSC_VER\r
#pragma warning(disable : 4355)\r
safe_ptr<frame_consumer_device> consumer_;\r
safe_ptr<frame_mixer_device> mixer_;\r
safe_ptr<frame_producer_device> producer_;\r
+\r
+ safe_ptr<diagnostics::graph> diag_;\r
+ boost::timer frame_timer_;\r
+ boost::timer tick_timer_;\r
\r
public:\r
implementation(int index, const video_format_desc& format_desc, ogl_device& ogl) \r
: context_(index, ogl, format_desc)\r
+ , diag_(diagnostics::create_graph(narrow(print())))\r
, consumer_(new frame_consumer_device(context_))\r
, mixer_(new frame_mixer_device(context_))\r
, producer_(new frame_producer_device(context_)) \r
{\r
+ diag_->add_guide("produce-time", 0.5f); \r
+ diag_->set_color("produce-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
+ diag_->add_guide("mix-time", 0.5f); \r
+ diag_->set_color("mix-time", diagnostics::color(1.0f, 0.0f, 1.0f));\r
+ diag_->add_guide("consume-time", 0.5f); \r
+ diag_->set_color("consume-time", diagnostics::color(1.0f, 1.0f, 0.0f));\r
+ diag_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f)); \r
+\r
CASPAR_LOG(info) << print() << " Successfully Initialized.";\r
context_.execution().begin_invoke([this]{tick();});\r
}\r
\r
void tick()\r
{\r
+ // Produce\r
+\r
+ frame_timer_.restart();\r
+\r
auto simple_frames = producer_->execute();\r
+\r
+ diag_->update_value("produce-time", frame_timer_.elapsed()*context_.get_format_desc().fps*0.5);\r
+ \r
+ // Mix\r
+\r
+ frame_timer_.restart();\r
+\r
auto finished_frame = mixer_->execute(simple_frames);\r
+ \r
+ diag_->update_value("mix-time", frame_timer_.elapsed()*context_.get_format_desc().fps*0.5);\r
+ \r
+ // Consume\r
+\r
+ frame_timer_.restart();\r
+\r
consumer_->execute(finished_frame);\r
+ \r
+ diag_->update_value("consume-time", frame_timer_.elapsed()*context_.get_format_desc().fps*0.5);\r
+ \r
+ // Next\r
+\r
+ diag_->update_value("tick-time", tick_timer_.elapsed()*context_.get_format_desc().fps*0.5);\r
+ tick_timer_.restart();\r
\r
context_.execution().begin_invoke([this]{tick();});\r
}\r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed May 25 17:16:09 2011\r
+/* at Mon Jun 06 18:19:11 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed May 25 17:16:09 2011\r
+/* at Mon Jun 06 18:19:11 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
\r
safe_ptr<core::frame_consumer> create_ogl_consumer(const std::vector<std::wstring>& params)\r
{\r
- if(params.size() < 1 || params[0] != L"OGL")\r
+ if(params.size() < 1 || params[0] != L"SCREEN")\r
return core::frame_consumer::empty();\r
\r
size_t screen_index = 0;\r
<?xml version="1.0" encoding="utf-8"?>\r
<configuration>\r
<paths>\r
- <media-path>L:\\Casparcg\\_media\\</media-path>\r
- <log-path>L:\\Casparcg\\_log\\</log-path>\r
- <data-path>L:\\Casparcg\\_data\\</data-path>\r
- <template-path>L:\\Casparcg\\_templates\\</template-path>\r
+ <media-path>C:\\Casparcg\\_media\\</media-path>\r
+ <log-path>C:\\Casparcg\\_log\\</log-path>\r
+ <data-path>C:\\Casparcg\\_data\\</data-path>\r
+ <template-path>C:\\Casparcg\\_templates\\</template-path>\r
<template-host>cg.fth.18</template-host>\r
</paths>\r
<diagnostics>\r
- <graphs>true</graphs> <!-- [true/false] Displays diagnostics window with real-time graphs. -->\r
+ <graphs>true</graphs>\r
</diagnostics>\r
<channels>\r
<channel>\r
- <!--\r
- Fully or partially supported video-formats:\r
- PAL (full support)\r
- NTSC\r
- 576p2500\r
- 720p2500\r
- 720p5000\r
- 720p5994\r
- 720p6000\r
- 1080p2398\r
- 1080p2400\r
- 1080i5000 (full support)\r
- 1080i5994\r
- 1080i6000\r
- 1080p2500\r
- 1080p2997\r
- 1080p3000\r
- 1080p5000\r
- -->\r
- <videomode>1080i5000</videomode>\r
+ <video-mode>1080i5000</video-mode>\r
<consumers>\r
- <decklink>\r
+ <screen>\r
+ <windowed>true</windowed>\r
+ </screen>\r
+ <!--<decklink>\r
<device>1</device> \r
<embedded-audio>true</embedded-audio> \r
<low-latency>true</low-latency> \r
<external-key>true</external-key> \r
<key-only>false</key-only> \r
- </decklink>\r
- <!--<audio>\r
- </audio>-->\r
- <!--<bluefish>\r
- <device>1</device>\r
- <embedded-audio>true</embedded-audio>\r
- </bluefish>-->\r
+ </decklink>-->\r
</consumers>\r
</channel>\r
</channels>\r
<protocol>AMCP</protocol>\r
</tcp>\r
</controllers>\r
-</configuration>
\ No newline at end of file
+</configuration>\r
+\r
+\r
+<!--\r
+\r
+<channel>\r
+ <video-mode> PAL [PAL|NTSC|1080i5000|576p2500720p2500|720p5000|720p5994|720p6000|1080p2398|1080p2400|1080i5000|1080i5994|1080i6000|1080p2500|1080p2997|1080p3000|1080p5000] </video-mode>\r
+ <consumers>\r
+ <decklink>\r
+ <device>[1..]</device>\r
+ <embedded-audio>false [true|false]</embedded-audio>\r
+ <low-latency>false [true|false]</low-latency>\r
+ <external-key>true [true|false]</external-key>\r
+ <key-only>false [true|false]</key-only>\r
+ </decklink>\r
+ <bluefish>\r
+ <device>[1..]</device>\r
+ <embedded-audio>false [true|false]</embedded-audio>\r
+ <key-only>false [true|false]</key-only>\r
+ </bluefish>\r
+ <audio></audio>\r
+ <screen>\r
+ <device>[0..]</device>\r
+ <stretch>fill [none|fill|uniform|uniform_to_fill]</stretch>\r
+ <windowed>false [true|false]</windowed>\r
+ <key-only>false [true|false]</key-only>\r
+ </screen>\r
+ </consumers>\r
+</channel>\r
+ \r
+--> \r
+ \r
+\r
try\r
{\r
const std::string name = xml_consumer.first;\r
- if(name == "ogl")\r
+ if(name == "screen")\r
channels_.back()->consumer()->add(index++, create_ogl_consumer(xml_consumer.second)); \r
else if(name == "bluefish") \r
channels_.back()->consumer()->add(index++, create_bluefish_consumer(xml_consumer.second)); \r