\r
#include "../version.h"\r
\r
-#include "exception\exceptions.h"\r
+#include "log/log.h"\r
+#include "exception/exceptions.h"\r
#include "utility/string.h"\r
\r
#include <boost/property_tree/ptree.hpp>\r
#include <iostream>\r
\r
namespace caspar { namespace env {\r
-\r
-using namespace boost::filesystem2;\r
-\r
+ \r
std::wstring media;\r
std::wstring log;\r
std::wstring ftemplate;\r
void check_is_configured()\r
{\r
if(pt.empty())\r
- BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Enviroment properties has not been configured"));\r
+ BOOST_THROW_EXCEPTION(invalid_operation() << wmsg_info(L"Enviroment properties has not been configured"));\r
}\r
\r
void configure(const std::wstring& filename)\r
{\r
try\r
{\r
- auto initialPath = boost::filesystem::initial_path<boost::filesystem2::wpath>().file_string();\r
+ auto initialPath = boost::filesystem2::initial_path<boost::filesystem2::wpath>().file_string();\r
\r
std::wifstream file(initialPath + L"\\" + filename);\r
boost::property_tree::read_xml(file, pt, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
\r
- auto paths = pt.get_child(L"configuration.paths");\r
- media = u16(paths.get(L"media-path", initialPath + L"\\media\\"));\r
- log = u16(paths.get(L"log-path", initialPath + L"\\log\\"));\r
- ftemplate = complete(wpath(u16(paths.get(L"template-path", initialPath + L"\\template\\")))).string(); \r
- data = u16(paths.get(L"data-path", initialPath + L"\\data\\"));\r
+ auto paths = pt.get_child(L"configuration.paths");\r
+ media = paths.get(L"media-path", initialPath + L"\\media\\");\r
+ log = paths.get(L"log-path", initialPath + L"\\log\\");\r
+ ftemplate = boost::filesystem2::complete(paths.get(L"template-path", initialPath + L"\\template\\")).string(); \r
+ data = paths.get(L"data-path", initialPath + L"\\data\\");\r
}\r
catch(...)\r
{\r
- std::wcout << L" ### Invalid configuration file. ###";\r
+ CASPAR_LOG(error) << L" ### Invalid configuration file. ###";\r
throw;\r
}\r
}\r
#include <boost/exception/error_info.hpp>\r
#include <boost/throw_exception.hpp>\r
\r
+#include "../utility/string.h"\r
+\r
namespace caspar {\r
\r
typedef boost::error_info<struct tag_arg_name_info, std::string> arg_name_info;\r
typedef boost::error_info<struct tag_arg_value_info, std::string> arg_value_info;\r
typedef boost::error_info<struct tag_msg_info, std::string> msg_info;\r
-typedef boost::error_info<struct tag_errorstr, std::string> errorstr;\r
typedef boost::error_info<struct tag_source_info, std::string> source_info;\r
+typedef boost::error_info<struct tag_errorstr_info, std::string> errstr_info;\r
+typedef boost::error_info<struct tag_errinfo_file_name, std::string> err_file_name_info;\r
+\r
+inline arg_name_info warg_name_info(const std::wstring& str) {return arg_name_info(u8(str));}\r
+inline arg_value_info warg_value_info(const std::wstring& str) {return arg_value_info(u8(str));}\r
+inline msg_info wmsg_info(const std::wstring& str) {return msg_info(u8(str));}\r
+inline source_info wsource_info(const std::wstring& str) {return source_info(u8(str));}\r
+inline err_file_name_info werr_file_name_info(const std::wstring& str){return err_file_name_info(u8(str));}\r
+\r
typedef boost::error_info<struct tag_line_info, size_t> line_info;\r
typedef boost::error_info<struct errinfo_nested_exception_, std::exception_ptr> errinfo_nested_exception;\r
\r
case GL_INVALID_ENUM :\r
BOOST_THROW_EXCEPTION(ogl_invalid_enum()\r
<< msg_info("an unacceptable value has been specified for an enumerated argument")\r
- << errorstr("GL_INVALID_ENUM")\r
+ << errstr_info("GL_INVALID_ENUM")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_INVALID_VALUE :\r
BOOST_THROW_EXCEPTION(ogl_invalid_value()\r
<< msg_info("a numeric argument is out of range")\r
- << errorstr("GL_INVALID_VALUE")\r
+ << errstr_info("GL_INVALID_VALUE")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_INVALID_OPERATION :\r
BOOST_THROW_EXCEPTION(ogl_invalid_operation()\r
<< msg_info("the specified operation is not allowed in the current state")\r
- << errorstr("GL_INVALID_OPERATION")\r
+ << errstr_info("GL_INVALID_OPERATION")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_STACK_OVERFLOW :\r
BOOST_THROW_EXCEPTION(ogl_stack_overflow()\r
<< msg_info("this command would cause a stack overflow")\r
- << errorstr("GL_STACK_OVERFLOW")\r
+ << errstr_info("GL_STACK_OVERFLOW")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_STACK_UNDERFLOW :\r
BOOST_THROW_EXCEPTION(ogl_stack_underflow()\r
<< msg_info("this command would cause a stack underflow")\r
- << errorstr("GL_STACK_UNDERFLOW")\r
+ << errstr_info("GL_STACK_UNDERFLOW")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_OUT_OF_MEMORY :\r
BOOST_THROW_EXCEPTION(ogl_out_of_memory()\r
<< msg_info("there is not enough memory left to execute the command")\r
- << errorstr("GL_OUT_OF_MEMORY")\r
+ << errstr_info("GL_OUT_OF_MEMORY")\r
<< line_info(line)\r
<< source_info(file));\r
\r
case GL_INVALID_FRAMEBUFFER_OPERATION_EXT :\r
BOOST_THROW_EXCEPTION(ogl_stack_underflow()\r
<< msg_info("the object bound to FRAMEBUFFER_BINDING_EXT is not \"framebuffer complete\"")\r
- << errorstr("GL_INVALID_FRAMEBUFFER_OPERATION_EXT")\r
+ << errstr_info("GL_INVALID_FRAMEBUFFER_OPERATION_EXT")\r
<< line_info(line)\r
<< source_info(file));\r
}\r
#pragma warning (disable : 4996) // _CRT_SECURE_NO_WARNINGS\r
#endif\r
\r
+#include "../utility/string.h"\r
+\r
#include <boost/log/detail/prologue.hpp>\r
#include <boost/log/keywords/severity.hpp>\r
#include <boost/log/sources/global_logger_storage.hpp>\r
\r
#define CASPAR_LOG_CURRENT_EXCEPTION() \\r
try\\r
- {CASPAR_LOG(error) << boost::current_exception_diagnostic_information().c_str();}\\r
+ {CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information());}\\r
catch(...){}\r
\r
void set_log_level(const std::wstring& lvl);\r
{\r
auto color2 = get_hex_color(color);\r
if(color2.length() != 9 || color2[0] != '#')\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(u8(color2)) << msg_info("Invalid color."));\r
+ BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << warg_value_info(color2) << msg_info("Invalid color."));\r
\r
core::pixel_format_desc desc;\r
desc.pix_fmt = pixel_format::bgra;\r
auto& value = *reinterpret_cast<uint32_t*>(frame->image_data().begin());\r
std::wstringstream str(color2.substr(1));\r
if(!(str >> std::hex >> value) || !str.eof())\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(u8(color2)) << msg_info("Invalid color."));\r
+ BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << warg_value_info(color2) << msg_info("Invalid color."));\r
\r
frame->commit();\r
\r
std::wstring str;\r
BOOST_FOREACH(auto& param, params)\r
str += param + L" ";\r
- BOOST_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << arg_value_info(u8(str)));\r
+ BOOST_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << warg_value_info(str));\r
}\r
\r
return producer;\r
if(!BlueVelvetVersion)\r
return L"Unknown";\r
\r
- return u16(std::string(BlueVelvetVersion()));\r
+ return u16(BlueVelvetVersion());\r
}\r
\r
std::vector<std::wstring> get_device_list()\r
\r
//Setting output Video mode\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_MODE, vid_fmt_))) \r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to set videomode."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to set videomode."));\r
\r
//Select Update Mode for output\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_UPDATE_TYPE, UPD_FMT_FRAME))) \r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to set update type."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to set update type."));\r
\r
disable_video_output();\r
\r
//Enable dual link output\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT, 1)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to enable dual link."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to enable dual link."));\r
\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE, Signal_FormatType_4224)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to set dual link format type to 4:2:2:4."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to set dual link format type to 4:2:2:4."));\r
\r
//Select output memory format\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_MEMORY_FORMAT, MEM_FMT_ARGB_PC))) \r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to set memory format."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to set memory format."));\r
\r
//Select image orientation\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_IMAGE_ORIENTATION, ImageOrientation_Normal)))\r
- CASPAR_LOG(warning) << print() << TEXT(" Failed to set image orientation to normal."); \r
+ CASPAR_LOG(warning) << print() << L" Failed to set image orientation to normal."; \r
\r
// Select data range\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_RGB_DATA_RANGE, CGR_RANGE))) \r
- CASPAR_LOG(warning) << print() << TEXT(" Failed to set RGB data range to CGR."); \r
+ CASPAR_LOG(warning) << print() << L" Failed to set RGB data range to CGR."; \r
\r
if(BLUE_FAIL(set_card_property(blue_, VIDEO_PREDEFINED_COLOR_MATRIX, vid_fmt_ == VID_FMT_PAL ? MATRIX_601_CGR : MATRIX_709_CGR)))\r
- CASPAR_LOG(warning) << print() << TEXT(" Failed to set colormatrix to ") << (vid_fmt_ == VID_FMT_PAL ? TEXT("601 CGR") : TEXT("709 CGR")) << TEXT(".");\r
+ CASPAR_LOG(warning) << print() << L" Failed to set colormatrix to " << (vid_fmt_ == VID_FMT_PAL ? L"601 CGR" : L"709 CGR") << L".";\r
\r
if(!embedded_audio_)\r
{\r
vid_fmt = videoMode; \r
}\r
if(vid_fmt == VID_FMT_INVALID)\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("video-mode not supported.") << arg_value_info(u8(format_desc.name)));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("video-mode not supported.") << warg_value_info(format_desc.name));\r
\r
return vid_fmt;\r
}\r
void enable_audio()\r
{\r
if(FAILED(output_->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, 2, bmdAudioOutputStreamTimestamped)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Could not enable audio output."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Could not enable audio output."));\r
\r
if(FAILED(output_->SetAudioCallback(this)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Could not set audio callback."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Could not set audio callback."));\r
\r
CASPAR_LOG(info) << print() << L" Enabled embedded-audio.";\r
}\r
void enable_video(BMDDisplayMode display_mode)\r
{\r
if(FAILED(output_->EnableVideoOutput(display_mode, bmdVideoOutputFlagDefault))) \r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Could not enable video output."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Could not enable video output."));\r
\r
if(FAILED(output_->SetScheduledFrameCompletionCallback(this)))\r
BOOST_THROW_EXCEPTION(caspar_exception() \r
- << msg_info(u8(print()) + " Failed to set playback completion callback.")\r
+ << wmsg_info(print() + L" Failed to set playback completion callback.")\r
<< boost::errinfo_api_function("SetScheduledFrameCompletionCallback"));\r
}\r
\r
void start_playback()\r
{\r
if(FAILED(output_->StartScheduledPlayback(0, format_desc_.time_scale, 1.0))) \r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to schedule playback."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to schedule playback."));\r
}\r
\r
STDMETHOD (QueryInterface(REFIID, LPVOID*)) {return E_NOINTERFACE;}\r
}\r
\r
if(!is_running_)\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Is not running."));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Is not running."));\r
\r
if(config_.embedded_audio)\r
audio_frame_buffer_.push(frame); \r
// NOTE: bmdFormat8BitARGB is currently not supported by any decklink card. (2011-05-08)\r
if(FAILED(input_->EnableVideoInput(display_mode, bmdFormat8BitYUV, 0))) \r
BOOST_THROW_EXCEPTION(caspar_exception() \r
- << msg_info(u8(print()) + " Could not enable video input.")\r
+ << wmsg_info(print() + L" Could not enable video input.")\r
<< boost::errinfo_api_function("EnableVideoInput"));\r
\r
if(FAILED(input_->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, format_desc_.audio_channels))) \r
BOOST_THROW_EXCEPTION(caspar_exception() \r
- << msg_info(u8(print()) + " Could not enable audio input.")\r
+ << wmsg_info(print() + L" Could not enable audio input.")\r
<< boost::errinfo_api_function("EnableAudioInput"));\r
\r
if (FAILED(input_->SetCallback(this)) != S_OK)\r
BOOST_THROW_EXCEPTION(caspar_exception() \r
- << msg_info(u8(print()) + " Failed to set input callback.")\r
+ << wmsg_info(print() + L" Failed to set input callback.")\r
<< boost::errinfo_api_function("SetCallback"));\r
\r
if(FAILED(input_->StartStreams()))\r
BOOST_THROW_EXCEPTION(caspar_exception() \r
- << msg_info(u8(print()) + " Failed to start input stream.")\r
+ << wmsg_info(print() + L" Failed to start input stream.")\r
<< boost::errinfo_api_function("StartStreams"));\r
\r
CASPAR_LOG(info) << print() << L" Successfully Initialized.";\r
\r
struct ffmpeg_consumer : boost::noncopyable\r
{ \r
- const std::string filename_;\r
+ const std::wstring filename_;\r
\r
const std::shared_ptr<AVFormatContext> oc_;\r
const core::video_format_desc format_desc_;\r
int64_t frame_number_;\r
\r
public:\r
- ffmpeg_consumer(const std::string& filename, const core::video_format_desc& format_desc, const std::string& codec, const std::string& options)\r
+ ffmpeg_consumer(const std::wstring& filename, const core::video_format_desc& format_desc, const std::wstring& codec, const std::wstring& options)\r
: filename_(filename)\r
, video_outbuf_(1920*1080*8)\r
, oc_(avformat_alloc_context(), av_free)\r
, frame_number_(0)\r
{\r
// TODO: Ask stakeholders about case where file already exists.\r
- boost::filesystem2::remove(boost::filesystem2::wpath(env::media_folder() + u16(filename))); // Delete the file if it exists\r
+ boost::filesystem2::remove(boost::filesystem2::wpath(env::media_folder() + filename)); // Delete the file if it exists\r
\r
graph_->add_guide("frame-time", 0.5);\r
graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));\r
executor_.set_capacity(8);\r
file_write_executor_.set_capacity(8);\r
\r
- oc_->oformat = av_guess_format(nullptr, filename_.c_str(), nullptr);\r
+ oc_->oformat = av_guess_format(nullptr, u8(filename_).c_str(), nullptr);\r
if (!oc_->oformat)\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Could not find suitable output format."));\r
\r
THROW_ON_ERROR2(av_set_parameters(oc_.get(), nullptr), "[ffmpeg_consumer]");\r
\r
- strcpy_s(oc_->filename, filename_.c_str());\r
+ strcpy_s(oc_->filename, u8(filename_).c_str());\r
\r
- auto video_codec = avcodec_find_encoder_by_name(codec.c_str());\r
+ auto video_codec = avcodec_find_encoder_by_name(u8(codec).c_str());\r
if(video_codec == nullptr)\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info(codec));\r
+ BOOST_THROW_EXCEPTION(invalid_argument() << warg_name_info(codec));\r
\r
// Add the audio and video streams using the default format codecs and initialize the codecs .\r
- video_st_ = add_video_stream(video_codec->id, options);\r
+ video_st_ = add_video_stream(video_codec->id, u8(options));\r
audio_st_ = add_audio_stream();\r
\r
- dump_format(oc_.get(), 0, filename_.c_str(), 1);\r
+ dump_format(oc_.get(), 0, u8(filename_).c_str(), 1);\r
\r
// Open the output ffmpeg, if needed.\r
if (!(oc_->oformat->flags & AVFMT_NOFILE)) \r
- THROW_ON_ERROR2(avio_open(&oc_->pb, filename_.c_str(), URL_WRONLY), "[ffmpeg_consumer]");\r
+ THROW_ON_ERROR2(avio_open(&oc_->pb, u8(filename_).c_str(), URL_WRONLY), "[ffmpeg_consumer]");\r
\r
THROW_ON_ERROR2(av_write_header(oc_.get()), "[ffmpeg_consumer]");\r
\r
\r
std::wstring print() const\r
{\r
- return L"ffmpeg[" + u16(filename_) + L"]";\r
+ return L"ffmpeg[" + filename_ + L"]";\r
}\r
\r
std::shared_ptr<AVStream> add_video_stream(enum CodecID codec_id, const std::string& options)\r
virtual void initialize(const core::video_format_desc& format_desc, int)\r
{\r
consumer_.reset();\r
- consumer_.reset(new ffmpeg_consumer(u8(filename_), format_desc, u8(codec_), u8(options_)));\r
+ consumer_.reset(new ffmpeg_consumer(filename_, format_desc, codec_, options_));\r
}\r
\r
virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
case AVERROR_BSF_NOT_FOUND:\r
::boost::exception_detail::throw_exception_(averror_bsf_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line); \r
case AVERROR_DECODER_NOT_FOUND:\r
::boost::exception_detail::throw_exception_(averror_decoder_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_DEMUXER_NOT_FOUND:\r
::boost::exception_detail::throw_exception_(averror_demuxer_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_ENCODER_NOT_FOUND:\r
::boost::exception_detail::throw_exception_(averror_encoder_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line); \r
case AVERROR_EOF: \r
::boost::exception_detail::throw_exception_(averror_eof()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_EXIT: \r
::boost::exception_detail::throw_exception_(averror_exit()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_FILTER_NOT_FOUND: \r
::boost::exception_detail::throw_exception_(averror_filter_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_MUXER_NOT_FOUND: \r
::boost::exception_detail::throw_exception_(averror_muxer_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_OPTION_NOT_FOUND: \r
::boost::exception_detail::throw_exception_(averror_option_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_PATCHWELCOME: \r
::boost::exception_detail::throw_exception_(averror_patchwelcome()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_PROTOCOL_NOT_FOUND: \r
::boost::exception_detail::throw_exception_(averror_protocol_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
case AVERROR_STREAM_NOT_FOUND:\r
::boost::exception_detail::throw_exception_(averror_stream_not_found()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
default:\r
::boost::exception_detail::throw_exception_(ffmpeg_error()<< \r
msg_info(av_error_str(ret)) << \r
- source_info(u8(source)) << \r
+ source_info(source) << \r
boost::errinfo_api_function(func) << \r
boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
}\r
\r
bool is_valid_file(const std::wstring filename)\r
{ \r
- auto filename2 = u8(filename);\r
-\r
std::ifstream file(filename);\r
\r
std::vector<unsigned char> buf;\r
return nullptr;\r
\r
AVProbeData pb;\r
- pb.filename = filename2.c_str();\r
+ pb.filename = u8(filename).c_str();\r
pb.buf = buf.data();\r
pb.buf_size = buf.size();\r
\r
graph_->set_color("skip-sync", diagnostics::color(0.8f, 0.3f, 0.2f)); \r
\r
if(FAILED(CComObject<caspar::flash::FlashAxContainer>::CreateInstance(&ax_)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to create FlashAxContainer"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to create FlashAxContainer"));\r
\r
ax_->set_print([this]{return L"flash_renderer";});\r
\r
if(FAILED(ax_->CreateAxControl()))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to Create FlashAxControl"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to Create FlashAxControl"));\r
\r
CComPtr<IShockwaveFlash> spFlash;\r
if(FAILED(ax_->QueryControl(&spFlash)))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to Query FlashAxControl"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to Query FlashAxControl"));\r
\r
if(FAILED(spFlash->put_Playing(true)) )\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to start playing Flash"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to start playing Flash"));\r
\r
if(FAILED(spFlash->put_Movie(CComBSTR(filename.c_str()))))\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to Load Template Host"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to Load Template Host"));\r
\r
if(FAILED(spFlash->put_ScaleMode(2))) //Exact fit. Scale without respect to the aspect ratio.\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " Failed to Set Scale Mode"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << wmsg_info(print() + L" Failed to Set Scale Mode"));\r
\r
ax_->SetSize(width_, height_); \r
\r
std::wstring result;\r
\r
if(!ax_->FlashCall(param, result))\r
- CASPAR_LOG(warning) << print() << L" Flash call failed:" << param;//BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info(u8(param)));\r
+ CASPAR_LOG(warning) << print() << L" Flash call failed:" << param;//BOOST_THROW_EXCEPTION(invalid_operation() << wmsg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info(u8(param)));\r
graph_->add_tag("param");\r
\r
return result;\r
, context_(L"flash_producer")\r
{ \r
if(!boost::filesystem::exists(filename))\r
- BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(u8(filename))); \r
+ BOOST_THROW_EXCEPTION(file_not_found() << werr_file_name_info(filename)); \r
\r
fps_ = 0;\r
\r
\r
graph_->set_value("output-buffer-count", static_cast<float>(frame_buffer_.size())/static_cast<float>(frame_buffer_.capacity())); \r
fps_.fetch_and_store(static_cast<int>(context_->fps()*100.0)); \r
- graph_->set_text(u8(print()));\r
+ graph_->set_text(print());\r
\r
render(renderer);\r
}\r
\r
std::wstring get_version()\r
{\r
- return u16(std::string(FreeImage_GetVersion()));\r
+ return u16(FreeImage_GetVersion());\r
}\r
\r
}}
\ No newline at end of file
displayDevices.push_back(d_device);\r
\r
if(config_.screen_index >= displayDevices.size())\r
- BOOST_THROW_EXCEPTION(out_of_range() << arg_name_info("screen_index_") << msg_info(u8(print())));\r
+ BOOST_THROW_EXCEPTION(out_of_range() << arg_name_info("screen_index_") << wmsg_info(print()));\r
\r
DEVMODE devmode = {};\r
if(!EnumDisplaySettings(displayDevices[config_.screen_index].DeviceName, ENUM_CURRENT_SETTINGS, &devmode))\r
- BOOST_THROW_EXCEPTION(invalid_operation() << arg_name_info("screen_index") << msg_info(u8(print()) + " EnumDisplaySettings"));\r
+ BOOST_THROW_EXCEPTION(invalid_operation() << arg_name_info("screen_index") << wmsg_info(print() + L" EnumDisplaySettings"));\r
\r
screen_x_ = devmode.dmPosition.x;\r
screen_y_ = devmode.dmPosition.y;\r
_parameters[0] = _parameters[0];\r
auto pFP = create_producer(GetChannel()->mixer(), _parameters);\r
if(pFP == frame_producer::empty())\r
- BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? u8(_parameters[0]) : ""));\r
+ BOOST_THROW_EXCEPTION(file_not_found() << wmsg_info(_parameters.size() > 0 ? _parameters[0] : L""));\r
\r
bool auto_play = std::find(_parameters.begin(), _parameters.end(), L"AUTO") != _parameters.end();\r
\r
using boost::property_tree::wptree;\r
BOOST_FOREACH(auto& xml_channel, pt.get_child(L"configuration.channels"))\r
{ \r
- auto format_desc = video_format_desc::get(u16(xml_channel.second.get(L"video-mode", L"PAL"))); \r
+ auto format_desc = video_format_desc::get(xml_channel.second.get(L"video-mode", L"PAL")); \r
if(format_desc.format == video_format::invalid)\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode."));\r
\r
else if(name == L"system-audio")\r
channels_.back()->output()->add(oal::create_consumer()); \r
else if(name != L"<xmlcomment>")\r
- CASPAR_LOG(warning) << "Invalid consumer: " << u16(name); \r
+ CASPAR_LOG(warning) << "Invalid consumer: " << name; \r
}\r
catch(...)\r
{\r
async_servers_.push_back(asyncbootstrapper);\r
}\r
else\r
- CASPAR_LOG(warning) << "Invalid controller: " << u16(name); \r
+ CASPAR_LOG(warning) << "Invalid controller: " << name; \r
}\r
catch(...)\r
{\r
else if(boost::iequals(name, L"CLOCK"))\r
return make_safe<CLK::CLKProtocolStrategy>(channels_);\r
\r
- BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info("name") << arg_value_info(u8(name)) << msg_info("Invalid protocol"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << warg_name_info(L"name") << warg_value_info(name) << wmsg_info(L"Invalid protocol"));\r
}\r
};\r
\r