#pragma warning(disable: 4146)
-extern "C"
+extern "C"
{
#include <libavutil/error.h>
}
namespace caspar { namespace ffmpeg {
-
+
std::string av_error_str(int errn)
{
char buf[256];
switch(ret)
{
case AVERROR_BSF_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_bsf_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ averror_bsf_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
case AVERROR_DECODER_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_decoder_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ averror_decoder_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
case AVERROR_DEMUXER_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_demuxer_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ averror_demuxer_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
case AVERROR_ENCODER_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_encoder_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_EOF:
- ::boost::exception_detail::throw_exception_(averror_eof()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_EXIT:
- ::boost::exception_detail::throw_exception_(averror_exit()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_FILTER_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_filter_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_MUXER_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_muxer_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_OPTION_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_option_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_PATCHWELCOME:
- ::boost::exception_detail::throw_exception_(averror_patchwelcome()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
- case AVERROR_PROTOCOL_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_protocol_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ averror_encoder_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_EOF:
+ ::boost::exception_detail::throw_exception_(
+ averror_eof()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_EXIT:
+ ::boost::exception_detail::throw_exception_(
+ averror_exit()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_FILTER_NOT_FOUND:
+ ::boost::exception_detail::throw_exception_(
+ averror_filter_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_MUXER_NOT_FOUND:
+ ::boost::exception_detail::throw_exception_(
+ averror_muxer_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_OPTION_NOT_FOUND:
+ ::boost::exception_detail::throw_exception_(
+ averror_option_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_PATCHWELCOME:
+ ::boost::exception_detail::throw_exception_(
+ averror_patchwelcome()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
+ case AVERROR_PROTOCOL_NOT_FOUND:
+ ::boost::exception_detail::throw_exception_(
+ averror_protocol_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
case AVERROR_STREAM_NOT_FOUND:
- ::boost::exception_detail::throw_exception_(averror_stream_not_found()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ averror_stream_not_found()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
default:
- ::boost::exception_detail::throw_exception_(ffmpeg_error()<<
- msg_info(av_error_str(ret)) <<
- source_info(source) <<
- boost::errinfo_api_function(func) <<
- boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);
+ ::boost::exception_detail::throw_exception_(
+ ffmpeg_error()
+ << msg_info(av_error_str(ret))
+ << source_info(source)
+ << boost::errinfo_api_function(func)
+ << boost::errinfo_errno(AVUNERROR(ret))
+ << call_stack_info(caspar::get_call_stack())
+ << context_info(get_context()),
+ local_func, file, line);
}
}
throw_on_ffmpeg_error(ret, u8(source).c_str(), func, local_func, file, line);
}
-}}
\ No newline at end of file
+}}