diff --git a/source/encoders/ffmpeg-encoder.hpp b/source/encoders/ffmpeg-encoder.hpp index 5a65f51e..a6b9c166 100644 --- a/source/encoders/ffmpeg-encoder.hpp +++ b/source/encoders/ffmpeg-encoder.hpp @@ -35,13 +35,17 @@ #include "handlers/handler.hpp" extern "C" { -#include -#include +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include #include +#include +#include +#ifdef _MSC_VER #pragma warning(pop) +#endif } namespace encoder::ffmpeg { diff --git a/source/encoders/handlers/handler.hpp b/source/encoders/handlers/handler.hpp index 4f845093..cfa12963 100644 --- a/source/encoders/handlers/handler.hpp +++ b/source/encoders/handlers/handler.hpp @@ -31,7 +31,7 @@ extern "C" { #include #include #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) #include #pragma warning(pop) } diff --git a/source/encoders/handlers/nvenc_h264_handler.cpp b/source/encoders/handlers/nvenc_h264_handler.cpp index 5c2e3141..47001785 100644 --- a/source/encoders/handlers/nvenc_h264_handler.cpp +++ b/source/encoders/handlers/nvenc_h264_handler.cpp @@ -29,11 +29,15 @@ #include "utility.hpp" extern "C" { -#include +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include +#include +#ifdef _MSC_VER #pragma warning(pop) +#endif } #define KEY_PROFILE "H264.Profile" diff --git a/source/encoders/handlers/nvenc_hevc_handler.cpp b/source/encoders/handlers/nvenc_hevc_handler.cpp index bf07a42d..b5d53522 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.cpp +++ b/source/encoders/handlers/nvenc_hevc_handler.cpp @@ -31,7 +31,7 @@ extern "C" { #include #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) #include #pragma warning(pop) } diff --git a/source/encoders/handlers/nvenc_shared.cpp b/source/encoders/handlers/nvenc_shared.cpp index b0c4fcdf..1f19e7f4 100644 --- a/source/encoders/handlers/nvenc_shared.cpp +++ b/source/encoders/handlers/nvenc_shared.cpp @@ -366,9 +366,9 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec) { obs_properties_t* grp = props; if (!util::are_property_groups_broken()) { - grp = obs_properties_create(); - auto p = obs_properties_add_group(props, ST_RATECONTROL_QUALITY, D_TRANSLATE(ST_RATECONTROL_QUALITY), - OBS_GROUP_NORMAL, grp); + grp = obs_properties_create(); + obs_properties_add_group(props, ST_RATECONTROL_QUALITY, D_TRANSLATE(ST_RATECONTROL_QUALITY), + OBS_GROUP_NORMAL, grp); } { @@ -392,9 +392,8 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec) { obs_properties_t* grp = props; if (!util::are_property_groups_broken()) { - grp = obs_properties_create(); - auto p = obs_properties_add_group(props, ST_RATECONTROL_QP, D_TRANSLATE(ST_RATECONTROL_QP), - OBS_GROUP_NORMAL, grp); + grp = obs_properties_create(); + obs_properties_add_group(props, ST_RATECONTROL_QP, D_TRANSLATE(ST_RATECONTROL_QP), OBS_GROUP_NORMAL, grp); } { diff --git a/source/encoders/handlers/nvenc_shared.hpp b/source/encoders/handlers/nvenc_shared.hpp index 584be8bf..19c7a773 100644 --- a/source/encoders/handlers/nvenc_shared.hpp +++ b/source/encoders/handlers/nvenc_shared.hpp @@ -26,11 +26,15 @@ #include "utility.hpp" extern "C" { -#include +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include +#include +#ifdef _MSC_VER #pragma warning(pop) +#endif } /* NVENC has multiple compression modes: diff --git a/source/ffmpeg/avframe-queue.hpp b/source/ffmpeg/avframe-queue.hpp index dec6ce8c..f3995267 100644 --- a/source/ffmpeg/avframe-queue.hpp +++ b/source/ffmpeg/avframe-queue.hpp @@ -24,10 +24,14 @@ #include extern "C" { +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include +#ifdef _MSC_VER #pragma warning(pop) +#endif } namespace ffmpeg { diff --git a/source/ffmpeg/hwapi/base.hpp b/source/ffmpeg/hwapi/base.hpp index 182fcc0e..6ca7f990 100644 --- a/source/ffmpeg/hwapi/base.hpp +++ b/source/ffmpeg/hwapi/base.hpp @@ -28,11 +28,15 @@ #include extern "C" { +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include #include +#ifdef _MSC_VER #pragma warning(pop) +#endif } namespace ffmpeg::hwapi { diff --git a/source/ffmpeg/swscale.hpp b/source/ffmpeg/swscale.hpp index 5796a783..68424845 100644 --- a/source/ffmpeg/swscale.hpp +++ b/source/ffmpeg/swscale.hpp @@ -24,11 +24,15 @@ #include extern "C" { +#ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable : 4244) +#pragma warning(disable : 4242 4244 4365) +#endif #include #include +#ifdef _MSC_VER #pragma warning(pop) +#endif } namespace ffmpeg { diff --git a/source/ffmpeg/tools.cpp b/source/ffmpeg/tools.cpp index d08a66a9..588eede3 100644 --- a/source/ffmpeg/tools.cpp +++ b/source/ffmpeg/tools.cpp @@ -177,6 +177,8 @@ AVColorSpace tools::obs_videocolorspace_to_avcolorspace(video_colorspace v) return AVCOL_SPC_BT709; case VIDEO_CS_601: return AVCOL_SPC_BT470BG; + case VIDEO_CS_SRGB: + return AVCOL_SPC_RGB; } throw std::invalid_argument("unknown color space"); } @@ -251,6 +253,7 @@ void tools::setup_obs_color(video_colorspace colorspace, video_range_type range, {VIDEO_CS_DEFAULT, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}}, {VIDEO_CS_601, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}}, {VIDEO_CS_709, {AVCOL_SPC_BT709, AVCOL_PRI_BT709, AVCOL_TRC_BT709}}, + {VIDEO_CS_SRGB, {AVCOL_SPC_RGB, AVCOL_PRI_BT709, AVCOL_TRC_BT709}}, }; std::map colorranges = { {VIDEO_RANGE_DEFAULT, AVCOL_RANGE_MPEG}, diff --git a/source/ffmpeg/tools.hpp b/source/ffmpeg/tools.hpp index ff30021f..143f5e53 100644 --- a/source/ffmpeg/tools.hpp +++ b/source/ffmpeg/tools.hpp @@ -26,8 +26,15 @@ #include extern "C" { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4242 4244 4365) +#endif #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif } namespace ffmpeg::tools { diff --git a/source/plugin.cpp b/source/plugin.cpp index 59634c81..782d89fc 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -19,10 +19,11 @@ #include "plugin.hpp" #include - #include "obs/obs-source-tracker.hpp" +#ifdef ENABLE_ENCODER_FFMPEG #include "encoders/ffmpeg-encoder.hpp" +#endif #ifdef ENABLE_FILTER_BLUR #include "filters/filter-blur.hpp" @@ -45,12 +46,14 @@ #ifdef ENABLE_FILTER_TRANSFORM #include "filters/filter-transform.hpp" #endif + #ifdef ENABLE_SOURCE_MIRROR #include "sources/source-mirror.hpp" #endif #ifdef ENABLE_SOURCE_SHADER #include "sources/source-shader.hpp" #endif + #ifdef ENABLE_TRANSITION_SHADER //#include "transitions/source-shader.hpp" #endif @@ -169,7 +172,7 @@ try { #ifdef _WIN32 // Windows Only extern "C" { -#include +#include } BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)