diff --git a/source/encoders/codecs/h264.hpp b/source/encoders/codecs/h264.hpp index 5fa649b4..0d85810a 100644 --- a/source/encoders/codecs/h264.hpp +++ b/source/encoders/codecs/h264.hpp @@ -23,9 +23,9 @@ #include "common.hpp" // Codec: H264 -#define P_H264 "Codec.H264" -#define P_H264_PROFILE "Codec.H264.Profile" -#define P_H264_LEVEL "Codec.H264.Level" +#define S_CODEC_H264 "Codec.H264" +#define S_CODEC_H264_PROFILE "Codec.H264.Profile" +#define S_CODEC_H264_LEVEL "Codec.H264.Level" namespace streamfx::encoder::codec::h264 { enum class profile { diff --git a/source/encoders/codecs/hevc.hpp b/source/encoders/codecs/hevc.hpp index 6fa8a0c9..6557c8c4 100644 --- a/source/encoders/codecs/hevc.hpp +++ b/source/encoders/codecs/hevc.hpp @@ -23,10 +23,10 @@ #include "common.hpp" // Codec: HEVC -#define P_HEVC "Codec.HEVC" -#define P_HEVC_PROFILE "Codec.HEVC.Profile" -#define P_HEVC_TIER "Codec.HEVC.Tier" -#define P_HEVC_LEVEL "Codec.HEVC.Level" +#define S_CODEC_HEVC "Codec.HEVC" +#define S_CODEC_HEVC_PROFILE "Codec.HEVC.Profile" +#define S_CODEC_HEVC_TIER "Codec.HEVC.Tier" +#define S_CODEC_HEVC_LEVEL "Codec.HEVC.Level" namespace streamfx::encoder::codec::hevc { enum class profile { diff --git a/source/encoders/codecs/prores.hpp b/source/encoders/codecs/prores.hpp index 85681c62..aeaf2cf1 100644 --- a/source/encoders/codecs/prores.hpp +++ b/source/encoders/codecs/prores.hpp @@ -23,14 +23,14 @@ #include "common.hpp" // Codec: ProRes -#define P_PRORES "Codec.ProRes" -#define P_PRORES_PROFILE "Codec.ProRes.Profile" -#define P_PRORES_PROFILE_APCS "Codec.ProRes.Profile.APCS" -#define P_PRORES_PROFILE_APCO "Codec.ProRes.Profile.APCO" -#define P_PRORES_PROFILE_APCN "Codec.ProRes.Profile.APCN" -#define P_PRORES_PROFILE_APCH "Codec.ProRes.Profile.APCH" -#define P_PRORES_PROFILE_AP4H "Codec.ProRes.Profile.AP4H" -#define P_PRORES_PROFILE_AP4X "Codec.ProRes.Profile.AP4X" +#define S_CODEC_PRORES "Codec.ProRes" +#define S_CODEC_PRORES_PROFILE "Codec.ProRes.Profile" +#define S_CODEC_PRORES_PROFILE_APCS "Codec.ProRes.Profile.APCS" +#define S_CODEC_PRORES_PROFILE_APCO "Codec.ProRes.Profile.APCO" +#define S_CODEC_PRORES_PROFILE_APCN "Codec.ProRes.Profile.APCN" +#define S_CODEC_PRORES_PROFILE_APCH "Codec.ProRes.Profile.APCH" +#define S_CODEC_PRORES_PROFILE_AP4H "Codec.ProRes.Profile.AP4H" +#define S_CODEC_PRORES_PROFILE_AP4X "Codec.ProRes.Profile.AP4X" namespace streamfx::encoder::codec::prores { enum class profile : int32_t { diff --git a/source/encoders/handlers/amf_h264_handler.cpp b/source/encoders/handlers/amf_h264_handler.cpp index be27470c..93d5c11b 100644 --- a/source/encoders/handlers/amf_h264_handler.cpp +++ b/source/encoders/handlers/amf_h264_handler.cpp @@ -143,19 +143,19 @@ void amf_h264_handler::get_encoder_properties(obs_properties_t* props, const AVC { obs_properties_t* grp = obs_properties_create(); - obs_properties_add_group(props, P_H264, D_TRANSLATE(P_H264), OBS_GROUP_NORMAL, grp); + obs_properties_add_group(props, S_CODEC_H264, D_TRANSLATE(S_CODEC_H264), OBS_GROUP_NORMAL, grp); { - auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(P_H264_PROFILE), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); + auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(S_CODEC_H264_PROFILE), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(profile::UNKNOWN)); for (auto const kv : profiles) { - std::string trans = std::string(P_H264_PROFILE) + "." + kv.second; + std::string trans = std::string(S_CODEC_H264_PROFILE) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(P_H264_LEVEL), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(S_CODEC_H264_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_AUTOMATIC), static_cast(level::UNKNOWN)); for (auto const kv : levels) { diff --git a/source/encoders/handlers/amf_hevc_handler.cpp b/source/encoders/handlers/amf_hevc_handler.cpp index bbcac831..d925bca9 100644 --- a/source/encoders/handlers/amf_hevc_handler.cpp +++ b/source/encoders/handlers/amf_hevc_handler.cpp @@ -152,28 +152,28 @@ void amf_hevc_handler::get_encoder_properties(obs_properties_t* props, const AVC { obs_properties_t* grp = obs_properties_create(); - obs_properties_add_group(props, P_HEVC, D_TRANSLATE(P_HEVC), OBS_GROUP_NORMAL, grp); + obs_properties_add_group(props, S_CODEC_HEVC, D_TRANSLATE(S_CODEC_HEVC), OBS_GROUP_NORMAL, grp); { - auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(P_HEVC_PROFILE), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); + auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(S_CODEC_HEVC_PROFILE), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(profile::UNKNOWN)); for (auto const kv : profiles) { - std::string trans = std::string(P_HEVC_PROFILE) + "." + kv.second; + std::string trans = std::string(S_CODEC_HEVC_PROFILE) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, ST_KEY_TIER, D_TRANSLATE(P_HEVC_TIER), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_TIER, D_TRANSLATE(S_CODEC_HEVC_TIER), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(tier::UNKNOWN)); for (auto const kv : tiers) { - std::string trans = std::string(P_HEVC_TIER) + "." + kv.second; + std::string trans = std::string(S_CODEC_HEVC_TIER) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(P_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(S_CODEC_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_AUTOMATIC), static_cast(level::UNKNOWN)); for (auto const kv : levels) { diff --git a/source/encoders/handlers/nvenc_h264_handler.cpp b/source/encoders/handlers/nvenc_h264_handler.cpp index df5563ba..6523e92c 100644 --- a/source/encoders/handlers/nvenc_h264_handler.cpp +++ b/source/encoders/handlers/nvenc_h264_handler.cpp @@ -39,8 +39,8 @@ extern "C" { #endif } -#define KEY_PROFILE "H264.Profile" -#define KEY_LEVEL "H264.Level" +#define ST_KEY_PROFILE "H264.Profile" +#define ST_KEY_LEVEL "H264.Level" using namespace streamfx::encoder::ffmpeg::handler; using namespace streamfx::encoder::codec::h264; @@ -70,8 +70,8 @@ void nvenc_h264_handler::get_defaults(obs_data_t* settings, const AVCodec* codec { nvenc::get_defaults(settings, codec, context); - obs_data_set_default_int(settings, KEY_PROFILE, static_cast(profile::HIGH)); - obs_data_set_default_int(settings, KEY_LEVEL, static_cast(level::UNKNOWN)); + obs_data_set_default_int(settings, ST_KEY_PROFILE, static_cast(profile::HIGH)); + obs_data_set_default_int(settings, ST_KEY_LEVEL, static_cast(level::UNKNOWN)); } bool nvenc_h264_handler::has_keyframe_support(ffmpeg_factory*) @@ -108,14 +108,14 @@ void nvenc_h264_handler::update(obs_data_t* settings, const AVCodec* codec, AVCo nvenc::update(settings, codec, context); { - auto found = profiles.find(static_cast(obs_data_get_int(settings, KEY_PROFILE))); + auto found = profiles.find(static_cast(obs_data_get_int(settings, ST_KEY_PROFILE))); if (found != profiles.end()) { av_opt_set(context->priv_data, "profile", found->second.c_str(), 0); } } { - auto found = levels.find(static_cast(obs_data_get_int(settings, KEY_LEVEL))); + auto found = levels.find(static_cast(obs_data_get_int(settings, ST_KEY_LEVEL))); if (found != levels.end()) { av_opt_set(context->priv_data, "level", found->second.c_str(), 0); } else { @@ -148,20 +148,20 @@ void nvenc_h264_handler::get_encoder_properties(obs_properties_t* props, const A obs_properties_t* grp = props; if (!util::are_property_groups_broken()) { grp = obs_properties_create(); - obs_properties_add_group(props, P_H264, D_TRANSLATE(P_H264), OBS_GROUP_NORMAL, grp); + obs_properties_add_group(props, S_CODEC_H264, D_TRANSLATE(S_CODEC_H264), OBS_GROUP_NORMAL, grp); } { - auto p = obs_properties_add_list(grp, KEY_PROFILE, D_TRANSLATE(P_H264_PROFILE), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); + auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(S_CODEC_H264_PROFILE), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(profile::UNKNOWN)); for (auto const kv : profiles) { - std::string trans = std::string(P_H264_PROFILE) + "." + kv.second; + std::string trans = std::string(S_CODEC_H264_PROFILE) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, KEY_LEVEL, D_TRANSLATE(P_H264_LEVEL), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(S_CODEC_H264_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_AUTOMATIC), static_cast(level::UNKNOWN)); for (auto const kv : levels) { diff --git a/source/encoders/handlers/nvenc_hevc_handler.cpp b/source/encoders/handlers/nvenc_hevc_handler.cpp index 2ee923b3..dfa23d38 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.cpp +++ b/source/encoders/handlers/nvenc_hevc_handler.cpp @@ -35,9 +35,9 @@ extern "C" { #pragma warning(pop) } -#define KEY_PROFILE "H265.Profile" -#define KEY_TIER "H265.Tier" -#define KEY_LEVEL "H265.Level" +#define ST_KEY_PROFILE "H265.Profile" +#define ST_KEY_TIER "H265.Tier" +#define ST_KEY_LEVEL "H265.Level" using namespace streamfx::encoder::ffmpeg::handler; using namespace streamfx::encoder::codec::hevc; @@ -70,9 +70,9 @@ void nvenc_hevc_handler::get_defaults(obs_data_t* settings, const AVCodec* codec { nvenc::get_defaults(settings, codec, context); - obs_data_set_default_int(settings, KEY_PROFILE, static_cast(profile::MAIN)); - obs_data_set_default_int(settings, KEY_TIER, static_cast(profile::MAIN)); - obs_data_set_default_int(settings, KEY_LEVEL, static_cast(level::UNKNOWN)); + obs_data_set_default_int(settings, ST_KEY_PROFILE, static_cast(profile::MAIN)); + obs_data_set_default_int(settings, ST_KEY_TIER, static_cast(profile::MAIN)); + obs_data_set_default_int(settings, ST_KEY_LEVEL, static_cast(level::UNKNOWN)); } bool nvenc_hevc_handler::has_keyframe_support(ffmpeg_factory*) @@ -109,19 +109,19 @@ void nvenc_hevc_handler::update(obs_data_t* settings, const AVCodec* codec, AVCo nvenc::update(settings, codec, context); { // HEVC Options - auto found = profiles.find(static_cast(obs_data_get_int(settings, KEY_PROFILE))); + auto found = profiles.find(static_cast(obs_data_get_int(settings, ST_KEY_PROFILE))); if (found != profiles.end()) { av_opt_set(context->priv_data, "profile", found->second.c_str(), 0); } } { - auto found = tiers.find(static_cast(obs_data_get_int(settings, KEY_TIER))); + auto found = tiers.find(static_cast(obs_data_get_int(settings, ST_KEY_TIER))); if (found != tiers.end()) { av_opt_set(context->priv_data, "tier", found->second.c_str(), 0); } } { - auto found = levels.find(static_cast(obs_data_get_int(settings, KEY_LEVEL))); + auto found = levels.find(static_cast(obs_data_get_int(settings, ST_KEY_LEVEL))); if (found != levels.end()) { av_opt_set(context->priv_data, "level", found->second.c_str(), 0); } else { @@ -156,29 +156,29 @@ void nvenc_hevc_handler::get_encoder_properties(obs_properties_t* props, const A obs_properties_t* grp = props; if (!util::are_property_groups_broken()) { grp = obs_properties_create(); - obs_properties_add_group(props, P_HEVC, D_TRANSLATE(P_HEVC), OBS_GROUP_NORMAL, grp); + obs_properties_add_group(props, S_CODEC_HEVC, D_TRANSLATE(S_CODEC_HEVC), OBS_GROUP_NORMAL, grp); } { - auto p = obs_properties_add_list(grp, KEY_PROFILE, D_TRANSLATE(P_HEVC_PROFILE), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); + auto p = obs_properties_add_list(grp, ST_KEY_PROFILE, D_TRANSLATE(S_CODEC_HEVC_PROFILE), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(profile::UNKNOWN)); for (auto const kv : profiles) { - std::string trans = std::string(P_HEVC_PROFILE) + "." + kv.second; + std::string trans = std::string(S_CODEC_HEVC_PROFILE) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, KEY_TIER, D_TRANSLATE(P_HEVC_TIER), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_TIER, D_TRANSLATE(S_CODEC_HEVC_TIER), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_DEFAULT), static_cast(tier::UNKNOWN)); for (auto const kv : tiers) { - std::string trans = std::string(P_HEVC_TIER) + "." + kv.second; + std::string trans = std::string(S_CODEC_HEVC_TIER) + "." + kv.second; obs_property_list_add_int(p, D_TRANSLATE(trans.c_str()), static_cast(kv.first)); } } { - auto p = obs_properties_add_list(grp, KEY_LEVEL, D_TRANSLATE(P_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, + auto p = obs_properties_add_list(grp, ST_KEY_LEVEL, D_TRANSLATE(S_CODEC_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_AUTOMATIC), static_cast(level::UNKNOWN)); for (auto const kv : levels) { diff --git a/source/encoders/handlers/prores_aw_handler.cpp b/source/encoders/handlers/prores_aw_handler.cpp index ffbd0d48..dee0b726 100644 --- a/source/encoders/handlers/prores_aw_handler.cpp +++ b/source/encoders/handlers/prores_aw_handler.cpp @@ -42,7 +42,7 @@ void prores_aw_handler::override_colorformat(AVPixelFormat& target_format, obs_d std::pair{profile::AP4H, AV_PIX_FMT_YUV444P10}, std::pair{profile::AP4X, AV_PIX_FMT_YUV444P10}, }; - const int64_t profile_id = obs_data_get_int(settings, P_PRORES_PROFILE); + const int64_t profile_id = obs_data_get_int(settings, S_CODEC_PRORES_PROFILE); for (auto kv : profile_to_format_map) { if (kv.first == static_cast(profile_id)) { target_format = kv.second; @@ -53,7 +53,7 @@ void prores_aw_handler::override_colorformat(AVPixelFormat& target_format, obs_d void prores_aw_handler::get_defaults(obs_data_t* settings, const AVCodec*, AVCodecContext*, bool) { - obs_data_set_default_int(settings, P_PRORES_PROFILE, 0); + obs_data_set_default_int(settings, S_CODEC_PRORES_PROFILE, 0); } bool prores_aw_handler::has_pixel_format_support(ffmpeg_factory* instance) @@ -65,17 +65,17 @@ inline const char* profile_to_name(const AVProfile* ptr) { switch (static_cast(ptr->profile)) { case profile::APCO: - return D_TRANSLATE(P_PRORES_PROFILE_APCO); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_APCO); case profile::APCS: - return D_TRANSLATE(P_PRORES_PROFILE_APCS); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_APCS); case profile::APCN: - return D_TRANSLATE(P_PRORES_PROFILE_APCN); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_APCN); case profile::APCH: - return D_TRANSLATE(P_PRORES_PROFILE_APCH); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_APCH); case profile::AP4H: - return D_TRANSLATE(P_PRORES_PROFILE_AP4H); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_AP4H); case profile::AP4X: - return D_TRANSLATE(P_PRORES_PROFILE_AP4X); + return D_TRANSLATE(S_CODEC_PRORES_PROFILE_AP4X); default: return ptr->name; } @@ -84,19 +84,19 @@ inline const char* profile_to_name(const AVProfile* ptr) void prores_aw_handler::get_properties(obs_properties_t* props, const AVCodec* codec, AVCodecContext* context, bool) { if (!context) { - auto p = obs_properties_add_list(props, P_PRORES_PROFILE, D_TRANSLATE(P_PRORES_PROFILE), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); + auto p = obs_properties_add_list(props, S_CODEC_PRORES_PROFILE, D_TRANSLATE(S_CODEC_PRORES_PROFILE), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); for (auto ptr = codec->profiles; ptr->profile != FF_PROFILE_UNKNOWN; ptr++) { obs_property_list_add_int(p, profile_to_name(ptr), static_cast(ptr->profile)); } } else { - obs_property_set_enabled(obs_properties_get(props, P_PRORES_PROFILE), false); + obs_property_set_enabled(obs_properties_get(props, S_CODEC_PRORES_PROFILE), false); } } void prores_aw_handler::update(obs_data_t* settings, const AVCodec*, AVCodecContext* context) { - context->profile = static_cast(obs_data_get_int(settings, P_PRORES_PROFILE)); + context->profile = static_cast(obs_data_get_int(settings, S_CODEC_PRORES_PROFILE)); } void prores_aw_handler::log_options(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context)