From a875548a2421ed28ab0084cfc34d376b657d38e5 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 16 Dec 2011 22:48:13 +0000 Subject: [PATCH] 2.1.0: Merged revision(s) 1898-1900 from server/trunk: Fixed Neptune support. ........ ........ Another Neptune fix, don't conflict with Hawrys. ........ git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@1901 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- core/video_channel.cpp | 3 +++ modules/flash/producer/cg_producer.cpp | 19 +++++++++++++++---- protocol/cii/CIICommandsImpl.cpp | 5 ++++- protocol/cii/CIIProtocolStrategy.cpp | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/core/video_channel.cpp b/core/video_channel.cpp index f5127e0ff..e6aac33f0 100644 --- a/core/video_channel.cpp +++ b/core/video_channel.cpp @@ -73,6 +73,9 @@ public: void set_video_format_desc(const video_format_desc& format_desc) { + if(format_desc.format == core::video_format::invalid) + BOOST_THROW_EXCEPTION(invalid_argument() << msg_info("Invalid video-format")); + try { output_->set_video_format_desc(format_desc); diff --git a/modules/flash/producer/cg_producer.cpp b/modules/flash/producer/cg_producer.cpp index 909dea449..1fd9d339a 100644 --- a/modules/flash/producer/cg_producer.cpp +++ b/modules/flash/producer/cg_producer.cpp @@ -50,6 +50,9 @@ public: if(filename.size() > 0 && filename[0] == L'/') filename = filename.substr(1, filename.size()-1); + if(boost::filesystem::wpath(filename).extension() == L"") + filename += L".ft"; + auto str = (boost::wformat(L"%1%%2%%3%%4%") % layer % filename % (play_on_load?TEXT(""):TEXT("")) % label % data).str(); CASPAR_LOG(info) << flash_producer_->print() << " Invoking add-command: " << str; @@ -194,11 +197,19 @@ safe_ptr get_default_cg_producer(const safe_ptrstage()->foreground(render_layer).get(); - if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack + try + { + if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack + { + flash_producer = make_safe(flash::create_producer(video_channel->mixer(), boost::assign::list_of())); + video_channel->stage()->load(render_layer, flash_producer); + video_channel->stage()->play(render_layer); + } + } + catch(...) { - flash_producer = make_safe(flash::create_producer(video_channel->mixer(), boost::assign::list_of())); - video_channel->stage()->load(render_layer, flash_producer); - video_channel->stage()->play(render_layer); + CASPAR_LOG_CURRENT_EXCEPTION(); + throw; } return static_pointer_cast(flash_producer); diff --git a/protocol/cii/CIICommandsImpl.cpp b/protocol/cii/CIICommandsImpl.cpp index 306e6b60a..bd88a3bdb 100644 --- a/protocol/cii/CIICommandsImpl.cpp +++ b/protocol/cii/CIICommandsImpl.cpp @@ -111,6 +111,9 @@ void MiscellaneousCommand::Setup(const std::vector& parameters) { layer_ = _ttoi(parameters[4].c_str()); filename_ = parameters[5]; + if(filename_.find(L"PK/") == std::wstring::npos && filename_.find(L"PK\\") == std::wstring::npos) + filename_ = L"PK/" + filename_; + state_ = 1; if(parameters.size() > 7) { std::wstringstream dataStream; @@ -132,7 +135,7 @@ void MiscellaneousCommand::Setup(const std::vector& parameters) std::wstring value = parameters[3]; std::transform(value.begin(), value.end(), value.begin(), toupper); - //this->pCIIStrategy_->GetChannel()->SetVideoFormat(value); TODO + this->pCIIStrategy_->GetChannel()->set_video_format_desc(core::video_format_desc::get(value)); } } diff --git a/protocol/cii/CIIProtocolStrategy.cpp b/protocol/cii/CIIProtocolStrategy.cpp index 537b72fbd..0c4b719b4 100644 --- a/protocol/cii/CIIProtocolStrategy.cpp +++ b/protocol/cii/CIIProtocolStrategy.cpp @@ -83,7 +83,7 @@ void CIIProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInf void CIIProtocolStrategy::ProcessMessage(const std::wstring& message) { - CASPAR_LOG(debug) << message.c_str(); + CASPAR_LOG(debug) << L"Received: " << message.c_str(); std::vector tokens; int tokenCount = TokenizeMessage(message, &tokens); -- 2.39.2