From 85c108068399b0868077838a92e5cef786ea160e Mon Sep 17 00:00:00 2001 From: correa Date: Sat, 29 Feb 2020 23:07:47 -0300 Subject: [PATCH 1/3] Wrap Visual Studio specific include into #ifdef crtdbg.h is a Visual Studio specific include file and isn't available on other compilers. --- source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h b/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h index 76cad06..00193b9 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h @@ -1,8 +1,12 @@ #pragma once -#define _CRTDBG_MAP_ALLOC -#include +#ifdef _WIN32 +#define _CRTDBG_MAP_ALLOC #include +#endif + +#include + extern "C" { #include @@ -16,4 +20,4 @@ extern "C" { #include #include #include -} \ No newline at end of file +} From 4a88d589cd625ee4c114df52e896d5f284f90666 Mon Sep 17 00:00:00 2001 From: "Thiago A. Correa" Date: Sat, 29 Feb 2020 23:23:33 -0300 Subject: [PATCH 2/3] Fix build on macOS, standard C++11 doesn't have an exception constructor with arguments --- source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp | 7 +++---- source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp index 660aa8b..4ec4f91 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp +++ b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp @@ -4,14 +4,13 @@ using namespace std; namespace ffmpegcpp { - FFmpegException::FFmpegException(string error) : exception(error.c_str()) + FFmpegException::FFmpegException(string error) : errormsg( error ) { } FFmpegException::FFmpegException(string error, int returnValue) - : exception( - (error + ": " + av_make_error_string(this->error, AV_ERROR_MAX_STRING_SIZE, returnValue)).c_str() - ) { + char av_error[AV_ERROR_MAX_STRING_SIZE]; + errormsg = error + ": " + av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, returnValue); } } \ No newline at end of file diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h index d3da0dd..35d1ac7 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h @@ -15,14 +15,13 @@ namespace ffmpegcpp FFmpegException(std::string error, int returnValue); - virtual char const* what() const + virtual char const* what() const noexcept { - return std::exception::what(); + return errormsg.c_str(); } private: - - char error[AV_ERROR_MAX_STRING_SIZE]; + std::string errormsg; }; } \ No newline at end of file From 3a1ca97fceec73531d4d153aaee104e46d4bf096 Mon Sep 17 00:00:00 2001 From: "Thiago A. Correa" Date: Sat, 29 Feb 2020 23:31:25 -0300 Subject: [PATCH 3/3] Fix include filename on *nix --- source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h b/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h index 483ff7e..e4ec466 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h @@ -2,7 +2,7 @@ #include "ffmpeg.h" #include "FrameWriter.h" -#include "Demuxing/Streamdata.h" +#include "Demuxing/StreamData.h" namespace ffmpegcpp {