code, cmake: Remove legacy code

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2023-05-14 09:00:02 +02:00 committed by Xaymar
parent 0227cfd7b5
commit d51847152c
4 changed files with 0 additions and 1944 deletions

View file

@ -293,7 +293,6 @@ set(${PREFIX}ENABLE_ENCODER_FFMPEG_AMF ${FEATURE_DEPRECATED} CACHE BOOL "Enable
set(${PREFIX}ENABLE_ENCODER_FFMPEG_NVENC ${FEATURE_UNSTABLE} CACHE BOOL "Enable NVENC Encoder in FFmpeg.")
set(${PREFIX}ENABLE_ENCODER_FFMPEG_PRORES ${FEATURE_STABLE} CACHE BOOL "Enable ProRes Encoder in FFmpeg.")
set(${PREFIX}ENABLE_ENCODER_FFMPEG_DNXHR ${FEATURE_STABLE} CACHE BOOL "Enable DNXHR Encoder in FFmpeg.")
set(${PREFIX}ENABLE_ENCODER_AOM_AV1 ${FEATURE_DEPRECATED} CACHE BOOL "Enable AOM AV1 Encoder.")
## Filters
set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Auto-Framing Filter")
@ -1213,23 +1212,6 @@ if(T_CHECK)
endif()
endif()
# Encoder/AOM-AV1
is_feature_enabled(ENCODER_AOM_AV1 T_CHECK)
if(T_CHECK)
list(APPEND PROJECT_PRIVATE_SOURCE
"source/encoders/codecs/av1.hpp"
"source/encoders/codecs/av1.cpp"
"source/encoders/encoder-aom-av1.hpp"
"source/encoders/encoder-aom-av1.cpp"
)
list(APPEND PROJECT_INCLUDE_DIRS
${AOM_INCLUDE_DIR}
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_ENCODER_AOM_AV1
)
endif()
# Filter/Auto-Framing
is_feature_enabled(FILTER_AUTOFRAMING T_CHECK)
if(T_CHECK)

File diff suppressed because it is too large Load diff

View file

@ -1,191 +0,0 @@
// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
//--------------------------------------------------------------------------------//
// THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED.
//--------------------------------------------------------------------------------//
#pragma once
#include "common.hpp"
#include "encoders/codecs/av1.hpp"
#include "obs/obs-encoder-factory.hpp"
#include "util/util-library.hpp"
#include "util/util-profiler.hpp"
#include "warning-disable.hpp"
#include <memory>
#include <queue>
#include "warning-enable.hpp"
extern "C" {
#include "warning-disable.hpp"
#include <aom/aomcx.h>
#include "warning-enable.hpp"
};
namespace streamfx::encoder::aom::av1 {
class aom_av1_factory;
class aom_av1_instance : public obs::encoder_instance {
std::shared_ptr<aom_av1_factory> _factory;
aom_codec_iface_t* _iface;
aom_codec_ctx_t _ctx;
aom_codec_enc_cfg_t _cfg;
size_t _image_index;
std::vector<aom_image_t> _images;
aom_fixed_buf_t* _global_headers;
bool _initialized;
struct {
// Video (All Static)
uint16_t width;
uint16_t height;
struct {
uint32_t num;
uint32_t den;
} fps;
// Color (All Static)
aom_img_fmt color_format;
aom_color_primaries_t color_primaries;
aom_transfer_characteristics_t color_trc;
aom_matrix_coefficients_t color_matrix;
aom_color_range_t color_range;
bool monochrome;
// Encoder
codec::av1::profile profile; // Static
int8_t preset;
// Rate Control
aom_rc_mode rc_mode; // Static
int8_t rc_lookahead; // Static
int32_t rc_bitrate;
int32_t rc_bitrate_overshoot;
int32_t rc_bitrate_undershoot;
int8_t rc_quality;
int8_t rc_quantizer_min;
int8_t rc_quantizer_max;
int32_t rc_buffer_ms;
int32_t rc_buffer_initial_ms;
int32_t rc_buffer_optimal_ms;
// Key-Frames
aom_kf_mode kf_mode;
int32_t kf_distance_min;
int32_t kf_distance_max;
// Threads and Tiling (All Static)
int8_t threads;
int8_t rowmultithreading;
int8_t tile_columns;
int8_t tile_rows;
aom_tune_metric tune_metric;
aom_tune_content tune_content;
} _settings;
#ifdef ENABLE_PROFILING
std::shared_ptr<streamfx::util::profiler> _profiler_copy;
std::shared_ptr<streamfx::util::profiler> _profiler_encode;
std::shared_ptr<streamfx::util::profiler> _profiler_packet;
#endif
public:
aom_av1_instance(obs_data_t* settings, obs_encoder_t* self, bool is_hw);
virtual ~aom_av1_instance();
virtual void migrate(obs_data_t* settings, uint64_t version);
virtual bool update(obs_data_t* settings);
void log();
virtual bool get_extra_data(uint8_t** extra_data, size_t* size);
virtual bool get_sei_data(uint8_t** sei_data, size_t* size);
virtual void get_video_info(struct video_scale_info* info);
virtual bool encode_video(encoder_frame* frame, encoder_packet* packet, bool* received_packet);
};
class aom_av1_factory : public obs::encoder_factory<aom_av1_factory, aom_av1_instance> {
std::shared_ptr<::streamfx::util::library> _library;
public:
aom_av1_factory();
~aom_av1_factory();
const char* get_name() override;
void* create(obs_data_t* settings, obs_encoder_t* encoder, bool is_hw) override;
void get_defaults2(obs_data_t* data) override;
obs_properties_t* get_properties2(instance_t* data) override;
#ifdef ENABLE_FRONTEND
static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data);
#endif
public:
// aom_codec.h
decltype(&aom_codec_version) libaom_codec_version;
decltype(&aom_codec_version_str) libaom_codec_version_str;
decltype(&aom_codec_version_extra_str) libaom_codec_version_extra_str;
decltype(&aom_codec_build_config) libaom_codec_build_config;
decltype(&aom_codec_iface_name) libaom_codec_iface_name;
decltype(&aom_codec_err_to_string) libaom_codec_err_to_string;
decltype(&aom_codec_error) libaom_codec_error;
decltype(&aom_codec_error_detail) libaom_codec_error_detail;
decltype(&aom_codec_destroy) libaom_codec_destroy;
decltype(&aom_codec_get_caps) libaom_codec_get_caps;
decltype(&aom_codec_control) libaom_codec_control;
decltype(&aom_codec_set_option) libaom_codec_set_option;
decltype(&aom_obu_type_to_string) libaom_obu_type_to_string;
// aom_integer.h
decltype(&aom_uleb_size_in_bytes) libaom_uleb_size_in_bytes;
decltype(&aom_uleb_decode) libaom_uleb_decode;
decltype(&aom_uleb_encode) libaom_uleb_encode;
decltype(&aom_uleb_encode_fixed_size) libaom_uleb_encode_fixed_size;
// aom_image.h
decltype(&aom_img_alloc) libaom_img_alloc;
decltype(&aom_img_wrap) libaom_img_wrap;
decltype(&aom_img_alloc_with_border) libaom_img_alloc_with_border;
decltype(&aom_img_set_rect) libaom_img_set_rect;
decltype(&aom_img_flip) libaom_img_flip;
decltype(&aom_img_free) libaom_img_free;
decltype(&aom_img_plane_width) libaom_img_plane_width;
decltype(&aom_img_plane_height) libaom_img_plane_height;
decltype(&aom_img_add_metadata) libaom_img_add_metadata;
decltype(&aom_img_get_metadata) libaom_img_get_metadata;
decltype(&aom_img_num_metadata) libaom_img_num_metadata;
decltype(&aom_img_remove_metadata) libaom_img_remove_metadata;
decltype(&aom_img_metadata_alloc) libaom_img_metadata_alloc;
decltype(&aom_img_metadata_free) libaom_img_metadata_free;
// aom_encoder.h
decltype(&aom_codec_enc_init_ver) libaom_codec_enc_init_ver;
decltype(&aom_codec_enc_config_default) libaom_codec_enc_config_default;
decltype(&aom_codec_enc_config_set) libaom_codec_enc_config_set;
decltype(&aom_codec_get_global_headers) libaom_codec_get_global_headers;
decltype(&aom_codec_encode) libaom_codec_encode;
decltype(&aom_codec_set_cx_data_buf) libaom_codec_set_cx_data_buf;
decltype(&aom_codec_get_cx_data) libaom_codec_get_cx_data;
decltype(&aom_codec_get_preview_frame) libaom_codec_get_preview_frame;
// aomcx.h
decltype(&aom_codec_av1_cx) libaom_codec_av1_cx;
public: // Singleton
static void initialize();
static void finalize();
static std::shared_ptr<aom_av1_factory> get();
};
} // namespace streamfx::encoder::aom::av1

