From 3883c4759cf33b93d697e6e0ac9ec6236b8a297e Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 20 Aug 2022 23:16:44 +0200 Subject: [PATCH] encoders/handlers/amf: Deprecate encoder --- data/locale/en-US.ini | 1 + source/encoders/handlers/amf_h264_handler.cpp | 5 +++++ source/encoders/handlers/amf_hevc_handler.cpp | 5 +++++ source/encoders/handlers/amf_hevc_handler.hpp | 4 ++++ source/encoders/handlers/amf_shared.cpp | 11 +++++++++++ source/encoders/handlers/amf_shared.hpp | 2 ++ 6 files changed, 28 insertions(+) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 9cb5a8f0..27b68f84 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -138,6 +138,7 @@ Encoder.FFmpeg.KeyFrames.IntervalType.Seconds="Seconds" Encoder.FFmpeg.KeyFrames.Interval="Interval" # Encoder/FFmpeg/AMF +Encoder.FFmpeg.AMF.Deprecated="This encoder is deprecated and will be removed soon. Users are urged to migrate to the integrated 'AMD HW H.264 (AVC)' or 'AMD HW H.265 (HEVC)' encoder as soon as possible." Encoder.FFmpeg.AMF.Preset="Preset" Encoder.FFmpeg.AMF.Preset.Speed="Speed" Encoder.FFmpeg.AMF.Preset.Balanced="Balanced" diff --git a/source/encoders/handlers/amf_h264_handler.cpp b/source/encoders/handlers/amf_h264_handler.cpp index 0f7b2be9..5201824d 100644 --- a/source/encoders/handlers/amf_h264_handler.cpp +++ b/source/encoders/handlers/amf_h264_handler.cpp @@ -17,6 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +//--------------------------------------------------------------------------------// +// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. +//--------------------------------------------------------------------------------// + #include "amf_h264_handler.hpp" #include "../codecs/h264.hpp" #include "../encoder-ffmpeg.hpp" @@ -60,6 +64,7 @@ void amf_h264_handler::adjust_info(ffmpeg_factory* factory, const AVCodec* codec name = "AMD AMF H.264/AVC (via FFmpeg)"; if (!amf::is_available()) factory->get_info()->caps |= OBS_ENCODER_CAP_DEPRECATED; + factory->get_info()->caps |= OBS_ENCODER_CAP_DEPRECATED; } void amf_h264_handler::get_defaults(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context, bool hw_encode) diff --git a/source/encoders/handlers/amf_hevc_handler.cpp b/source/encoders/handlers/amf_hevc_handler.cpp index 17d7989f..4f1d3237 100644 --- a/source/encoders/handlers/amf_hevc_handler.cpp +++ b/source/encoders/handlers/amf_hevc_handler.cpp @@ -17,6 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +//--------------------------------------------------------------------------------// +// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. +//--------------------------------------------------------------------------------// + #include "amf_hevc_handler.hpp" #include "strings.hpp" #include "../codecs/hevc.hpp" @@ -62,6 +66,7 @@ void amf_hevc_handler::adjust_info(ffmpeg_factory* factory, const AVCodec* codec name = "AMD AMF H.265/HEVC (via FFmpeg)"; if (!amf::is_available()) factory->get_info()->caps |= OBS_ENCODER_CAP_DEPRECATED; + factory->get_info()->caps |= OBS_ENCODER_CAP_DEPRECATED; } void amf_hevc_handler::get_defaults(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context, bool) diff --git a/source/encoders/handlers/amf_hevc_handler.hpp b/source/encoders/handlers/amf_hevc_handler.hpp index 756a31dc..1cd537ec 100644 --- a/source/encoders/handlers/amf_hevc_handler.hpp +++ b/source/encoders/handlers/amf_hevc_handler.hpp @@ -17,6 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +//--------------------------------------------------------------------------------// +// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. +//--------------------------------------------------------------------------------// + #pragma once #include "handler.hpp" diff --git a/source/encoders/handlers/amf_shared.cpp b/source/encoders/handlers/amf_shared.cpp index 52209ad1..0d4e4bff 100644 --- a/source/encoders/handlers/amf_shared.cpp +++ b/source/encoders/handlers/amf_shared.cpp @@ -19,6 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +//--------------------------------------------------------------------------------// +// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. +//--------------------------------------------------------------------------------// + #include "amf_shared.hpp" #include "ffmpeg/tools.hpp" @@ -31,6 +35,7 @@ extern "C" { // Translation #define ST_I18N "Encoder.FFmpeg.AMF" +#define ST_I18N_DEPRECATED ST_I18N ".Deprecated" #define ST_I18N_PRESET ST_I18N ".Preset" #define ST_I18N_PRESET_(x) ST_I18N_PRESET "." x #define ST_I18N_RATECONTROL "Encoder.FFmpeg.AMF.RateControl" @@ -188,6 +193,12 @@ static bool modified_ratecontrol(obs_properties_t* props, obs_property_t*, obs_d void amf::get_properties_pre(obs_properties_t* props, const AVCodec* codec) { + { + auto p = obs_properties_add_text(props, "[[deprecated]]", D_TRANSLATE(ST_I18N_DEPRECATED), OBS_TEXT_INFO); + obs_property_text_set_info_type(p, OBS_TEXT_INFO_WARNING); + obs_property_text_set_info_word_wrap(p, true); + } + auto p = obs_properties_add_list(props, ST_KEY_PRESET, D_TRANSLATE(ST_I18N_PRESET), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); for (auto kv : presets) { diff --git a/source/encoders/handlers/amf_shared.hpp b/source/encoders/handlers/amf_shared.hpp index 0cb32e32..2e4adfad 100644 --- a/source/encoders/handlers/amf_shared.hpp +++ b/source/encoders/handlers/amf_shared.hpp @@ -19,6 +19,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. + #pragma once #include "common.hpp" #include "handler.hpp"