mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
ffmpeg-encoder: Various warning fixes and cleanup
Also don't include it from plugin.cpp if it's not enabled.
This commit is contained in:
parent
ff3c2e8c66
commit
4f7c1cb35e
12 changed files with 56 additions and 20 deletions
|
@ -35,13 +35,17 @@
|
||||||
#include "handlers/handler.hpp"
|
#include "handlers/handler.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <obs-properties.h>
|
#ifdef _MSC_VER
|
||||||
#include <obs.h>
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#include <libavutil/frame.h>
|
#include <libavutil/frame.h>
|
||||||
|
#include <obs-properties.h>
|
||||||
|
#include <obs.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace encoder::ffmpeg {
|
namespace encoder::ffmpeg {
|
||||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
||||||
#include <obs-encoder.h>
|
#include <obs-encoder.h>
|
||||||
#include <obs-properties.h>
|
#include <obs-properties.h>
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,15 @@
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <obs-module.h>
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavutil/opt.h>
|
#include <libavutil/opt.h>
|
||||||
|
#include <obs-module.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define KEY_PROFILE "H264.Profile"
|
#define KEY_PROFILE "H264.Profile"
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <obs-module.h>
|
#include <obs-module.h>
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
#include <libavutil/opt.h>
|
#include <libavutil/opt.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
}
|
}
|
||||||
|
|
|
@ -366,9 +366,9 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec)
|
||||||
{
|
{
|
||||||
obs_properties_t* grp = props;
|
obs_properties_t* grp = props;
|
||||||
if (!util::are_property_groups_broken()) {
|
if (!util::are_property_groups_broken()) {
|
||||||
grp = obs_properties_create();
|
grp = obs_properties_create();
|
||||||
auto p = obs_properties_add_group(props, ST_RATECONTROL_QUALITY, D_TRANSLATE(ST_RATECONTROL_QUALITY),
|
obs_properties_add_group(props, ST_RATECONTROL_QUALITY, D_TRANSLATE(ST_RATECONTROL_QUALITY),
|
||||||
OBS_GROUP_NORMAL, grp);
|
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;
|
obs_properties_t* grp = props;
|
||||||
if (!util::are_property_groups_broken()) {
|
if (!util::are_property_groups_broken()) {
|
||||||
grp = obs_properties_create();
|
grp = obs_properties_create();
|
||||||
auto p = obs_properties_add_group(props, ST_RATECONTROL_QP, D_TRANSLATE(ST_RATECONTROL_QP),
|
obs_properties_add_group(props, ST_RATECONTROL_QP, D_TRANSLATE(ST_RATECONTROL_QP), OBS_GROUP_NORMAL, grp);
|
||||||
OBS_GROUP_NORMAL, grp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,11 +26,15 @@
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <obs-properties.h>
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
|
#include <obs-properties.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NVENC has multiple compression modes:
|
/* NVENC has multiple compression modes:
|
||||||
|
|
|
@ -24,10 +24,14 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavutil/frame.h>
|
#include <libavutil/frame.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ffmpeg {
|
namespace ffmpeg {
|
||||||
|
|
|
@ -28,11 +28,15 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavutil/frame.h>
|
#include <libavutil/frame.h>
|
||||||
#include <libavutil/hwcontext.h>
|
#include <libavutil/hwcontext.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ffmpeg::hwapi {
|
namespace ffmpeg::hwapi {
|
||||||
|
|
|
@ -24,11 +24,15 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavutil/pixfmt.h>
|
#include <libavutil/pixfmt.h>
|
||||||
#include <libswscale/swscale.h>
|
#include <libswscale/swscale.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ffmpeg {
|
namespace ffmpeg {
|
||||||
|
|
|
@ -177,6 +177,8 @@ AVColorSpace tools::obs_videocolorspace_to_avcolorspace(video_colorspace v)
|
||||||
return AVCOL_SPC_BT709;
|
return AVCOL_SPC_BT709;
|
||||||
case VIDEO_CS_601:
|
case VIDEO_CS_601:
|
||||||
return AVCOL_SPC_BT470BG;
|
return AVCOL_SPC_BT470BG;
|
||||||
|
case VIDEO_CS_SRGB:
|
||||||
|
return AVCOL_SPC_RGB;
|
||||||
}
|
}
|
||||||
throw std::invalid_argument("unknown color space");
|
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_DEFAULT, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}},
|
||||||
{VIDEO_CS_601, {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_709, {AVCOL_SPC_BT709, AVCOL_PRI_BT709, AVCOL_TRC_BT709}},
|
||||||
|
{VIDEO_CS_SRGB, {AVCOL_SPC_RGB, AVCOL_PRI_BT709, AVCOL_TRC_BT709}},
|
||||||
};
|
};
|
||||||
std::map<video_range_type, AVColorRange> colorranges = {
|
std::map<video_range_type, AVColorRange> colorranges = {
|
||||||
{VIDEO_RANGE_DEFAULT, AVCOL_RANGE_MPEG},
|
{VIDEO_RANGE_DEFAULT, AVCOL_RANGE_MPEG},
|
||||||
|
|
|
@ -26,8 +26,15 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4242 4244 4365)
|
||||||
|
#endif
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#include <libavutil/pixfmt.h>
|
#include <libavutil/pixfmt.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ffmpeg::tools {
|
namespace ffmpeg::tools {
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
|
|
||||||
#include "plugin.hpp"
|
#include "plugin.hpp"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "obs/obs-source-tracker.hpp"
|
#include "obs/obs-source-tracker.hpp"
|
||||||
|
|
||||||
|
#ifdef ENABLE_ENCODER_FFMPEG
|
||||||
#include "encoders/ffmpeg-encoder.hpp"
|
#include "encoders/ffmpeg-encoder.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FILTER_BLUR
|
#ifdef ENABLE_FILTER_BLUR
|
||||||
#include "filters/filter-blur.hpp"
|
#include "filters/filter-blur.hpp"
|
||||||
|
@ -45,12 +46,14 @@
|
||||||
#ifdef ENABLE_FILTER_TRANSFORM
|
#ifdef ENABLE_FILTER_TRANSFORM
|
||||||
#include "filters/filter-transform.hpp"
|
#include "filters/filter-transform.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_SOURCE_MIRROR
|
#ifdef ENABLE_SOURCE_MIRROR
|
||||||
#include "sources/source-mirror.hpp"
|
#include "sources/source-mirror.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_SOURCE_SHADER
|
#ifdef ENABLE_SOURCE_SHADER
|
||||||
#include "sources/source-shader.hpp"
|
#include "sources/source-shader.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_TRANSITION_SHADER
|
#ifdef ENABLE_TRANSITION_SHADER
|
||||||
//#include "transitions/source-shader.hpp"
|
//#include "transitions/source-shader.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
@ -169,7 +172,7 @@ try {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Windows Only
|
// Windows Only
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <windows.h>
|
#include <Windows.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
|
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
|
||||||
|
|
Loading…
Reference in a new issue