std::transform(name.begin(), name.end(), name.begin(), std::tolower);\r
\r
static const std::unordered_map<std::wstring, tweener_t> tweens = boost::assign::map_list_of \r
+ (L"", ease_none ) \r
(L"linear", ease_none ) \r
(L"easenone", ease_none )\r
(L"easeinquad", ease_in_quad )\r
auto it = tweens.find(name);\r
if(it == tweens.end())\r
{\r
- CASPAR_LOG(warning) << L" Invalid tween: " << name << L" fallback to \"linear\".";\r
+ CASPAR_LOG(warning) << L"Invalid tween: " << name << L" fallback to \"linear\".";\r
it = tweens.find(L"linear");\r
}\r
\r
frame_mixer_device& channel::mixer() { return *impl_->mixer_;} \r
frame_consumer_device& channel::consumer() { return *impl_->consumer_;} \r
const video_format_desc& channel::get_video_format_desc() const{return impl_->format_desc_;}\r
+void channel::set_video_format_desc(const video_format_desc& format_desc){impl_ = make_safe<implementation>(impl_->index_, format_desc);}\r
std::wstring channel::print() const { return impl_->print();}\r
\r
}}
\ No newline at end of file
frame_consumer_device& consumer();\r
\r
const video_format_desc& get_video_format_desc() const;\r
+ void set_video_format_desc(const video_format_desc& format_desc);\r
\r
std::wstring print() const;\r
\r
const printer parent_printer_;\r
std::wstring model_name_;\r
const size_t device_index_;\r
+ tbb::atomic<bool> is_running_;\r
\r
std::shared_ptr<diagnostics::graph> graph_;\r
timer perf_timer_;\r
, audio_scheduled_(0)\r
, format_desc_(format_desc)\r
{\r
+ is_running_ = true;\r
format_desc_ = format_desc;\r
CComPtr<IDeckLinkIterator> pDecklinkIterator;\r
if(FAILED(pDecklinkIterator.CoCreateInstance(CLSID_CDeckLinkIterator)))\r
}\r
\r
~decklink_output()\r
- { \r
+ { \r
+ is_running_ = false;\r
+ video_frame_buffer_.try_push(core::read_frame::empty());\r
+ audio_frame_buffer_.try_push(core::read_frame::empty());\r
+\r
if(output_ != nullptr) \r
{\r
output_->StopScheduledPlayback(0, nullptr, 0);\r
\r
virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame* /*completedFrame*/, BMDOutputFrameCompletionResult /*result*/)\r
{\r
+ if(!is_running_)\r
+ return S_OK;\r
+\r
safe_ptr<const core::read_frame> frame; \r
video_frame_buffer_.pop(frame); \r
schedule_next_video(frame);\r
+\r
return S_OK;\r
}\r
\r
\r
virtual HRESULT STDMETHODCALLTYPE RenderAudioSamples (BOOL /*preroll*/)\r
{\r
+ if(!is_running_)\r
+ return S_OK;\r
+\r
safe_ptr<const core::read_frame> frame;\r
audio_frame_buffer_.pop(frame);\r
schedule_next_audio(frame);\r
+\r
return S_OK;\r
}\r
\r
\r
if(name == TEXT("MODE"))\r
{\r
- //if(this->GetChannel()->consumer().SetVideoFormat(value)) TODO\r
- // this->SetReplyString(TEXT("202 SET MODE OK\r\n"));\r
- //else\r
- this->SetReplyString(TEXT("501 SET MODE FAILED\r\n"));\r
+ auto format_desc = core::video_format_desc::get(value);\r
+ if(format_desc.format != core::video_format::invalid)\r
+ {\r
+ GetChannel()->set_video_format_desc(format_desc);\r
+ SetReplyString(TEXT("202 SET MODE OK\r\n"));\r
+ }\r
+ else\r
+ SetReplyString(TEXT("501 SET MODE FAILED\r\n"));\r
}\r
else\r
{\r
<windowed>true</windowed>\r
</ogl>\r
<audio/>\r
- <!--decklink>\r
+ <decklink>\r
<device>1</device>\r
<embedded-audio>true</embedded-audio>\r
<internal-key>false</internal-key>\r
- </decklink-->\r
+ </decklink>\r
<!--<bluefish>\r
<device>1</device>\r
<embedded-audio>false</embedded-audio>\r