View file

@ -12,14 +12,6 @@
#include "nvidia/cuda/nvidia-cuda-obs.hpp"
#endif
#ifdef ENABLE_ENCODER_AOM_AV1
#include "encoders/encoder-aom-av1.hpp"
#endif
#ifdef ENABLE_FILTER_DISPLACEMENT
#include "filters/filter-displacement.hpp"
#endif
#ifdef ENABLE_FRONTEND
#include "ui/ui.hpp"
#endif
@ -110,20 +102,6 @@ MODULE_EXPORT bool obs_module_load(void)
}
#endif
// Encoders
{
#ifdef ENABLE_ENCODER_AOM_AV1
streamfx::encoder::aom::av1::aom_av1_factory::initialize();
#endif
}
// Filters
{
#ifdef ENABLE_FILTER_DISPLACEMENT
streamfx::filter::displacement::displacement_factory::initialize();
#endif
}
DLOG_INFO("Loaded Version %s", STREAMFX_VERSION_STRING);
return true;
} catch (std::exception const& ex) {
@ -140,20 +118,6 @@ MODULE_EXPORT void obs_module_unload(void)
try {
DLOG_INFO("Unloading Version %s", STREAMFX_VERSION_STRING);
// Filters
{
#ifdef ENABLE_FILTER_DISPLACEMENT
streamfx::filter::displacement::displacement_factory::finalize();
#endif
}
// Encoders
{
#ifdef ENABLE_ENCODER_AOM_AV1
streamfx::encoder::aom::av1::aom_av1_factory::finalize();
#endif
}
// Finalize GLAD (OpenGL)
{
streamfx::obs::gs::context gctx{};