]> git.sesse.net Git - casparcg/commitdiff
* Fixed compilation problems
authorHelge Norberg <helge.norberg@svt.se>
Tue, 23 Jun 2015 12:03:15 +0000 (14:03 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Tue, 23 Jun 2015 12:03:15 +0000 (14:03 +0200)
common/scope_exit.h
modules/ffmpeg/CMakeLists.txt
modules/ffmpeg/consumer/streaming_consumer.cpp
modules/ffmpeg/util/error.cpp [deleted file]
modules/ffmpeg/util/error.h [deleted file]
shell/CMakeLists.txt

index 7509660712206c7eea87f02ed2e54c18ebd0e5b2..39dc0f3e8f4c6c5bee46b2bc6b8ceae516337794 100644 (file)
@@ -23,7 +23,7 @@ namespace detail
                }
                
                scope_exit(scope_exit&& other)
-                       : func_(std::move(other.v))
+                       : func_(std::move(other.func_))
                        , valid_(std::move(other.valid_))
                {
                        other.valid_ = false;
index 52f374502ba68e13151040cf638b3925afeeefec..4cce0bbe0b055e8fcd5f212a12e920075075eaf9 100644 (file)
@@ -21,8 +21,6 @@ set(SOURCES
                producer/ffmpeg_producer.cpp
                producer/tbb_avcodec.cpp
 
-               util/error.cpp
-
                ffmpeg.cpp
                ffmpeg_error.cpp
                StdAfx.cpp
@@ -48,8 +46,6 @@ set(HEADERS
                producer/ffmpeg_producer.h
                producer/tbb_avcodec.h
 
-               util/error.h
-
                ffmpeg.h
                ffmpeg_error.h
                StdAfx.h
index 359bab604349429094c19b933224e9ff608cb880..77543a10fa32f7d0804a7dd708dfd2ff54c1b823 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "ffmpeg_consumer.h"
 
-#include "../util/error.h"
+#include "../ffmpeg_error.h"
 
 #include <common/except.h>
 #include <common/executor.h>
diff --git a/modules/ffmpeg/util/error.cpp b/modules/ffmpeg/util/error.cpp
deleted file mode 100644 (file)
index 1327626..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-* Copyright (c) 2012 Robert Nagy <ronag89@gmail.com>
-*
-* This file is part of CasparCG (www.casparcg.com).
-*
-* CasparCG is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* CasparCG is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
-*
-* Author: Robert Nagy, ronag89@gmail.com
-*/
-#include "../StdAfx.h"
-
-#include "error.h"
-
-#include <common/utf.h>
-
-#pragma warning(disable: 4146)
-
-#pragma warning(push)
-#pragma warning(disable: 4244)
-
-extern "C" 
-{
-       #include <libavutil/common.h>
-       #include <libavutil/error.h>
-}
-
-#pragma warning(pop)
-
-namespace caspar { namespace ffmpeg {
-       
-std::string av_error_str(int errn)
-{
-       char buf[256];
-       memset(buf, 0, 256);
-       if(av_strerror(errn, buf, 256) < 0)
-               return "";
-       return std::string(buf);
-}
-
-void throw_on_ffmpeg_error(int ret, const char* source, const char* func, const char* local_func, const char* file, int line)
-{
-       if(ret >= 0)
-               return;
-
-       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);  
-       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);
-       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);
-       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);
-       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);
-       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);
-       }
-}
-
-void throw_on_ffmpeg_error(int ret, const std::wstring& source, const char* func, const char* local_func, const char* file, int line)
-{
-       throw_on_ffmpeg_error(ret, u8(source).c_str(), func, local_func, file, line);
-}
-
-}}
\ No newline at end of file
diff --git a/modules/ffmpeg/util/error.h b/modules/ffmpeg/util/error.h
deleted file mode 100644 (file)
index d432c82..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2012 Robert Nagy <ronag89@gmail.com>
-*
-* This file is part of CasparCG (www.casparcg.com).
-*
-* CasparCG is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* CasparCG is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
-*
-* Author: Robert Nagy, ronag89@gmail.com
-*/
-#pragma once
-
-#include <common/except.h>
-
-#include <cstdint>
-#include <string>
-
-namespace caspar { namespace ffmpeg {
-
-struct ffmpeg_error : virtual caspar_exception{};
-struct averror_bsf_not_found : virtual ffmpeg_error{};
-struct averror_decoder_not_found : virtual ffmpeg_error{};
-struct averror_demuxer_not_found : virtual ffmpeg_error{};
-struct averror_encoder_not_found : virtual ffmpeg_error{};
-struct averror_eof : virtual ffmpeg_error{};
-struct averror_exit : virtual ffmpeg_error{};
-struct averror_filter_not_found : virtual ffmpeg_error{};
-struct averror_muxer_not_found : virtual ffmpeg_error{};
-struct averror_option_not_found : virtual ffmpeg_error{};
-struct averror_patchwelcome : virtual ffmpeg_error{};
-struct averror_protocol_not_found : virtual ffmpeg_error{};
-struct averror_stream_not_found : virtual ffmpeg_error{};
-
-std::string av_error_str(int errn);
-
-void throw_on_ffmpeg_error(int ret, const char* source, const char* func, const char* local_func, const char* file, int line);
-void throw_on_ffmpeg_error(int ret, const std::wstring& source, const char* func, const char* local_func, const char* file, int line);
-
-
-//#define THROW_ON_ERROR(ret, source, func) throw_on_ffmpeg_error(ret, source, __FUNC__, __FILE__, __LINE__)
-
-#define THROW_ON_ERROR_STR_(call) #call
-#define THROW_ON_ERROR_STR(call) THROW_ON_ERROR_STR_(call)
-
-#define FF_RET(ret, func) \
-               caspar::ffmpeg::throw_on_ffmpeg_error(ret, L"", func, __FUNCTION__, __FILE__, __LINE__);                
-
-#define FF(call)                                                                               \
-       [&]() -> int                                                                                                            \
-       {                                                                                                                                               \
-               auto ret = call;                                                                                                                \
-               caspar::ffmpeg::throw_on_ffmpeg_error(static_cast<int>(ret), L"", THROW_ON_ERROR_STR(call), __FUNCTION__, __FILE__, __LINE__);  \
-               return ret;                                                                                                                     \
-       }()
-
-#define LOG_ON_ERROR2(call)                                                                                    \
-       [&]() -> std::int64_t                                                                                                                   \
-       {                                       \
-               auto ret = -1;\
-               try{                                                                                                                            \
-               ret = static_cast<int>(call);                                                                                                                   \
-               caspar::ffmpeg::throw_on_ffmpeg_error(ret, L"", THROW_ON_ERROR_STR(call), __FUNCTION__, __FILE__, __LINE__);    \
-               return ret;                                                                                                                     \
-               }catch(...){CASPAR_LOG_CURRENT_EXCEPTION();}                                            \
-               return ret;                                                                                                                     \
-       }()
-
-}}
index ecd77f976e9a425d8f157a6e6e9eebb14a96ad89..4e31749b32b07c60b89f7251016e481a429cf9fa 100644 (file)
@@ -20,6 +20,7 @@ elseif (CMAKE_COMPILER_IS_GNUCXX)
 endif ()
 set(SOURCES
                casparcg.config
+               included_modules.tmpl
                main.cpp
                server.cpp
                stdafx.cpp