#pragma once\r
\r
#include "../exception/win32_exception.h"\r
+#include "../utility/assert.h"\r
#include "../log/log.h"\r
\r
#include <tbb/atomic.h>\r
tbb::concurrent_bounded_queue<std::function<void()>> execution_queue_;\r
public:\r
\r
- explicit executor(const std::wstring& name = L"executor") : name_(narrow(name))\r
+ explicit executor(const std::wstring& name) : name_(narrow(name))\r
{\r
is_running_ = false;\r
}\r
catch(boost::task_already_started&){}\r
catch(...){CASPAR_LOG_CURRENT_EXCEPTION();}\r
});\r
-\r
+ \r
return std::move(future); \r
}\r
\r
}\r
\r
private:\r
- context()\r
+ context() : executor_(L"diagnostics")\r
{\r
executor_.start();\r
executor_.begin_invoke([this]\r
implementation(const printer& parent_printer, const safe_ptr<frame_factory>& factory) \r
: parent_printer_(parent_printer)\r
, factory_(factory)\r
+ , executor_(print())\r
{\r
executor_.start();\r
}\r
\r
void remove(safe_ptr<frame_producer>&& producer)\r
{\r
- CASPAR_VERIFY(producer.unique());\r
+ CASPAR_VERIFY(producer == frame_producer::empty() || producer.unique());\r
executor_.begin_invoke(std::bind(&frame_producer_remover::do_remove, this, std::move(producer)));\r
}\r
};\r
\r
explicit decklink_producer(const core::video_format_desc& format_desc, size_t device_index)\r
: format_desc_(format_desc) \r
- , device_index_(device_index){}\r
+ , device_index_(device_index)\r
+ , executor_(print()){}\r
\r
~decklink_producer()\r
{ \r
, img_convert_ctx_(nullptr)\r
, video_outbuf_(1920*1080*4)\r
, audio_outbuf_(48000)\r
+ , executor_(L"ffmpeg_consumer")\r
{}\r
\r
~implementation()\r
\r
current_chunk_.insert(current_chunk_.end(), audio_buffer_.data(), audio_buffer_.data() + written_bytes/2);\r
\r
- std::vector<std::vector<short>> chunks_;\r
+ std::vector<std::vector<short>> chunks;\r
\r
const auto last = current_chunk_.end() - current_chunk_.size() % audio_frame_size_;\r
\r
for(auto it = current_chunk_.begin(); it != last; it += audio_frame_size_) \r
- chunks_.push_back(std::vector<short>(it, it + audio_frame_size_)); \r
+ chunks.push_back(std::vector<short>(it, it + audio_frame_size_)); \r
\r
current_chunk_.erase(current_chunk_.begin(), last);\r
\r
- return chunks_;\r
+ return chunks;\r
}\r
};\r
\r
return std::shared_ptr<AVCodecContext>((*stream)->codec, avcodec_close);\r
}\r
\r
- void read_file() // For every packet taken: read in a number of packets.\r
- { \r
+ void read_file()\r
+ { \r
AVPacket tmp_packet;\r
safe_ptr<AVPacket> read_packet(&tmp_packet, av_free_packet); \r
\r
- if (av_read_frame(format_context_.get(), read_packet.get()) >= 0) // NOTE: read_packet is only valid until next call of av_safe_ptr<read_frame> or av_close_input_file\r
+ if (av_read_frame(format_context_.get(), read_packet.get()) >= 0) // NOTE: read_packet is only valid until next call of av_read_frame or av_close_input_file\r
{\r
auto packet = std::make_shared<aligned_buffer>(read_packet->data, read_packet->data + read_packet->size);\r
if(read_packet->stream_index == video_s_index_) \r
else if(!loop_ || !seek_frame(0, AVSEEK_FLAG_BACKWARD)) // TODO: av_seek_frame does not work for all formats\r
executor_.stop();\r
else\r
- graph_->add_tag("seek");\r
-\r
- boost::this_thread::yield();\r
- \r
+ graph_->add_tag("seek"); \r
+ \r
graph_->update_value("input-buffer", static_cast<float>(video_packet_buffer_.size())/static_cast<float>(PACKET_BUFFER_COUNT)); \r
\r
executor_.begin_invoke([this]{read_file();}); \r
\r
public:\r
\r
- silverlight_producer()\r
+ silverlight_producer() : executor_(print())\r
{}\r
\r
virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
const std::wstring CIIProtocolStrategy::MessageDelimiter = TEXT("\r\n");\r
const TCHAR CIIProtocolStrategy::TokenDelimiter = TEXT('\\');\r
\r
-CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels) : pChannel_(channels.at(0))\r
+CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels) : pChannel_(channels.at(0)), executor_(L"CIIProtocolStrategy")\r
{\r
executor_.start();\r
}\r
</diagnostics>\r
<channels>\r
<channel>\r
- <videomode>PAL</videomode>\r
+ <videomode>1080i5000</videomode>\r
<consumers>\r
<ogl>\r
<device>1</device>\r