From 63a5873413fd7adfe0f566a4e5a852aa9c2868f3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 10 Aug 2020 03:29:05 +0200 Subject: [PATCH] project: Remove non-standard std:: prefix from types --- source/encoders/codecs/hevc.cpp | 30 +++++------ source/encoders/codecs/hevc.hpp | 4 +- source/encoders/codecs/prores.hpp | 2 +- source/encoders/encoder-ffmpeg.cpp | 33 ++++++------ source/encoders/encoder-ffmpeg.hpp | 8 +-- source/encoders/handlers/handler.hpp | 2 +- .../encoders/handlers/nvenc_h264_handler.cpp | 2 +- .../encoders/handlers/nvenc_h264_handler.hpp | 3 +- .../encoders/handlers/nvenc_hevc_handler.cpp | 2 +- .../encoders/handlers/nvenc_hevc_handler.hpp | 3 +- source/encoders/handlers/nvenc_shared.cpp | 8 +-- .../encoders/handlers/prores_aw_handler.cpp | 2 +- source/ffmpeg/avframe-queue.cpp | 12 ++--- source/ffmpeg/avframe-queue.hpp | 12 ++--- source/ffmpeg/hwapi/base.hpp | 6 +-- source/ffmpeg/hwapi/d3d11.cpp | 4 +- source/ffmpeg/hwapi/d3d11.hpp | 6 +-- source/ffmpeg/swscale.cpp | 16 +++--- source/ffmpeg/swscale.hpp | 16 +++--- source/filters/filter-blur.cpp | 22 ++++---- source/filters/filter-blur.hpp | 2 +- source/filters/filter-color-grade.cpp | 6 +-- source/filters/filter-color-grade.hpp | 2 +- source/filters/filter-displacement.cpp | 2 +- source/filters/filter-displacement.hpp | 6 +-- source/filters/filter-dynamic-mask.cpp | 6 +-- source/filters/filter-dynamic-mask.hpp | 4 +- source/filters/filter-nv-face-tracking.cpp | 6 +-- source/filters/filter-nv-face-tracking.hpp | 8 +-- source/filters/filter-sdf-effects.cpp | 46 ++++++++--------- source/filters/filter-sdf-effects.hpp | 2 +- source/filters/filter-shader.cpp | 6 +-- source/filters/filter-shader.hpp | 6 +-- source/filters/filter-transform.cpp | 16 +++--- source/filters/filter-transform.hpp | 4 +- source/gfx/blur/gfx-blur-dual-filtering.cpp | 12 ++--- source/gfx/shader/gfx-shader-param-basic.hpp | 8 +-- source/gfx/shader/gfx-shader.cpp | 12 ++--- source/gfx/shader/gfx-shader.hpp | 20 ++++---- source/nvidia/ar/nvidia-ar-feature.hpp | 14 +++--- source/nvidia/cuda/nvidia-cuda-stream.cpp | 2 +- source/nvidia/cuda/nvidia-cuda-stream.hpp | 2 +- source/nvidia/cuda/nvidia-cuda.hpp | 50 +++++++++---------- source/obs/gs/gs-effect-parameter.cpp | 44 ++++++++-------- source/obs/gs/gs-indexbuffer.cpp | 2 +- source/obs/gs/gs-indexbuffer.hpp | 2 +- source/obs/gs/gs-limits.hpp | 4 +- source/obs/gs/gs-mipmapper.cpp | 4 +- source/obs/gs/gs-rendertarget.cpp | 4 +- source/obs/gs/gs-rendertarget.hpp | 4 +- source/obs/gs/gs-sampler.cpp | 16 +++--- source/obs/gs/gs-sampler.hpp | 10 ++-- source/obs/gs/gs-texture.cpp | 24 ++++----- source/obs/gs/gs-texture.hpp | 22 ++++---- source/obs/obs-encoder-factory.hpp | 6 +-- source/obs/obs-source-factory.hpp | 31 ++++++------ source/obs/obs-source-tracker.cpp | 4 +- source/obs/obs-source.cpp | 4 +- source/obs/obs-source.hpp | 4 +- source/obs/obs-tools.cpp | 2 +- source/sources/source-mirror.cpp | 6 +-- source/sources/source-mirror.hpp | 10 ++-- source/sources/source-shader.cpp | 4 +- source/sources/source-shader.hpp | 4 +- source/transitions/transition-shader.cpp | 16 +++--- source/transitions/transition-shader.hpp | 8 +-- source/ui/ui-about.hpp | 4 +- source/util/util-profiler.hpp | 2 +- source/util/utility.hpp | 30 +++++------ 69 files changed, 349 insertions(+), 357 deletions(-) diff --git a/source/encoders/codecs/hevc.cpp b/source/encoders/codecs/hevc.cpp index afb478fc..e605db79 100644 --- a/source/encoders/codecs/hevc.cpp +++ b/source/encoders/codecs/hevc.cpp @@ -23,7 +23,7 @@ using namespace streamfx::encoder::codec; -enum class nal_unit_type : std::uint8_t { // 6 bits +enum class nal_unit_type : uint8_t { // 6 bits TRAIL_N = 0, TRAIL_R = 1, TSA_N = 2, @@ -93,17 +93,17 @@ enum class nal_unit_type : std::uint8_t { // 6 bits struct hevc_nal_unit_header { bool zero_bit : 1; nal_unit_type nut : 6; - std::uint8_t layer_id : 6; - std::uint8_t temporal_id_plus1 : 3; + uint8_t layer_id : 6; + uint8_t temporal_id_plus1 : 3; }; struct hevc_nal { hevc_nal_unit_header* header; std::size_t size = 0; - std::uint8_t* data = nullptr; + uint8_t* data = nullptr; }; -bool is_nal(std::uint8_t* data, std::uint8_t* end) +bool is_nal(uint8_t* data, uint8_t* end) { std::size_t s = static_cast(end - data); if (s < 4) @@ -121,7 +121,7 @@ bool is_nal(std::uint8_t* data, std::uint8_t* end) return true; } -bool seek_to_nal(std::uint8_t*& data, std::uint8_t* end) +bool seek_to_nal(uint8_t*& data, uint8_t* end) { if (data > end) return false; @@ -135,16 +135,16 @@ bool seek_to_nal(std::uint8_t*& data, std::uint8_t* end) return false; } -std::size_t get_nal_size(std::uint8_t* data, std::uint8_t* end) +std::size_t get_nal_size(uint8_t* data, uint8_t* end) { - std::uint8_t* ptr = data + 4; + uint8_t* ptr = data + 4; if (!seek_to_nal(ptr, end)) { return static_cast(end - data); } return static_cast(ptr - data); } -bool is_discard_marker(std::uint8_t* data, std::uint8_t* end) +bool is_discard_marker(uint8_t* data, uint8_t* end) { std::size_t s = static_cast(end - data); if (s < 4) @@ -179,7 +179,7 @@ bool is_discard_marker(std::uint8_t* data, std::uint8_t* end) } } -bool should_discard_nal(std::uint8_t* data, std::uint8_t* end) +bool should_discard_nal(uint8_t* data, uint8_t* end) { if (data > end) return true; @@ -192,17 +192,17 @@ bool should_discard_nal(std::uint8_t* data, std::uint8_t* end) return false; } -void progress_parse(std::uint8_t*& ptr, std::uint8_t* end, size_t& sz) +void progress_parse(uint8_t*& ptr, uint8_t* end, size_t& sz) { ptr += sz; sz = get_nal_size(ptr, end); } -void hevc::extract_header_sei(std::uint8_t* data, std::size_t sz_data, std::vector& header, - std::vector& sei) +void hevc::extract_header_sei(uint8_t* data, std::size_t sz_data, std::vector& header, + std::vector& sei) { - std::uint8_t* ptr = data; - std::uint8_t* end = data + sz_data; + uint8_t* ptr = data; + uint8_t* end = data + sz_data; // Reserve enough memory to store the entire packet data if necessary. header.reserve(sz_data); diff --git a/source/encoders/codecs/hevc.hpp b/source/encoders/codecs/hevc.hpp index ab6b3f9f..4cec27e3 100644 --- a/source/encoders/codecs/hevc.hpp +++ b/source/encoders/codecs/hevc.hpp @@ -59,6 +59,6 @@ namespace streamfx::encoder::codec::hevc { UNKNOWN = -1, }; - void extract_header_sei(std::uint8_t* data, std::size_t sz_data, std::vector& header, - std::vector& sei); + void extract_header_sei(uint8_t* data, std::size_t sz_data, std::vector& header, + std::vector& sei); } // namespace streamfx::encoder::codec::hevc diff --git a/source/encoders/codecs/prores.hpp b/source/encoders/codecs/prores.hpp index d51299f1..85681c62 100644 --- a/source/encoders/codecs/prores.hpp +++ b/source/encoders/codecs/prores.hpp @@ -33,7 +33,7 @@ #define P_PRORES_PROFILE_AP4X "Codec.ProRes.Profile.AP4X" namespace streamfx::encoder::codec::prores { - enum class profile : std::int32_t { + enum class profile : int32_t { APCO = 0, Y422_PROXY = APCO, APCS = 1, diff --git a/source/encoders/encoder-ffmpeg.cpp b/source/encoders/encoder-ffmpeg.cpp index 75794b82..4a4f200b 100644 --- a/source/encoders/encoder-ffmpeg.cpp +++ b/source/encoders/encoder-ffmpeg.cpp @@ -180,7 +180,7 @@ void ffmpeg_instance::get_properties(obs_properties_t* props) obs_property_set_enabled(obs_properties_get(props, KEY_FFMPEG_GPU), false); } -void ffmpeg_instance::migrate(obs_data_t* settings, std::uint64_t version) +void ffmpeg_instance::migrate(obs_data_t* settings, uint64_t version) { if (_handler) _handler->migrate(settings, version, _codec, _context); @@ -314,15 +314,15 @@ static inline void copy_data(encoder_frame* frame, AVFrame* vframe) std::size_t plane_height = static_cast(vframe->height) >> (idx ? v_chroma_shift : 0); - if (static_cast(vframe->linesize[idx]) == frame->linesize[idx]) { + if (static_cast(vframe->linesize[idx]) == frame->linesize[idx]) { std::memcpy(vframe->data[idx], frame->data[idx], frame->linesize[idx] * plane_height); } else { std::size_t ls_in = static_cast(frame->linesize[idx]); std::size_t ls_out = static_cast(vframe->linesize[idx]); std::size_t bytes = ls_in < ls_out ? ls_in : ls_out; - std::uint8_t* to = vframe->data[idx]; - std::uint8_t* from = frame->data[idx]; + uint8_t* to = vframe->data[idx]; + uint8_t* from = frame->data[idx]; for (std::size_t y = 0; y < plane_height; y++) { std::memcpy(to, from, bytes); @@ -357,9 +357,8 @@ bool ffmpeg_instance::encode_video(struct encoder_frame* frame, struct encoder_p && (_scaler.get_source_format() == _scaler.get_target_format())) { copy_data(frame, vframe.get()); } else { - int res = - _scaler.convert(reinterpret_cast(frame->data), reinterpret_cast(frame->linesize), - 0, _context->height, vframe->data, vframe->linesize); + int res = _scaler.convert(reinterpret_cast(frame->data), reinterpret_cast(frame->linesize), + 0, _context->height, vframe->data, vframe->linesize); if (res <= 0) { DLOG_ERROR("Failed to convert frame: %s (%" PRId32 ").", ::ffmpeg::tools::get_error_description(res), res); @@ -447,13 +446,11 @@ void ffmpeg_instance::initialize_sw(obs_data_t* settings) _context->framerate.num = _context->time_base.den = static_cast(voi->fps_num); _context->framerate.den = _context->time_base.num = static_cast(voi->fps_den); - _scaler.set_source_size(static_cast(_context->width), - static_cast(_context->height)); + _scaler.set_source_size(static_cast(_context->width), static_cast(_context->height)); _scaler.set_source_color(_context->color_range == AVCOL_RANGE_JPEG, _context->colorspace); _scaler.set_source_format(_pixfmt_source); - _scaler.set_target_size(static_cast(_context->width), - static_cast(_context->height)); + _scaler.set_target_size(static_cast(_context->width), static_cast(_context->height)); _scaler.set_target_color(_context->color_range == AVCOL_RANGE_JPEG, _context->colorspace); _scaler.set_target_format(_pixfmt_target); @@ -603,10 +600,10 @@ int ffmpeg_instance::receive_packet(bool* received_packet, struct encoder_packet if (!_have_first_frame) { if (_codec->id == AV_CODEC_ID_H264) { - std::uint8_t* tmp_packet; - std::uint8_t* tmp_header; - std::uint8_t* tmp_sei; - std::size_t sz_packet, sz_header, sz_sei; + uint8_t* tmp_packet; + uint8_t* tmp_header; + uint8_t* tmp_sei; + std::size_t sz_packet, sz_header, sz_sei; obs_extract_avc_headers(_packet.data, static_cast(_packet.size), &tmp_packet, &sz_packet, &tmp_header, &sz_header, &tmp_sei, &sz_sei); @@ -1025,13 +1022,13 @@ obs_properties_t* ffmpeg_factory::get_properties2(instance_t* data) } { // Key-Frame Interval Seconds auto p = obs_properties_add_float(grp, KEY_KEYFRAMES_INTERVAL_SECONDS, D_TRANSLATE(ST_KEYFRAMES_INTERVAL), - 0.00, std::numeric_limits::max(), 0.01); + 0.00, std::numeric_limits::max(), 0.01); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_KEYFRAMES_INTERVAL))); obs_property_float_set_suffix(p, " seconds"); } { // Key-Frame Interval Frames auto p = obs_properties_add_int(grp, KEY_KEYFRAMES_INTERVAL_FRAMES, D_TRANSLATE(ST_KEYFRAMES_INTERVAL), 0, - std::numeric_limits::max(), 1); + std::numeric_limits::max(), 1); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_KEYFRAMES_INTERVAL))); obs_property_int_set_suffix(p, " frames"); } @@ -1053,7 +1050,7 @@ obs_properties_t* ffmpeg_factory::get_properties2(instance_t* data) if (_handler && _handler->is_hardware_encoder(this)) { auto p = obs_properties_add_int(grp, KEY_FFMPEG_GPU, D_TRANSLATE(ST_FFMPEG_GPU), -1, - std::numeric_limits::max(), 1); + std::numeric_limits::max(), 1); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_FFMPEG_GPU))); } diff --git a/source/encoders/encoder-ffmpeg.hpp b/source/encoders/encoder-ffmpeg.hpp index 3780b691..e662ccf5 100644 --- a/source/encoders/encoder-ffmpeg.hpp +++ b/source/encoders/encoder-ffmpeg.hpp @@ -67,9 +67,9 @@ namespace streamfx::encoder::ffmpeg { std::size_t _sent_frames; // Extra Data - bool _have_first_frame; - std::vector _extra_data; - std::vector _sei_data; + bool _have_first_frame; + std::vector _extra_data; + std::vector _sei_data; // Frame Stack and Queue std::stack> _free_frames; @@ -83,7 +83,7 @@ namespace streamfx::encoder::ffmpeg { public: void get_properties(obs_properties_t* props); - void migrate(obs_data_t* settings, std::uint64_t version) override; + void migrate(obs_data_t* settings, uint64_t version) override; bool update(obs_data_t* settings) override; diff --git a/source/encoders/handlers/handler.hpp b/source/encoders/handlers/handler.hpp index 7c26dddc..855d0a72 100644 --- a/source/encoders/handlers/handler.hpp +++ b/source/encoders/handlers/handler.hpp @@ -60,7 +60,7 @@ namespace streamfx::encoder::ffmpeg { virtual void get_properties(obs_properties_t* props, const AVCodec* codec, AVCodecContext* context, bool hw_encode){}; - virtual void migrate(obs_data_t* settings, std::uint64_t version, const AVCodec* codec, + virtual void migrate(obs_data_t* settings, uint64_t version, const AVCodec* codec, AVCodecContext* context){}; virtual void update(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context){}; diff --git a/source/encoders/handlers/nvenc_h264_handler.cpp b/source/encoders/handlers/nvenc_h264_handler.cpp index 698f3d23..12fbf547 100644 --- a/source/encoders/handlers/nvenc_h264_handler.cpp +++ b/source/encoders/handlers/nvenc_h264_handler.cpp @@ -178,7 +178,7 @@ void nvenc_h264_handler::get_runtime_properties(obs_properties_t* props, const A nvenc::get_runtime_properties(props, codec, context); } -void streamfx::encoder::ffmpeg::handler::nvenc_h264_handler::migrate(obs_data_t* settings, std::uint64_t version, +void streamfx::encoder::ffmpeg::handler::nvenc_h264_handler::migrate(obs_data_t* settings, uint64_t version, const AVCodec* codec, AVCodecContext* context) { nvenc::migrate(settings, version, codec, context); diff --git a/source/encoders/handlers/nvenc_h264_handler.hpp b/source/encoders/handlers/nvenc_h264_handler.hpp index 793e5d5f..45131ce0 100644 --- a/source/encoders/handlers/nvenc_h264_handler.hpp +++ b/source/encoders/handlers/nvenc_h264_handler.hpp @@ -53,8 +53,7 @@ namespace streamfx::encoder::ffmpeg::handler { virtual void get_properties(obs_properties_t* props, const AVCodec* codec, AVCodecContext* context, bool hw_encode); - virtual void migrate(obs_data_t* settings, std::uint64_t version, const AVCodec* codec, - AVCodecContext* context); + virtual void migrate(obs_data_t* settings, uint64_t version, const AVCodec* codec, AVCodecContext* context); virtual void update(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context); diff --git a/source/encoders/handlers/nvenc_hevc_handler.cpp b/source/encoders/handlers/nvenc_hevc_handler.cpp index 3ed249e5..44060278 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.cpp +++ b/source/encoders/handlers/nvenc_hevc_handler.cpp @@ -196,7 +196,7 @@ void nvenc_hevc_handler::get_runtime_properties(obs_properties_t* props, const A nvenc::get_runtime_properties(props, codec, context); } -void streamfx::encoder::ffmpeg::handler::nvenc_hevc_handler::migrate(obs_data_t* settings, std::uint64_t version, +void streamfx::encoder::ffmpeg::handler::nvenc_hevc_handler::migrate(obs_data_t* settings, uint64_t version, const AVCodec* codec, AVCodecContext* context) { nvenc::migrate(settings, version, codec, context); diff --git a/source/encoders/handlers/nvenc_hevc_handler.hpp b/source/encoders/handlers/nvenc_hevc_handler.hpp index a0d5dbc1..624b2a31 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.hpp +++ b/source/encoders/handlers/nvenc_hevc_handler.hpp @@ -53,8 +53,7 @@ namespace streamfx::encoder::ffmpeg::handler { virtual void get_properties(obs_properties_t* props, const AVCodec* codec, AVCodecContext* context, bool hw_encode); - virtual void migrate(obs_data_t* settings, std::uint64_t version, const AVCodec* codec, - AVCodecContext* context); + virtual void migrate(obs_data_t* settings, uint64_t version, const AVCodec* codec, AVCodecContext* context); virtual void update(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context); diff --git a/source/encoders/handlers/nvenc_shared.cpp b/source/encoders/handlers/nvenc_shared.cpp index 0edf2fec..91bb24e2 100644 --- a/source/encoders/handlers/nvenc_shared.cpp +++ b/source/encoders/handlers/nvenc_shared.cpp @@ -345,21 +345,21 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec) { auto p = obs_properties_add_int(grp, KEY_RATECONTROL_LIMITS_BITRATE_TARGET, D_TRANSLATE(ST_RATECONTROL_LIMITS_BITRATE_TARGET), -1, - std::numeric_limits::max(), 1); + std::numeric_limits::max(), 1); obs_property_int_set_suffix(p, " kbit/s"); } { auto p = obs_properties_add_int(grp, KEY_RATECONTROL_LIMITS_BITRATE_MAXIMUM, D_TRANSLATE(ST_RATECONTROL_LIMITS_BITRATE_MAXIMUM), -1, - std::numeric_limits::max(), 1); + std::numeric_limits::max(), 1); obs_property_int_set_suffix(p, " kbit/s"); } { auto p = obs_properties_add_int(grp, KEY_RATECONTROL_LIMITS_BUFFERSIZE, D_TRANSLATE(ST_RATECONTROL_LIMITS_BUFFERSIZE), 0, - std::numeric_limits::max(), 1); + std::numeric_limits::max(), 1); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_RATECONTROL_LIMITS_BUFFERSIZE))); obs_property_int_set_suffix(p, " kbit"); } @@ -444,7 +444,7 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec) // H.264 does not support using all B-Frames as reference. continue; } - obs_property_list_add_int(p, D_TRANSLATE(kv.second.c_str()), static_cast(kv.first)); + obs_property_list_add_int(p, D_TRANSLATE(kv.second.c_str()), static_cast(kv.first)); } } diff --git a/source/encoders/handlers/prores_aw_handler.cpp b/source/encoders/handlers/prores_aw_handler.cpp index dec282cb..cc332255 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 std::int64_t profile_id = obs_data_get_int(settings, P_PRORES_PROFILE); + const int64_t profile_id = obs_data_get_int(settings, P_PRORES_PROFILE); for (auto kv : profile_to_format_map) { if (kv.first == static_cast(profile_id)) { target_format = kv.second; diff --git a/source/ffmpeg/avframe-queue.cpp b/source/ffmpeg/avframe-queue.cpp index 4a2719e4..8396bccc 100644 --- a/source/ffmpeg/avframe-queue.cpp +++ b/source/ffmpeg/avframe-queue.cpp @@ -49,24 +49,24 @@ avframe_queue::~avframe_queue() clear(); } -void avframe_queue::set_resolution(std::int32_t const width, std::int32_t const height) +void avframe_queue::set_resolution(int32_t const width, int32_t const height) { this->_resolution.first = width; this->_resolution.second = height; } -void avframe_queue::get_resolution(std::int32_t& width, std::int32_t& height) +void avframe_queue::get_resolution(int32_t& width, int32_t& height) { width = this->_resolution.first; height = this->_resolution.second; } -std::int32_t avframe_queue::get_width() +int32_t avframe_queue::get_width() { return this->_resolution.first; } -std::int32_t avframe_queue::get_height() +int32_t avframe_queue::get_height() { return this->_resolution.second; } @@ -113,8 +113,8 @@ std::shared_ptr avframe_queue::pop() ret = create_frame(); } else { _frames.pop_front(); - if ((static_cast(ret->width) != this->_resolution.first) - || (static_cast(ret->height) != this->_resolution.second) + if ((static_cast(ret->width) != this->_resolution.first) + || (static_cast(ret->height) != this->_resolution.second) || (ret->format != this->_format)) { ret = nullptr; } diff --git a/source/ffmpeg/avframe-queue.hpp b/source/ffmpeg/avframe-queue.hpp index 5d62b91a..ebf452c5 100644 --- a/source/ffmpeg/avframe-queue.hpp +++ b/source/ffmpeg/avframe-queue.hpp @@ -40,8 +40,8 @@ namespace ffmpeg { std::deque> _frames; std::mutex _lock; - std::pair _resolution; - AVPixelFormat _format = AV_PIX_FMT_NONE; + std::pair _resolution; + AVPixelFormat _format = AV_PIX_FMT_NONE; std::shared_ptr create_frame(); @@ -49,10 +49,10 @@ namespace ffmpeg { avframe_queue(); ~avframe_queue(); - void set_resolution(std::int32_t width, std::int32_t height); - void get_resolution(std::int32_t& width, std::int32_t& height); - std::int32_t get_width(); - std::int32_t get_height(); + void set_resolution(int32_t width, int32_t height); + void get_resolution(int32_t& width, int32_t& height); + int32_t get_width(); + int32_t get_height(); void set_pixel_format(AVPixelFormat format); AVPixelFormat get_pixel_format(); diff --git a/source/ffmpeg/hwapi/base.hpp b/source/ffmpeg/hwapi/base.hpp index 02a388f3..5df8bcee 100644 --- a/source/ffmpeg/hwapi/base.hpp +++ b/source/ffmpeg/hwapi/base.hpp @@ -50,10 +50,10 @@ namespace ffmpeg::hwapi { virtual std::shared_ptr allocate_frame(AVBufferRef* frames) = 0; - virtual void copy_from_obs(AVBufferRef* frames, std::uint32_t handle, uint64_t lock_key, - uint64_t* next_lock_key, std::shared_ptr frame) = 0; + virtual void copy_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key, + std::shared_ptr frame) = 0; - virtual std::shared_ptr avframe_from_obs(AVBufferRef* frames, std::uint32_t handle, uint64_t lock_key, + virtual std::shared_ptr avframe_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key) = 0; }; diff --git a/source/ffmpeg/hwapi/d3d11.cpp b/source/ffmpeg/hwapi/d3d11.cpp index 2bd28c77..2726c8ce 100644 --- a/source/ffmpeg/hwapi/d3d11.cpp +++ b/source/ffmpeg/hwapi/d3d11.cpp @@ -208,7 +208,7 @@ std::shared_ptr d3d11_instance::allocate_frame(AVBufferRef* frames) return frame; } -void d3d11_instance::copy_from_obs(AVBufferRef*, std::uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key, +void d3d11_instance::copy_from_obs(AVBufferRef*, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key, std::shared_ptr frame) { auto gctx = gs::context(); @@ -251,7 +251,7 @@ void d3d11_instance::copy_from_obs(AVBufferRef*, std::uint32_t handle, uint64_t mutex->ReleaseSync(*next_lock_key); } -std::shared_ptr d3d11_instance::avframe_from_obs(AVBufferRef* frames, std::uint32_t handle, uint64_t lock_key, +std::shared_ptr d3d11_instance::avframe_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key) { auto gctx = gs::context(); diff --git a/source/ffmpeg/hwapi/d3d11.hpp b/source/ffmpeg/hwapi/d3d11.hpp index 446bd689..292bf858 100644 --- a/source/ffmpeg/hwapi/d3d11.hpp +++ b/source/ffmpeg/hwapi/d3d11.hpp @@ -74,10 +74,10 @@ namespace ffmpeg::hwapi { virtual std::shared_ptr allocate_frame(AVBufferRef* frames) override; - virtual void copy_from_obs(AVBufferRef* frames, std::uint32_t handle, uint64_t lock_key, - uint64_t* next_lock_key, std::shared_ptr frame) override; + virtual void copy_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key, + std::shared_ptr frame) override; - virtual std::shared_ptr avframe_from_obs(AVBufferRef* frames, std::uint32_t handle, uint64_t lock_key, + virtual std::shared_ptr avframe_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, uint64_t* next_lock_key) override; }; } // namespace ffmpeg::hwapi diff --git a/source/ffmpeg/swscale.cpp b/source/ffmpeg/swscale.cpp index cf800af1..91d253c7 100644 --- a/source/ffmpeg/swscale.cpp +++ b/source/ffmpeg/swscale.cpp @@ -31,7 +31,7 @@ swscale::~swscale() finalize(); } -void swscale::set_source_size(std::uint32_t width, std::uint32_t height) +void swscale::set_source_size(uint32_t width, uint32_t height) { source_size.first = width; source_size.second = height; @@ -48,12 +48,12 @@ std::pair swscale::get_source_size() return this->source_size; } -std::uint32_t swscale::get_source_width() +uint32_t swscale::get_source_width() { return this->source_size.first; } -std::uint32_t swscale::get_source_height() +uint32_t swscale::get_source_height() { return this->source_size.second; } @@ -94,7 +94,7 @@ bool swscale::is_source_full_range() return this->source_full_range; } -void swscale::set_target_size(std::uint32_t width, std::uint32_t height) +void swscale::set_target_size(uint32_t width, uint32_t height) { target_size.first = width; target_size.second = height; @@ -111,12 +111,12 @@ std::pair swscale::get_target_size() return this->target_size; } -std::uint32_t swscale::get_target_width() +uint32_t swscale::get_target_width() { return this->target_size.first; } -std::uint32_t swscale::get_target_height() +uint32_t swscale::get_target_height() { return this->target_size.second; } @@ -196,8 +196,8 @@ bool swscale::finalize() return false; } -int32_t swscale::convert(const std::uint8_t* const source_data[], const int source_stride[], int32_t source_row, - int32_t source_rows, std::uint8_t* const target_data[], const int target_stride[]) +int32_t swscale::convert(const uint8_t* const source_data[], const int source_stride[], int32_t source_row, + int32_t source_rows, uint8_t* const target_data[], const int target_stride[]) { if (!this->context) { return 0; diff --git a/source/ffmpeg/swscale.hpp b/source/ffmpeg/swscale.hpp index 9327eee2..7b4957dd 100644 --- a/source/ffmpeg/swscale.hpp +++ b/source/ffmpeg/swscale.hpp @@ -53,11 +53,11 @@ namespace ffmpeg { swscale(); ~swscale(); - void set_source_size(std::uint32_t width, std::uint32_t height); + void set_source_size(uint32_t width, uint32_t height); void get_source_size(uint32_t& width, uint32_t& height); std::pair get_source_size(); - std::uint32_t get_source_width(); - std::uint32_t get_source_height(); + uint32_t get_source_width(); + uint32_t get_source_height(); void set_source_format(AVPixelFormat format); AVPixelFormat get_source_format(); void set_source_color(bool full_range, AVColorSpace space); @@ -66,11 +66,11 @@ namespace ffmpeg { void set_source_full_range(bool full_range); bool is_source_full_range(); - void set_target_size(std::uint32_t width, std::uint32_t height); + void set_target_size(uint32_t width, uint32_t height); void get_target_size(uint32_t& width, uint32_t& height); std::pair get_target_size(); - std::uint32_t get_target_width(); - std::uint32_t get_target_height(); + uint32_t get_target_width(); + uint32_t get_target_height(); void set_target_format(AVPixelFormat format); AVPixelFormat get_target_format(); void set_target_color(bool full_range, AVColorSpace space); @@ -82,7 +82,7 @@ namespace ffmpeg { bool initialize(int flags); bool finalize(); - int32_t convert(const std::uint8_t* const source_data[], const int source_stride[], int32_t source_row, - int32_t source_rows, std::uint8_t* const target_data[], const int target_stride[]); + int32_t convert(const uint8_t* const source_data[], const int source_stride[], int32_t source_row, + int32_t source_rows, uint8_t* const target_data[], const int target_stride[]); }; } // namespace ffmpeg diff --git a/source/filters/filter-blur.cpp b/source/filters/filter-blur.cpp index c7fd111e..28e04842 100644 --- a/source/filters/filter-blur.cpp +++ b/source/filters/filter-blur.cpp @@ -199,7 +199,7 @@ void blur_instance::load(obs_data_t* settings) update(settings); } -void blur_instance::migrate(obs_data_t* settings, std::uint64_t version) +void blur_instance::migrate(obs_data_t* settings, uint64_t version) { // Now we use a fall-through switch to gradually upgrade each known version change. switch (version) { @@ -292,12 +292,12 @@ void blur_instance::update(obs_data_t* settings) break; } if ((_mask.type == mask_type::Image) || (_mask.type == mask_type::Source)) { - std::uint32_t color = static_cast(obs_data_get_int(settings, ST_MASK_COLOR)); - _mask.color.r = ((color >> 0) & 0xFF) / 255.0f; - _mask.color.g = ((color >> 8) & 0xFF) / 255.0f; - _mask.color.b = ((color >> 16) & 0xFF) / 255.0f; - _mask.color.a = static_cast(obs_data_get_double(settings, ST_MASK_ALPHA)); - _mask.multiplier = float_t(obs_data_get_double(settings, ST_MASK_MULTIPLIER)); + uint32_t color = static_cast(obs_data_get_int(settings, ST_MASK_COLOR)); + _mask.color.r = ((color >> 0) & 0xFF) / 255.0f; + _mask.color.g = ((color >> 8) & 0xFF) / 255.0f; + _mask.color.b = ((color >> 16) & 0xFF) / 255.0f; + _mask.color.a = static_cast(obs_data_get_double(settings, ST_MASK_ALPHA)); + _mask.multiplier = float_t(obs_data_get_double(settings, ST_MASK_MULTIPLIER)); } } } @@ -357,8 +357,8 @@ void blur_instance::video_render(gs_effect_t* effect) obs_source_t* parent = obs_filter_get_parent(this->_self); obs_source_t* target = obs_filter_get_target(this->_self); gs_effect_t* defaultEffect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); - std::uint32_t baseW = obs_source_get_base_width(target); - std::uint32_t baseH = obs_source_get_base_height(target); + uint32_t baseW = obs_source_get_base_width(target); + uint32_t baseH = obs_source_get_base_height(target); // Verify that we can actually run first. if (!target || !parent || !this->_self || !this->_blur || (baseW == 0) || (baseH == 0)) { @@ -474,8 +474,8 @@ void blur_instance::video_render(gs_effect_t* effect) } if (_mask.source.source_texture) { - std::uint32_t source_width = obs_source_get_width(this->_mask.source.source_texture->get_object()); - std::uint32_t source_height = obs_source_get_height(this->_mask.source.source_texture->get_object()); + uint32_t source_width = obs_source_get_width(this->_mask.source.source_texture->get_object()); + uint32_t source_height = obs_source_get_height(this->_mask.source.source_texture->get_object()); if (source_width == 0) { source_width = baseW; diff --git a/source/filters/filter-blur.hpp b/source/filters/filter-blur.hpp index 3b98f1a5..5c09a127 100644 --- a/source/filters/filter-blur.hpp +++ b/source/filters/filter-blur.hpp @@ -100,7 +100,7 @@ namespace streamfx::filter::blur { public: virtual void load(obs_data_t* settings) override; - virtual void migrate(obs_data_t* settings, std::uint64_t version) override; + virtual void migrate(obs_data_t* settings, uint64_t version) override; virtual void update(obs_data_t* settings) override; virtual void video_tick(float_t time) override; diff --git a/source/filters/filter-color-grade.cpp b/source/filters/filter-color-grade.cpp index 9a0f3513..b653b30b 100644 --- a/source/filters/filter-color-grade.cpp +++ b/source/filters/filter-color-grade.cpp @@ -127,7 +127,7 @@ void color_grade_instance::load(obs_data_t* data) update(data); } -void color_grade_instance::migrate(obs_data_t* data, std::uint64_t version) {} +void color_grade_instance::migrate(obs_data_t* data, uint64_t version) {} void color_grade_instance::update(obs_data_t* data) { @@ -176,8 +176,8 @@ void color_grade_instance::video_render(gs_effect_t* effect) // Grab initial values. obs_source_t* parent = obs_filter_get_parent(_self); obs_source_t* target = obs_filter_get_target(_self); - std::uint32_t width = obs_source_get_base_width(target); - std::uint32_t height = obs_source_get_base_height(target); + uint32_t width = obs_source_get_base_width(target); + uint32_t height = obs_source_get_base_height(target); gs_effect_t* effect_default = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); // Skip filter if anything is wrong. diff --git a/source/filters/filter-color-grade.hpp b/source/filters/filter-color-grade.hpp index 6c68164b..4edfe910 100644 --- a/source/filters/filter-color-grade.hpp +++ b/source/filters/filter-color-grade.hpp @@ -72,7 +72,7 @@ namespace streamfx::filter::color_grade { virtual ~color_grade_instance(); virtual void load(obs_data_t* data) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* data) override; virtual void video_tick(float_t time) override; diff --git a/source/filters/filter-displacement.cpp b/source/filters/filter-displacement.cpp index 681e5ce9..c9a79f90 100644 --- a/source/filters/filter-displacement.cpp +++ b/source/filters/filter-displacement.cpp @@ -55,7 +55,7 @@ void displacement_instance::load(obs_data_t* settings) update(settings); } -void displacement_instance::migrate(obs_data_t* data, std::uint64_t version) +void displacement_instance::migrate(obs_data_t* data, uint64_t version) { switch (version & STREAMFX_MASK_COMPAT) { case 0: diff --git a/source/filters/filter-displacement.hpp b/source/filters/filter-displacement.hpp index 99cd70e9..5501d936 100644 --- a/source/filters/filter-displacement.hpp +++ b/source/filters/filter-displacement.hpp @@ -33,15 +33,15 @@ namespace streamfx::filter::displacement { float_t _scale_type; // Cache - std::uint32_t _width; - std::uint32_t _height; + uint32_t _width; + uint32_t _height; public: displacement_instance(obs_data_t*, obs_source_t*); virtual ~displacement_instance(); virtual void load(obs_data_t* settings) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* settings) override; virtual void video_tick(float_t) override; diff --git a/source/filters/filter-dynamic-mask.cpp b/source/filters/filter-dynamic-mask.cpp index e9d53d53..eb76e14c 100644 --- a/source/filters/filter-dynamic-mask.cpp +++ b/source/filters/filter-dynamic-mask.cpp @@ -79,7 +79,7 @@ void dynamic_mask_instance::load(obs_data_t* settings) update(settings); } -void dynamic_mask_instance::migrate(obs_data_t* data, std::uint64_t version) {} +void dynamic_mask_instance::migrate(obs_data_t* data, uint64_t version) {} void dynamic_mask_instance::update(obs_data_t* settings) { @@ -191,8 +191,8 @@ void dynamic_mask_instance::video_render(gs_effect_t* in_effect) { obs_source_t* parent = obs_filter_get_parent(_self); obs_source_t* target = obs_filter_get_target(_self); - std::uint32_t width = obs_source_get_base_width(target); - std::uint32_t height = obs_source_get_base_height(target); + uint32_t width = obs_source_get_base_width(target); + uint32_t height = obs_source_get_base_height(target); if (!_self || !parent || !target || !width || !height || !_input || !_input_capture || !_effect) { obs_source_skip_video_filter(_self); diff --git a/source/filters/filter-dynamic-mask.hpp b/source/filters/filter-dynamic-mask.hpp index 441bb3ae..00bcee32 100644 --- a/source/filters/filter-dynamic-mask.hpp +++ b/source/filters/filter-dynamic-mask.hpp @@ -28,7 +28,7 @@ #include "obs/obs-source.hpp" namespace streamfx::filter::dynamic_mask { - enum class channel : std::int8_t { Invalid = -1, Red, Green, Blue, Alpha }; + enum class channel : int8_t { Invalid = -1, Red, Green, Blue, Alpha }; class dynamic_mask_instance : public obs::source_instance { std::map, std::string> _translation_map; @@ -66,7 +66,7 @@ namespace streamfx::filter::dynamic_mask { virtual ~dynamic_mask_instance(); virtual void load(obs_data_t* settings) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* settings) override; virtual void save(obs_data_t* settings) override; diff --git a/source/filters/filter-nv-face-tracking.cpp b/source/filters/filter-nv-face-tracking.cpp index 93fe243f..5aac07d0 100644 --- a/source/filters/filter-nv-face-tracking.cpp +++ b/source/filters/filter-nv-face-tracking.cpp @@ -172,7 +172,7 @@ void face_tracking_instance::async_initialize(std::shared_ptr ptr) // Create Bounding Boxes Data _ar_bboxes_data.assign(1, {0., 0., 0., 0.}); _ar_bboxes.boxes = _ar_bboxes_data.data(); - _ar_bboxes.max_boxes = std::clamp(static_cast(_ar_bboxes_data.size()), 0, 255); + _ar_bboxes.max_boxes = std::clamp(static_cast(_ar_bboxes_data.size()), 0, 255); _ar_bboxes.num_boxes = 0; _ar_bboxes_confidence.resize(_ar_bboxes_data.size()); if (NvCV_Status res = _ar_library->set_object(_ar_feature.get(), NvAR_Parameter_Output(BoundingBoxes), @@ -474,7 +474,7 @@ void face_tracking_instance::load(obs_data_t* data) update(data); } -void face_tracking_instance::migrate(obs_data_t* data, std::uint64_t version) {} +void face_tracking_instance::migrate(obs_data_t* data, uint64_t version) {} void face_tracking_instance::update(obs_data_t* data) { @@ -592,7 +592,7 @@ bool face_tracking_instance::button_profile(obs_properties_t* props, obs_propert for (auto& kv : profilers) { DLOG_INFO(" %-20s: %8lldµs %10lld %8lldµs %8lldµs %8lldµs", kv.first.c_str(), std::chrono::duration_cast(kv.second->total_duration()).count(), - kv.second->count(), static_cast(kv.second->average_duration() / 1000.0), + kv.second->count(), static_cast(kv.second->average_duration() / 1000.0), std::chrono::duration_cast(kv.second->percentile(0.999)).count(), std::chrono::duration_cast(kv.second->percentile(0.95)).count()); } diff --git a/source/filters/filter-nv-face-tracking.hpp b/source/filters/filter-nv-face-tracking.hpp index f43328c0..77d5eafd 100644 --- a/source/filters/filter-nv-face-tracking.hpp +++ b/source/filters/filter-nv-face-tracking.hpp @@ -37,9 +37,9 @@ namespace streamfx::filter::nvidia { class face_tracking_instance : public obs::source_instance { // Filter Cache - std::pair _size; - bool _rt_is_fresh; - std::shared_ptr _rt; + std::pair _size; + bool _rt_is_fresh; + std::shared_ptr _rt; std::mutex _delete_protection; @@ -114,7 +114,7 @@ namespace streamfx::filter::nvidia { virtual void load(obs_data_t* data) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* data) override; diff --git a/source/filters/filter-sdf-effects.cpp b/source/filters/filter-sdf-effects.cpp index 250edaa6..0d7f9c39 100644 --- a/source/filters/filter-sdf-effects.cpp +++ b/source/filters/filter-sdf-effects.cpp @@ -122,7 +122,7 @@ void sdf_effects_instance::load(obs_data_t* settings) update(settings); } -void sdf_effects_instance::migrate(obs_data_t* data, std::uint64_t version) {} +void sdf_effects_instance::migrate(obs_data_t* data, uint64_t version) {} void sdf_effects_instance::update(obs_data_t* data) { @@ -132,12 +132,12 @@ void sdf_effects_instance::update(obs_data_t* data) && (obs_data_get_double(data, ST_SHADOW_OUTER_ALPHA) >= std::numeric_limits::epsilon()); { struct cs { - std::uint8_t r, g, b, a; + uint8_t r, g, b, a; }; union { - std::uint32_t color; - std::uint8_t channel[4]; - cs c; + uint32_t color; + uint8_t channel[4]; + cs c; }; color = uint32_t(obs_data_get_int(data, ST_SHADOW_OUTER_COLOR)); _outer_shadow_color.x = float_t(c.r / 255.0); @@ -157,12 +157,12 @@ void sdf_effects_instance::update(obs_data_t* data) && (obs_data_get_double(data, ST_SHADOW_INNER_ALPHA) >= std::numeric_limits::epsilon()); { struct cs { - std::uint8_t r, g, b, a; + uint8_t r, g, b, a; }; union { - std::uint32_t color; - std::uint8_t channel[4]; - cs c; + uint32_t color; + uint8_t channel[4]; + cs c; }; color = uint32_t(obs_data_get_int(data, ST_SHADOW_INNER_COLOR)); _inner_shadow_color.x = float_t(c.r / 255.0); @@ -181,12 +181,12 @@ void sdf_effects_instance::update(obs_data_t* data) && (obs_data_get_double(data, ST_GLOW_OUTER_ALPHA) >= std::numeric_limits::epsilon()); { struct cs { - std::uint8_t r, g, b, a; + uint8_t r, g, b, a; }; union { - std::uint32_t color; - std::uint8_t channel[4]; - cs c; + uint32_t color; + uint8_t channel[4]; + cs c; }; color = uint32_t(obs_data_get_int(data, ST_GLOW_OUTER_COLOR)); _outer_glow_color.x = float_t(c.r / 255.0); @@ -207,12 +207,12 @@ void sdf_effects_instance::update(obs_data_t* data) && (obs_data_get_double(data, ST_GLOW_INNER_ALPHA) >= std::numeric_limits::epsilon()); { struct cs { - std::uint8_t r, g, b, a; + uint8_t r, g, b, a; }; union { - std::uint32_t color; - std::uint8_t channel[4]; - cs c; + uint32_t color; + uint8_t channel[4]; + cs c; }; color = uint32_t(obs_data_get_int(data, ST_GLOW_INNER_COLOR)); _inner_glow_color.x = float_t(c.r / 255.0); @@ -233,12 +233,12 @@ void sdf_effects_instance::update(obs_data_t* data) && (obs_data_get_double(data, ST_OUTLINE_ALPHA) >= std::numeric_limits::epsilon()); { struct cs { - std::uint8_t r, g, b, a; + uint8_t r, g, b, a; }; union { - std::uint32_t color; - std::uint8_t channel[4]; - cs c; + uint32_t color; + uint8_t channel[4]; + cs c; }; color = uint32_t(obs_data_get_int(data, ST_OUTLINE_COLOR)); _outline_color.x = float_t(c.r / 255.0); @@ -271,8 +271,8 @@ void sdf_effects_instance::video_render(gs_effect_t* effect) { obs_source_t* parent = obs_filter_get_parent(_self); obs_source_t* target = obs_filter_get_target(_self); - std::uint32_t baseW = obs_source_get_base_width(target); - std::uint32_t baseH = obs_source_get_base_height(target); + uint32_t baseW = obs_source_get_base_width(target); + uint32_t baseH = obs_source_get_base_height(target); gs_effect_t* final_effect = effect ? effect : obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); gs_effect_t* default_effect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); diff --git a/source/filters/filter-sdf-effects.hpp b/source/filters/filter-sdf-effects.hpp index cfa2f9a8..b37cf989 100644 --- a/source/filters/filter-sdf-effects.hpp +++ b/source/filters/filter-sdf-effects.hpp @@ -86,7 +86,7 @@ namespace streamfx::filter::sdf_effects { virtual ~sdf_effects_instance(); virtual void load(obs_data_t* settings) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* settings) override; virtual void video_tick(float_t) override; diff --git a/source/filters/filter-shader.cpp b/source/filters/filter-shader.cpp index 8da4935a..d50aa724 100644 --- a/source/filters/filter-shader.cpp +++ b/source/filters/filter-shader.cpp @@ -34,12 +34,12 @@ shader_instance::shader_instance(obs_data_t* data, obs_source_t* self) : obs::so shader_instance::~shader_instance() {} -std::uint32_t shader_instance::get_width() +uint32_t shader_instance::get_width() { return _fx->width(); } -std::uint32_t shader_instance::get_height() +uint32_t shader_instance::get_height() { return _fx->height(); } @@ -54,7 +54,7 @@ void shader_instance::load(obs_data_t* data) update(data); } -void shader_instance::migrate(obs_data_t* data, std::uint64_t version) {} +void shader_instance::migrate(obs_data_t* data, uint64_t version) {} void shader_instance::update(obs_data_t* data) { diff --git a/source/filters/filter-shader.hpp b/source/filters/filter-shader.hpp index 2548dbbf..2769fd6f 100644 --- a/source/filters/filter-shader.hpp +++ b/source/filters/filter-shader.hpp @@ -32,13 +32,13 @@ namespace streamfx::filter::shader { shader_instance(obs_data_t* data, obs_source_t* self); virtual ~shader_instance(); - virtual std::uint32_t get_width() override; - virtual std::uint32_t get_height() override; + virtual uint32_t get_width() override; + virtual uint32_t get_height() override; void properties(obs_properties_t* props); virtual void load(obs_data_t* data) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* data) override; virtual void video_tick(float_t sec_since_last) override; diff --git a/source/filters/filter-transform.cpp b/source/filters/filter-transform.cpp index 86fa71e0..a11ad7c5 100644 --- a/source/filters/filter-transform.cpp +++ b/source/filters/filter-transform.cpp @@ -85,7 +85,7 @@ transform_instance::transform_instance(obs_data_t* data, obs_source_t* context) { _cache_rt = std::make_shared(GS_RGBA, GS_ZS_NONE); _source_rt = std::make_shared(GS_RGBA, GS_ZS_NONE); - _vertex_buffer = std::make_shared(uint32_t(4u), std::uint8_t(1u)); + _vertex_buffer = std::make_shared(uint32_t(4u), uint8_t(1u)); _position = std::make_unique(); _rotation = std::make_unique(); @@ -116,7 +116,7 @@ void transform_instance::load(obs_data_t* settings) update(settings); } -void transform_instance::migrate(obs_data_t* data, std::uint64_t version) +void transform_instance::migrate(obs_data_t* data, uint64_t version) { switch (version & STREAMFX_MASK_COMPAT) { case 0: @@ -154,8 +154,8 @@ void transform_instance::update(obs_data_t* settings) void transform_instance::video_tick(float_t) { - std::uint32_t width = 0; - std::uint32_t height = 0; + uint32_t width = 0; + uint32_t height = 0; // Grab parent and target. obs_source_t* target = obs_filter_get_target(_self); @@ -274,8 +274,8 @@ void transform_instance::video_render(gs_effect_t* effect) { obs_source_t* parent = obs_filter_get_parent(_self); obs_source_t* target = obs_filter_get_target(_self); - std::uint32_t base_width = obs_source_get_base_width(target); - std::uint32_t base_height = obs_source_get_base_height(target); + uint32_t base_width = obs_source_get_base_width(target); + uint32_t base_height = obs_source_get_base_height(target); gs_effect_t* default_effect = obs_get_base_effect(OBS_EFFECT_DEFAULT); if (!effect) effect = default_effect; @@ -290,8 +290,8 @@ void transform_instance::video_render(gs_effect_t* effect) obs_source_get_name(obs_filter_get_parent(_self))}; #endif - std::uint32_t cache_width = base_width; - std::uint32_t cache_height = base_height; + uint32_t cache_width = base_width; + uint32_t cache_height = base_height; if (_mipmap_enabled) { double_t aspect = double_t(base_width) / double_t(base_height); diff --git a/source/filters/filter-transform.hpp b/source/filters/filter-transform.hpp index b0ff8477..6b4fb856 100644 --- a/source/filters/filter-transform.hpp +++ b/source/filters/filter-transform.hpp @@ -48,7 +48,7 @@ namespace streamfx::filter::transform { // Mesh bool _update_mesh; std::shared_ptr _vertex_buffer; - std::uint32_t _rotation_order; + uint32_t _rotation_order; std::unique_ptr _position; std::unique_ptr _rotation; std::unique_ptr _scale; @@ -63,7 +63,7 @@ namespace streamfx::filter::transform { virtual ~transform_instance() override; virtual void load(obs_data_t* settings) override; - virtual void migrate(obs_data_t* data, std::uint64_t version) override; + virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t*) override; virtual void video_tick(float_t) override; diff --git a/source/gfx/blur/gfx-blur-dual-filtering.cpp b/source/gfx/blur/gfx-blur-dual-filtering.cpp index bcc31768..99f68521 100644 --- a/source/gfx/blur/gfx-blur-dual-filtering.cpp +++ b/source/gfx/blur/gfx-blur-dual-filtering.cpp @@ -271,8 +271,8 @@ std::shared_ptr<::gs::texture> gfx::blur::dual_filtering::render() } // Reduce Size - std::uint32_t owidth = width >> n; - std::uint32_t oheight = height >> n; + uint32_t owidth = width >> n; + uint32_t oheight = height >> n; if ((owidth <= 0) || (oheight <= 0)) { actual_iterations = n - 1; break; @@ -303,10 +303,10 @@ std::shared_ptr<::gs::texture> gfx::blur::dual_filtering::render() std::shared_ptr tex_in = _rts[n]->get_texture(); // Get Size - std::uint32_t iwidth = width >> n; - std::uint32_t iheight = height >> n; - std::uint32_t owidth = width >> (n - 1); - std::uint32_t oheight = height >> (n - 1); + uint32_t iwidth = width >> n; + uint32_t iheight = height >> n; + uint32_t owidth = width >> (n - 1); + uint32_t oheight = height >> (n - 1); // Apply effect.get_parameter("pImage").set_texture(tex_in); diff --git a/source/gfx/shader/gfx-shader-param-basic.hpp b/source/gfx/shader/gfx-shader-param-basic.hpp index 0ea9ce12..2e0f5f30 100644 --- a/source/gfx/shader/gfx-shader-param-basic.hpp +++ b/source/gfx/shader/gfx-shader-param-basic.hpp @@ -33,9 +33,9 @@ namespace gfx { struct basic_data { union { - int32_t i32; - std::uint32_t ui32; - float_t f32; + int32_t i32; + uint32_t ui32; + float_t f32; }; }; @@ -95,7 +95,7 @@ namespace gfx { struct bool_parameter : public basic_parameter { // std::vector doesn't allow .data() - std::vector _data; + std::vector _data; public: bool_parameter(gs::effect_parameter param, std::string prefix); diff --git a/source/gfx/shader/gfx-shader.cpp b/source/gfx/shader/gfx-shader.cpp index 062698a3..18e47f32 100644 --- a/source/gfx/shader/gfx-shader.cpp +++ b/source/gfx/shader/gfx-shader.cpp @@ -375,7 +375,7 @@ void gfx::shader::shader::update(obs_data_t* data) } } -std::uint32_t gfx::shader::shader::width() +uint32_t gfx::shader::shader::width() { switch (_mode) { case shader_mode::Transition: @@ -399,7 +399,7 @@ std::uint32_t gfx::shader::shader::width() } } -std::uint32_t gfx::shader::shader::height() +uint32_t gfx::shader::shader::height() { switch (_mode) { case shader_mode::Transition: @@ -423,12 +423,12 @@ std::uint32_t gfx::shader::shader::height() } } -std::uint32_t gfx::shader::shader::base_width() +uint32_t gfx::shader::shader::base_width() { return _base_width; } -std::uint32_t gfx::shader::shader::base_height() +uint32_t gfx::shader::shader::base_height() { return _base_height; } @@ -537,7 +537,7 @@ void gfx::shader::shader::render() } } -void gfx::shader::shader::set_size(std::uint32_t w, std::uint32_t h) +void gfx::shader::shader::set_size(uint32_t w, uint32_t h) { _base_width = w; _base_height = h; @@ -595,7 +595,7 @@ void gfx::shader::shader::set_transition_time(float_t t) } } -void gfx::shader::shader::set_transition_size(std::uint32_t w, std::uint32_t h) +void gfx::shader::shader::set_transition_size(uint32_t w, uint32_t h) { if (!_shader) return; diff --git a/source/gfx/shader/gfx-shader.hpp b/source/gfx/shader/gfx-shader.hpp index e8f884ea..8e6dc9cf 100644 --- a/source/gfx/shader/gfx-shader.hpp +++ b/source/gfx/shader/gfx-shader.hpp @@ -44,10 +44,10 @@ namespace gfx { obs_source_t* _self; // Inputs - shader_mode _mode; - std::uint32_t _base_width; - std::uint32_t _base_height; - bool _active; + shader_mode _mode; + uint32_t _base_width; + uint32_t _base_height; + bool _active; // Shader gs::effect _shader; @@ -100,13 +100,13 @@ namespace gfx { void update(obs_data_t* data); - std::uint32_t width(); + uint32_t width(); - std::uint32_t height(); + uint32_t height(); - std::uint32_t base_width(); + uint32_t base_width(); - std::uint32_t base_height(); + uint32_t base_height(); bool tick(float_t time); @@ -115,7 +115,7 @@ namespace gfx { void render(); public: - void set_size(std::uint32_t w, std::uint32_t h); + void set_size(uint32_t w, uint32_t h); void set_input_a(std::shared_ptr tex); @@ -123,7 +123,7 @@ namespace gfx { void set_transition_time(float_t t); - void set_transition_size(std::uint32_t w, std::uint32_t h); + void set_transition_size(uint32_t w, uint32_t h); void set_active(bool active); }; diff --git a/source/nvidia/ar/nvidia-ar-feature.hpp b/source/nvidia/ar/nvidia-ar-feature.hpp index 47100f1f..dadda90d 100644 --- a/source/nvidia/ar/nvidia-ar-feature.hpp +++ b/source/nvidia/ar/nvidia-ar-feature.hpp @@ -38,37 +38,37 @@ namespace nvidia::ar { inline NvCV_Status get(std::string name, T& value); template<> - inline NvCV_Status set(std::string name, std::int32_t value) + inline NvCV_Status set(std::string name, int32_t value) { return _ar->set_int32(_feature.get(), name.c_str(), value); } template<> - inline NvCV_Status get(std::string name, std::int32_t& value) + inline NvCV_Status get(std::string name, int32_t& value) { return _ar->get_int32(_feature.get(), name.c_str(), &value); } template<> - inline NvCV_Status set(std::string name, std::uint32_t value) + inline NvCV_Status set(std::string name, uint32_t value) { return _ar->set_uint32(_feature.get(), name.c_str(), value); } template<> - inline NvCV_Status get(std::string name, std::uint32_t& value) + inline NvCV_Status get(std::string name, uint32_t& value) { return _ar->get_uint32(_feature.get(), name.c_str(), &value); } template<> - inline NvCV_Status set(std::string name, std::uint64_t value) + inline NvCV_Status set(std::string name, uint64_t value) { return _ar->set_uint64(_feature.get(), name.c_str(), value); } template<> - inline NvCV_Status get(std::string name, std::uint64_t& value) + inline NvCV_Status get(std::string name, uint64_t& value) { return _ar->get_uint64(_feature.get(), name.c_str(), &value); } @@ -89,7 +89,7 @@ namespace nvidia::ar { inline NvCV_Status set(std::string name, std::vector value) { return _ar->set_float32_array(_feature.get(), name.c_str(), value.data(), - static_cast(value.size())); + static_cast(value.size())); } template<> diff --git a/source/nvidia/cuda/nvidia-cuda-stream.cpp b/source/nvidia/cuda/nvidia-cuda-stream.cpp index 3a806dc0..455758b0 100644 --- a/source/nvidia/cuda/nvidia-cuda-stream.cpp +++ b/source/nvidia/cuda/nvidia-cuda-stream.cpp @@ -21,7 +21,7 @@ #include nvidia::cuda::stream::stream(std::shared_ptr<::nvidia::cuda::cuda> cuda, ::nvidia::cuda::stream_flags flags, - std::int32_t priority) + int32_t priority) : _cuda(cuda) { nvidia::cuda::result res; diff --git a/source/nvidia/cuda/nvidia-cuda-stream.hpp b/source/nvidia/cuda/nvidia-cuda-stream.hpp index 29403276..a17bbd53 100644 --- a/source/nvidia/cuda/nvidia-cuda-stream.hpp +++ b/source/nvidia/cuda/nvidia-cuda-stream.hpp @@ -28,7 +28,7 @@ namespace nvidia::cuda { public: stream(std::shared_ptr<::nvidia::cuda::cuda> cuda, - ::nvidia::cuda::stream_flags flags = ::nvidia::cuda::stream_flags::DEFAULT, std::int32_t priority = 0); + ::nvidia::cuda::stream_flags flags = ::nvidia::cuda::stream_flags::DEFAULT, int32_t priority = 0); ~stream(); ::nvidia::cuda::stream_t get(); diff --git a/source/nvidia/cuda/nvidia-cuda.hpp b/source/nvidia/cuda/nvidia-cuda.hpp index 53bb71a3..45e9eb73 100644 --- a/source/nvidia/cuda/nvidia-cuda.hpp +++ b/source/nvidia/cuda/nvidia-cuda.hpp @@ -58,14 +58,14 @@ namespace nvidia::cuda { // Still missing some. }; - enum class memory_type : std::uint32_t { + enum class memory_type : uint32_t { HOST = 1, DEVICE = 2, ARRAY = 3, UNIFIED = 4, }; - enum class array_format : std::uint32_t { + enum class array_format : uint32_t { UNSIGNED_INT8 = 0b00000001, UNSIGNED_INT16 = 0b00000010, UNSIGNED_INT32 = 0b00000011, @@ -76,7 +76,7 @@ namespace nvidia::cuda { FLOAT = 0b00100000, }; - enum class context_flags : std::uint32_t { + enum class context_flags : uint32_t { SCHEDULER_AUTO = 0x0, SCHEDULER_SPIN = 0x1, SCHEDULER_YIELD = 0x2, @@ -85,17 +85,17 @@ namespace nvidia::cuda { LOCAL_MEMORY_RESIZE_TO_MAXIMUM = 0x10, }; - enum class stream_flags : std::uint32_t { + enum class stream_flags : uint32_t { DEFAULT = 0x0, NON_BLOCKING = 0x1, }; - typedef void* array_t; - typedef void* context_t; - typedef std::uint64_t device_ptr_t; - typedef void* graphics_resource_t; - typedef void* stream_t; - typedef std::int32_t device_t; + typedef void* array_t; + typedef void* context_t; + typedef uint64_t device_ptr_t; + typedef void* graphics_resource_t; + typedef void* stream_t; + typedef int32_t device_t; struct memcpy2d_t { std::size_t src_x_in_bytes; @@ -121,10 +121,10 @@ namespace nvidia::cuda { }; struct array_descriptor_t { - std::size_t width; - std::size_t height; - std::uint32_t num_channels; - array_format format; + std::size_t width; + std::size_t height; + uint32_t num_channels; + array_format format; }; class cuda { @@ -137,10 +137,10 @@ namespace nvidia::cuda { public: // Initialization - CUDA_DEFINE_FUNCTION(cuInit, std::int32_t flags); + CUDA_DEFINE_FUNCTION(cuInit, int32_t flags); // Version Management - CUDA_DEFINE_FUNCTION(cuDriverGetVersion, std::int32_t* driverVersion); + CUDA_DEFINE_FUNCTION(cuDriverGetVersion, int32_t* driverVersion); // Device Management // cuDeviceGet @@ -169,7 +169,7 @@ namespace nvidia::cuda { // cuCtxGetFlags // cuCtxGetLimit // cuCtxGetSharedMemConfig - CUDA_DEFINE_FUNCTION(cuCtxGetStreamPriorityRange, std::int32_t* lowestPriority, std::int32_t* highestPriority); + CUDA_DEFINE_FUNCTION(cuCtxGetStreamPriorityRange, int32_t* lowestPriority, int32_t* highestPriority); CUDA_DEFINE_FUNCTION(cuCtxPopCurrent, context_t* ctx); CUDA_DEFINE_FUNCTION(cuCtxPushCurrent, context_t ctx); // cuCtxSetCacheConfig @@ -214,13 +214,13 @@ namespace nvidia::cuda { // cuMemAllocHost_v2 // cuMemAllocManaged CUDA_DEFINE_FUNCTION(cuMemAllocPitch, device_ptr_t* ptr, std::size_t* pitch, std::size_t width_in_bytes, - std::size_t height, std::uint32_t element_size_bytes); + std::size_t height, uint32_t element_size_bytes); CUDA_DEFINE_FUNCTION(cuMemFree, device_ptr_t ptr); // cuMemFreeHost // cuMemGetAddressRange_v2 // cuMemGetInfo_v2 // cuMemHostAlloc - CUDA_DEFINE_FUNCTION(cuMemHostGetDevicePointer, device_ptr_t* devptr, void* ptr, std::uint32_t flags); + CUDA_DEFINE_FUNCTION(cuMemHostGetDevicePointer, device_ptr_t* devptr, void* ptr, uint32_t flags); // cuMemHostGetFlags // cuMemHostRegister_v2 // cuMemHostUnregister @@ -292,7 +292,7 @@ namespace nvidia::cuda { // cuStreamAttachMemAsync // cuStreamBeginCapture_v2 CUDA_DEFINE_FUNCTION(cuStreamCreate, stream_t* stream, stream_flags flags); - CUDA_DEFINE_FUNCTION(cuStreamCreateWithPriority, stream_t* stream, stream_flags flags, std::int32_t priority); + CUDA_DEFINE_FUNCTION(cuStreamCreateWithPriority, stream_t* stream, stream_flags flags, int32_t priority); CUDA_DEFINE_FUNCTION(cuStreamDestroy, stream_t stream); // cuStreamEndCapture // cuStreamGetCaptureInfo @@ -356,15 +356,13 @@ namespace nvidia::cuda { // Todo // Graphics Interoperability - CUDA_DEFINE_FUNCTION(cuGraphicsMapResources, std::uint32_t count, graphics_resource_t* resources, - stream_t stream); + CUDA_DEFINE_FUNCTION(cuGraphicsMapResources, uint32_t count, graphics_resource_t* resources, stream_t stream); // cuGraphicsResourcesGetMappedMipmappedArray // cuGraphicsResourcesGetMappedPointer_v2 // cuGraphicsResourcesSetMapFlags_v2 CUDA_DEFINE_FUNCTION(cuGraphicsSubResourceGetMappedArray, array_t* array, graphics_resource_t resource, - std::uint32_t index, std::uint32_t level); - CUDA_DEFINE_FUNCTION(cuGraphicsUnmapResources, std::uint32_t count, graphics_resource_t* resources, - stream_t stream); + uint32_t index, uint32_t level); + CUDA_DEFINE_FUNCTION(cuGraphicsUnmapResources, uint32_t count, graphics_resource_t* resources, stream_t stream); CUDA_DEFINE_FUNCTION(cuGraphicsUnregisterResource, graphics_resource_t resource); // Profile Control @@ -394,7 +392,7 @@ namespace nvidia::cuda { CUDA_DEFINE_FUNCTION(cuD3D11GetDevice, device_t* device, IDXGIAdapter* adapter); // cuD3D11GetDevices CUDA_DEFINE_FUNCTION(cuGraphicsD3D11RegisterResource, graphics_resource_t* resource, - ID3D11Resource* d3dresource, std::uint32_t flags); + ID3D11Resource* d3dresource, uint32_t flags); #endif public: static std::shared_ptr get(); diff --git a/source/obs/gs/gs-effect-parameter.cpp b/source/obs/gs/gs-effect-parameter.cpp index e5c4d5af..7d67b948 100644 --- a/source/obs/gs/gs-effect-parameter.cpp +++ b/source/obs/gs/gs-effect-parameter.cpp @@ -293,7 +293,7 @@ void gs::effect_parameter::get_float2(float_t& x, float_t& y) { if (get_type() != type::Float2) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -307,7 +307,7 @@ void gs::effect_parameter::get_default_float2(float_t& x, float_t& y) { if (get_type() != type::Float2) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -346,7 +346,7 @@ void gs::effect_parameter::get_float3(float_t& x, float_t& y, float_t& z) { if (get_type() != type::Float3) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -361,7 +361,7 @@ void gs::effect_parameter::get_default_float3(float_t& x, float_t& y, float_t& z { if (get_type() != type::Float3) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -401,7 +401,7 @@ void gs::effect_parameter::get_float4(float_t& x, float_t& y, float_t& z, float_ { if (get_type() != type::Float4) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -417,7 +417,7 @@ void gs::effect_parameter::get_default_float4(float_t& x, float_t& y, float_t& z { if (get_type() != type::Float4) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(float_t)); @@ -440,7 +440,7 @@ void gs::effect_parameter::get_int(int32_t& x) { if ((get_type() != type::Integer) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); bfree(ptr); @@ -453,7 +453,7 @@ void gs::effect_parameter::get_default_int(int32_t& x) { if ((get_type() != type::Integer) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); bfree(ptr); @@ -474,7 +474,7 @@ void gs::effect_parameter::get_int2(int32_t& x, int32_t& y) { if ((get_type() != type::Integer2) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -488,7 +488,7 @@ void gs::effect_parameter::get_default_int2(int32_t& x, int32_t& y) { if ((get_type() != type::Integer2) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -510,7 +510,7 @@ void gs::effect_parameter::get_int3(int32_t& x, int32_t& y, int32_t& z) { if ((get_type() != type::Integer3) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -525,7 +525,7 @@ void gs::effect_parameter::get_default_int3(int32_t& x, int32_t& y, int32_t& z) { if ((get_type() != type::Integer3) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -548,7 +548,7 @@ void gs::effect_parameter::get_int4(int32_t& x, int32_t& y, int32_t& z, int32_t& { if ((get_type() != type::Integer4) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -564,7 +564,7 @@ void gs::effect_parameter::get_default_int4(int32_t& x, int32_t& y, int32_t& z, { if ((get_type() != type::Integer4) && (get_type() != type::Unknown)) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { x = *reinterpret_cast(ptr); y = *reinterpret_cast(ptr + sizeof(int32_t)); @@ -587,7 +587,7 @@ void gs::effect_parameter::get_matrix(matrix4& v) { if (get_type() != type::Matrix) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { v.x.x = *reinterpret_cast(ptr + sizeof(float_t) * 0); v.x.y = *reinterpret_cast(ptr + sizeof(float_t) * 1); @@ -618,7 +618,7 @@ void gs::effect_parameter::get_default_matrix(matrix4& v) { if (get_type() != type::Matrix) throw std::bad_cast(); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { v.x.x = *reinterpret_cast(ptr + sizeof(float_t) * 0); v.x.y = *reinterpret_cast(ptr + sizeof(float_t) * 1); @@ -684,10 +684,10 @@ void gs::effect_parameter::get_string(std::string& v) { if (get_type() != type::String) throw std::bad_cast(); - std::size_t ptr_len = gs_effect_get_val_size(get()); - std::uint8_t* ptr = static_cast(gs_effect_get_val(get())); + std::size_t ptr_len = gs_effect_get_val_size(get()); + uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { - v = std::string(reinterpret_cast(ptr), reinterpret_cast(ptr) + ptr_len - 1); + v = std::string(reinterpret_cast(ptr), reinterpret_cast(ptr) + ptr_len - 1); bfree(ptr); } else { v = ""; @@ -698,10 +698,10 @@ void gs::effect_parameter::get_default_string(std::string& v) { if (get_type() != type::String) throw std::bad_cast(); - std::size_t ptr_len = gs_effect_get_default_val_size(get()); - std::uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); + std::size_t ptr_len = gs_effect_get_default_val_size(get()); + uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { - v = std::string(reinterpret_cast(ptr), reinterpret_cast(ptr) + ptr_len - 1); + v = std::string(reinterpret_cast(ptr), reinterpret_cast(ptr) + ptr_len - 1); bfree(ptr); } else { v = ""; diff --git a/source/obs/gs/gs-indexbuffer.cpp b/source/obs/gs/gs-indexbuffer.cpp index e559d04f..e7c7767a 100644 --- a/source/obs/gs/gs-indexbuffer.cpp +++ b/source/obs/gs/gs-indexbuffer.cpp @@ -22,7 +22,7 @@ #include "gs-limits.hpp" #include "obs/gs/gs-helper.hpp" -gs::index_buffer::index_buffer(std::uint32_t maximumVertices) +gs::index_buffer::index_buffer(uint32_t maximumVertices) { this->reserve(maximumVertices); auto gctx = gs::context(); diff --git a/source/obs/gs/gs-indexbuffer.hpp b/source/obs/gs/gs-indexbuffer.hpp index b483ecc6..de6fb4be 100644 --- a/source/obs/gs/gs-indexbuffer.hpp +++ b/source/obs/gs/gs-indexbuffer.hpp @@ -24,7 +24,7 @@ namespace gs { class index_buffer : public std::vector { public: - index_buffer(std::uint32_t maximumVertices); + index_buffer(uint32_t maximumVertices); index_buffer(); index_buffer(index_buffer& other); index_buffer(std::vector& other); diff --git a/source/obs/gs/gs-limits.hpp b/source/obs/gs/gs-limits.hpp index 651853ac..155cfaf1 100644 --- a/source/obs/gs/gs-limits.hpp +++ b/source/obs/gs/gs-limits.hpp @@ -21,6 +21,6 @@ #include "common.hpp" namespace gs { - static const std::uint32_t MAXIMUM_VERTICES = 0xFFFFFFu; - static const std::uint32_t MAXIMUM_UVW_LAYERS = 8u; + static const uint32_t MAXIMUM_VERTICES = 0xFFFFFFu; + static const uint32_t MAXIMUM_UVW_LAYERS = 8u; } // namespace gs diff --git a/source/obs/gs/gs-mipmapper.cpp b/source/obs/gs/gs-mipmapper.cpp index 50a33668..f69319a5 100644 --- a/source/obs/gs/gs-mipmapper.cpp +++ b/source/obs/gs/gs-mipmapper.cpp @@ -45,7 +45,7 @@ gs::mipmapper::~mipmapper() gs::mipmapper::mipmapper() { - _vb = std::make_unique(uint32_t(3u), std::uint8_t(1u)); + _vb = std::make_unique(uint32_t(3u), uint8_t(1u)); { auto vtx = _vb->at(0); @@ -211,7 +211,7 @@ void gs::mipmapper::rebuild(std::shared_ptr source, std::shared_ptr if (gs_get_device_type() == GS_DEVICE_DIRECT3D_11) { ID3D11Texture2D* rtt = reinterpret_cast(gs_texture_get_obj(_rt->get_texture()->get_object())); - std::uint32_t level = uint32_t(D3D11CalcSubresource(UINT(mip), 0, UINT(max_mip_level))); + uint32_t level = uint32_t(D3D11CalcSubresource(UINT(mip), 0, UINT(max_mip_level))); D3D11_BOX box = {0, 0, 0, cwidth, cheight, 1}; d3d_context->CopySubresourceRegion(d3d_target, level, 0, 0, 0, rtt, 0, &box); diff --git a/source/obs/gs/gs-rendertarget.cpp b/source/obs/gs/gs-rendertarget.cpp index ba8a9260..1b4ba67f 100644 --- a/source/obs/gs/gs-rendertarget.cpp +++ b/source/obs/gs/gs-rendertarget.cpp @@ -38,7 +38,7 @@ gs::rendertarget::rendertarget(gs_color_format colorFormat, gs_zstencil_format z } } -gs::rendertarget_op gs::rendertarget::render(std::uint32_t width, std::uint32_t height) +gs::rendertarget_op gs::rendertarget::render(uint32_t width, uint32_t height) { return {this, width, height}; } @@ -80,7 +80,7 @@ gs_zstencil_format gs::rendertarget::get_zstencil_format() return _zstencil_format; } -gs::rendertarget_op::rendertarget_op(gs::rendertarget* rt, std::uint32_t width, std::uint32_t height) : parent(rt) +gs::rendertarget_op::rendertarget_op(gs::rendertarget* rt, uint32_t width, uint32_t height) : parent(rt) { if (parent == nullptr) throw std::invalid_argument("rt"); diff --git a/source/obs/gs/gs-rendertarget.hpp b/source/obs/gs/gs-rendertarget.hpp index cc11b213..561acd69 100644 --- a/source/obs/gs/gs-rendertarget.hpp +++ b/source/obs/gs/gs-rendertarget.hpp @@ -53,7 +53,7 @@ namespace gs { gs_zstencil_format get_zstencil_format(); - gs::rendertarget_op render(std::uint32_t width, std::uint32_t height); + gs::rendertarget_op render(uint32_t width, uint32_t height); }; class rendertarget_op { @@ -62,7 +62,7 @@ namespace gs { public: ~rendertarget_op(); - rendertarget_op(gs::rendertarget* rt, std::uint32_t width, std::uint32_t height); + rendertarget_op(gs::rendertarget* rt, uint32_t width, uint32_t height); // Move Constructor rendertarget_op(gs::rendertarget_op&&); diff --git a/source/obs/gs/gs-sampler.cpp b/source/obs/gs/gs-sampler.cpp index 061a8201..98e13642 100644 --- a/source/obs/gs/gs-sampler.cpp +++ b/source/obs/gs/gs-sampler.cpp @@ -77,36 +77,36 @@ gs_address_mode gs::sampler::get_address_mode_w() return _sampler_info.address_w; } -void gs::sampler::set_max_anisotropy(std::int32_t v) +void gs::sampler::set_max_anisotropy(int32_t v) { _dirty = true; _sampler_info.max_anisotropy = v; } -std::int32_t gs::sampler::get_max_anisotropy() +int32_t gs::sampler::get_max_anisotropy() { return _sampler_info.max_anisotropy; } -void gs::sampler::set_border_color(std::uint32_t v) +void gs::sampler::set_border_color(uint32_t v) { _dirty = true; _sampler_info.border_color = v; } -void gs::sampler::set_border_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a) +void gs::sampler::set_border_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { _dirty = true; - _sampler_info.border_color = (static_cast(a) << 24) | (static_cast(r) << 16) - | (static_cast(g) << 8) | static_cast(b); + _sampler_info.border_color = (static_cast(a) << 24) | (static_cast(r) << 16) + | (static_cast(g) << 8) | static_cast(b); } -std::uint32_t gs::sampler::get_border_color() +uint32_t gs::sampler::get_border_color() { return _sampler_info.border_color; } -std::uint8_t gs::sampler::get_border_color(bool r, bool g, bool b, bool a) +uint8_t gs::sampler::get_border_color(bool r, bool g, bool b, bool a) { if (a) return (_sampler_info.border_color >> 24) & 0xFF; diff --git a/source/obs/gs/gs-sampler.hpp b/source/obs/gs/gs-sampler.hpp index d34603c4..9f1eba6a 100644 --- a/source/obs/gs/gs-sampler.hpp +++ b/source/obs/gs/gs-sampler.hpp @@ -38,13 +38,13 @@ namespace gs { void set_address_mode_w(gs_address_mode v); gs_address_mode get_address_mode_w(); - void set_max_anisotropy(std::int32_t v); + void set_max_anisotropy(int32_t v); int get_max_anisotropy(); - void set_border_color(std::uint32_t v); - void set_border_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a); - std::uint32_t get_border_color(); - std::uint8_t get_border_color(bool r, bool g, bool b, bool a); + void set_border_color(uint32_t v); + void set_border_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a); + uint32_t get_border_color(); + uint8_t get_border_color(bool r, bool g, bool b, bool a); gs_sampler_state* refresh(); diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index db495e34..a49d6a1c 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -23,9 +23,9 @@ #include #include "obs/gs/gs-helper.hpp" -static std::uint32_t decode_flags(gs::texture::flags texture_flags) +static uint32_t decode_flags(gs::texture::flags texture_flags) { - std::uint32_t flags = 0; + uint32_t flags = 0; if (exact(texture_flags, gs::texture::flags::Dynamic)) flags |= GS_DYNAMIC; if (exact(texture_flags, gs::texture::flags::BuildMipMaps)) @@ -33,8 +33,8 @@ static std::uint32_t decode_flags(gs::texture::flags texture_flags) return flags; } -gs::texture::texture(std::uint32_t width, std::uint32_t height, gs_color_format format, std::uint32_t mip_levels, - const std::uint8_t** mip_data, gs::texture::flags texture_flags) +gs::texture::texture(uint32_t width, uint32_t height, gs_color_format format, uint32_t mip_levels, + const uint8_t** mip_data, gs::texture::flags texture_flags) { if (width == 0) throw std::logic_error("width must be at least 1"); @@ -60,8 +60,8 @@ gs::texture::texture(std::uint32_t width, std::uint32_t height, gs_color_format _type = type::Normal; } -gs::texture::texture(std::uint32_t width, std::uint32_t height, std::uint32_t depth, gs_color_format format, - std::uint32_t mip_levels, const std::uint8_t** mip_data, gs::texture::flags texture_flags) +gs::texture::texture(uint32_t width, uint32_t height, uint32_t depth, gs_color_format format, uint32_t mip_levels, + const uint8_t** mip_data, gs::texture::flags texture_flags) { if (width == 0) throw std::logic_error("width must be at least 1"); @@ -92,8 +92,8 @@ gs::texture::texture(std::uint32_t width, std::uint32_t height, std::uint32_t de _type = type::Volume; } -gs::texture::texture(std::uint32_t size, gs_color_format format, std::uint32_t mip_levels, - const std::uint8_t** mip_data, gs::texture::flags texture_flags) +gs::texture::texture(uint32_t size, gs_color_format format, uint32_t mip_levels, const uint8_t** mip_data, + gs::texture::flags texture_flags) { if (size == 0) throw std::logic_error("size must be at least 1"); @@ -149,7 +149,7 @@ gs::texture::~texture() _texture = nullptr; } -void gs::texture::load(std::int32_t unit) +void gs::texture::load(int32_t unit) { auto gctx = gs::context(); gs_load_texture(_texture, unit); @@ -160,7 +160,7 @@ gs_texture_t* gs::texture::get_object() return _texture; } -std::uint32_t gs::texture::get_width() +uint32_t gs::texture::get_width() { switch (_type) { case type::Normal: @@ -173,7 +173,7 @@ std::uint32_t gs::texture::get_width() return 0; } -std::uint32_t gs::texture::get_height() +uint32_t gs::texture::get_height() { switch (_type) { case type::Normal: @@ -186,7 +186,7 @@ std::uint32_t gs::texture::get_height() return 0; } -std::uint32_t gs::texture::get_depth() +uint32_t gs::texture::get_depth() { switch (_type) { case type::Normal: diff --git a/source/obs/gs/gs-texture.hpp b/source/obs/gs/gs-texture.hpp index 75b2a928..dd93fb15 100644 --- a/source/obs/gs/gs-texture.hpp +++ b/source/obs/gs/gs-texture.hpp @@ -23,9 +23,9 @@ namespace gs { class texture { public: - enum class type : std::uint8_t { Normal, Volume, Cube }; + enum class type : uint8_t { Normal, Volume, Cube }; - enum class flags : std::uint8_t { + enum class flags : uint8_t { None, Dynamic, BuildMipMaps, @@ -49,8 +49,8 @@ namespace gs { * \param mip_data Texture data including mipmaps * \param texture_flags Texture Flags */ - texture(std::uint32_t width, std::uint32_t height, gs_color_format format, std::uint32_t mip_levels, - const std::uint8_t** mip_data, gs::texture::flags texture_flags); + texture(uint32_t width, uint32_t height, gs_color_format format, uint32_t mip_levels, const uint8_t** mip_data, + gs::texture::flags texture_flags); /*! * \brief Create a 3D Texture @@ -63,8 +63,8 @@ namespace gs { * \param mip_data Texture data including mipmaps * \param texture_flags Texture Flags */ - texture(std::uint32_t width, std::uint32_t height, std::uint32_t depth, gs_color_format format, - std::uint32_t mip_levels, const std::uint8_t** mip_data, gs::texture::flags texture_flags); + texture(uint32_t width, uint32_t height, uint32_t depth, gs_color_format format, uint32_t mip_levels, + const uint8_t** mip_data, gs::texture::flags texture_flags); /*! * \brief Create a Cube Texture @@ -75,7 +75,7 @@ namespace gs { * \param mip_data Texture data including mipmaps * \param texture_flags Texture Flags */ - texture(std::uint32_t size, gs_color_format format, std::uint32_t mip_levels, const std::uint8_t** mip_data, + texture(uint32_t size, gs_color_format format, uint32_t mip_levels, const uint8_t** mip_data, gs::texture::flags texture_flags); /*! @@ -95,15 +95,15 @@ namespace gs { */ texture(gs_texture_t* tex, bool takeOwnership = false) : _texture(tex), _is_owner(takeOwnership) {} - void load(std::int32_t unit); + void load(int32_t unit); gs_texture_t* get_object(); - std::uint32_t get_width(); + uint32_t get_width(); - std::uint32_t get_height(); + uint32_t get_height(); - std::uint32_t get_depth(); + uint32_t get_depth(); gs::texture::type get_type(); diff --git a/source/obs/obs-encoder-factory.hpp b/source/obs/obs-encoder-factory.hpp index 4b6624db..668a3b9c 100644 --- a/source/obs/obs-encoder-factory.hpp +++ b/source/obs/obs-encoder-factory.hpp @@ -173,9 +173,9 @@ namespace obs { try { auto priv = reinterpret_cast(data); if (priv) { - std::uint64_t version = static_cast(obs_data_get_int(settings, S_VERSION)); + uint64_t version = static_cast(obs_data_get_int(settings, S_VERSION)); priv->migrate(settings, version); - obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); + obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); obs_data_set_string(settings, S_COMMIT, STREAMFX_COMMIT); return priv->update(settings); } @@ -303,7 +303,7 @@ namespace obs { encoder_instance(obs_data_t* settings, obs_encoder_t* self, bool is_hw) : _self(self) {} virtual ~encoder_instance(){}; - virtual void migrate(obs_data_t* settings, std::uint64_t version) {} + virtual void migrate(obs_data_t* settings, uint64_t version) {} virtual bool update(obs_data_t* settings) { diff --git a/source/obs/obs-source-factory.hpp b/source/obs/obs-source-factory.hpp index 79c0f662..dd372b6f 100644 --- a/source/obs/obs-source-factory.hpp +++ b/source/obs/obs-source-factory.hpp @@ -241,7 +241,7 @@ namespace obs { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } - static std::uint32_t _get_width(void* data) noexcept + static uint32_t _get_width(void* data) noexcept try { if (data) return reinterpret_cast<_instance*>(data)->get_width(); @@ -254,7 +254,7 @@ namespace obs { return 0; } - static std::uint32_t _get_height(void* data) noexcept + static uint32_t _get_height(void* data) noexcept try { if (data) return reinterpret_cast<_instance*>(data)->get_height(); @@ -367,9 +367,9 @@ namespace obs { try { auto priv = reinterpret_cast<_instance*>(data); if (priv) { - std::uint64_t version = static_cast(obs_data_get_int(settings, S_VERSION)); + uint64_t version = static_cast(obs_data_get_int(settings, S_VERSION)); priv->migrate(settings, version); - obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); + obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); obs_data_set_string(settings, S_COMMIT, STREAMFX_COMMIT); priv->load(settings); } @@ -393,7 +393,7 @@ namespace obs { try { if (data) { reinterpret_cast<_instance*>(data)->save(settings); - obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); + obs_data_set_int(settings, S_VERSION, static_cast(STREAMFX_VERSION)); obs_data_set_string(settings, S_COMMIT, STREAMFX_COMMIT); } } catch (const std::exception& ex) { @@ -403,7 +403,7 @@ namespace obs { } static void _mouse_click(void* data, const struct obs_mouse_event* event, int32_t type, bool mouse_up, - std::uint32_t click_count) noexcept + uint32_t click_count) noexcept try { if (data) reinterpret_cast<_instance*>(data)->mouse_click(event, type, mouse_up, click_count); @@ -464,7 +464,7 @@ namespace obs { } static bool _audio_render(void* data, uint64_t* ts_out, struct obs_source_audio_mix* audio_output, - std::uint32_t mixers, std::size_t channels, std::size_t sample_rate) noexcept + uint32_t mixers, std::size_t channels, std::size_t sample_rate) noexcept try { if (data) return reinterpret_cast<_instance*>(data)->audio_render(ts_out, audio_output, mixers, channels, @@ -549,12 +549,12 @@ namespace obs { source_instance(obs_data_t* settings, obs_source_t* source) : _self(source) {} virtual ~source_instance(){}; - virtual std::uint32_t get_width() + virtual uint32_t get_width() { return 0; } - virtual std::uint32_t get_height() + virtual uint32_t get_height() { return 0; } @@ -585,19 +585,18 @@ namespace obs { virtual void load(obs_data_t* settings) {} - virtual void migrate(obs_data_t* settings, std::uint64_t version) {} + virtual void migrate(obs_data_t* settings, uint64_t version) {} virtual void update(obs_data_t* settings) {} virtual void save(obs_data_t* settings) {} - virtual void mouse_click(const struct obs_mouse_event* event, std::int32_t type, bool mouse_up, - std::uint32_t click_count) + virtual void mouse_click(const struct obs_mouse_event* event, int32_t type, bool mouse_up, uint32_t click_count) {} virtual void mouse_move(const struct obs_mouse_event* event, bool mouse_leave) {} - virtual void mouse_wheel(const struct obs_mouse_event* event, std::int32_t x_delta, std::int32_t y_delta) {} + virtual void mouse_wheel(const struct obs_mouse_event* event, int32_t x_delta, int32_t y_delta) {} virtual void focus(bool focus) {} @@ -605,8 +604,8 @@ namespace obs { virtual void filter_remove(obs_source_t* source) {} - virtual bool audio_render(std::uint64_t* ts_out, struct obs_source_audio_mix* audio_output, - std::uint32_t mixers, std::size_t channels, std::size_t sample_rate) + virtual bool audio_render(uint64_t* ts_out, struct obs_source_audio_mix* audio_output, uint32_t mixers, + std::size_t channels, std::size_t sample_rate) { return false; } @@ -617,7 +616,7 @@ namespace obs { virtual void transition_stop() {} - virtual bool audio_mix(std::uint64_t* ts_out, struct audio_output_data* audio_output, std::size_t channels, + virtual bool audio_mix(uint64_t* ts_out, struct audio_output_data* audio_output, std::size_t channels, std::size_t sample_rate) { return false; diff --git a/source/obs/obs-source-tracker.cpp b/source/obs/obs-source-tracker.cpp index bcf2816b..fe632a62 100644 --- a/source/obs/obs-source-tracker.cpp +++ b/source/obs/obs-source-tracker.cpp @@ -190,13 +190,13 @@ bool obs::source_tracker::filter_sources(std::string, obs_source_t* source) bool obs::source_tracker::filter_audio_sources(std::string, obs_source_t* source) { - std::uint32_t flags = obs_source_get_output_flags(source); + uint32_t flags = obs_source_get_output_flags(source); return !(flags & OBS_SOURCE_AUDIO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); } bool obs::source_tracker::filter_video_sources(std::string, obs_source_t* source) { - std::uint32_t flags = obs_source_get_output_flags(source); + uint32_t flags = obs_source_get_output_flags(source); return !(flags & OBS_SOURCE_VIDEO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); } diff --git a/source/obs/obs-source.cpp b/source/obs/obs-source.cpp index 737c865c..ffc9ddbf 100644 --- a/source/obs/obs-source.cpp +++ b/source/obs/obs-source.cpp @@ -798,7 +798,7 @@ void* obs::deprecated_source::type_data() return obs_source_get_type_data(_self); } -std::uint32_t obs::deprecated_source::width() +uint32_t obs::deprecated_source::width() { if (!_self) { return 0; @@ -806,7 +806,7 @@ std::uint32_t obs::deprecated_source::width() return obs_source_get_width(_self); } -std::uint32_t obs::deprecated_source::height() +uint32_t obs::deprecated_source::height() { if (!_self) { return 0; diff --git a/source/obs/obs-source.hpp b/source/obs/obs-source.hpp index 102ac452..337b5d58 100644 --- a/source/obs/obs-source.hpp +++ b/source/obs/obs-source.hpp @@ -76,8 +76,8 @@ namespace obs { void* type_data(); - std::uint32_t width(); - std::uint32_t height(); + uint32_t width(); + uint32_t height(); bool destroyed(); diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index ead84d49..6731a660 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -105,7 +105,7 @@ struct _hack_obs_property { struct _hack_obs_properties { void* param; void (*destroy)(void* param); - std::uint32_t flags; + uint32_t flags; struct _hack_obs_property* first_property; struct _hack_obs_property** last; diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index 64935251..a2a575aa 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -81,12 +81,12 @@ mirror_instance::~mirror_instance() release(); } -std::uint32_t mirror_instance::get_width() +uint32_t mirror_instance::get_width() { return _source_size.first; } -std::uint32_t mirror_instance::get_height() +uint32_t mirror_instance::get_height() { return _source_size.second; } @@ -96,7 +96,7 @@ void mirror_instance::load(obs_data_t* data) update(data); } -void mirror_instance::migrate(obs_data_t* data, std::uint64_t version) +void mirror_instance::migrate(obs_data_t* data, uint64_t version) { switch (version) { case 0: diff --git a/source/sources/source-mirror.hpp b/source/sources/source-mirror.hpp index 6ae7557a..6884949d 100644 --- a/source/sources/source-mirror.hpp +++ b/source/sources/source-mirror.hpp @@ -36,8 +36,8 @@ namespace streamfx::source::mirror { struct mirror_audio_data { mirror_audio_data(const audio_data*, speaker_layout); - obs_source_audio osa; - std::vector> data; + obs_source_audio osa; + std::vector> data; }; class mirror_instance : public obs::source_instance { @@ -58,11 +58,11 @@ namespace streamfx::source::mirror { mirror_instance(obs_data_t* settings, obs_source_t* self); virtual ~mirror_instance(); - virtual std::uint32_t get_width() override; - virtual std::uint32_t get_height() override; + virtual uint32_t get_width() override; + virtual uint32_t get_height() override; virtual void load(obs_data_t*) override; - virtual void migrate(obs_data_t*, std::uint64_t) override; + virtual void migrate(obs_data_t*, uint64_t) override; virtual void update(obs_data_t*) override; virtual void save(obs_data_t*) override; diff --git a/source/sources/source-shader.cpp b/source/sources/source-shader.cpp index aa60c958..606a2bc2 100644 --- a/source/sources/source-shader.cpp +++ b/source/sources/source-shader.cpp @@ -35,12 +35,12 @@ shader_instance::shader_instance(obs_data_t* data, obs_source_t* self) : obs::so shader_instance::~shader_instance() {} -std::uint32_t shader_instance::get_width() +uint32_t shader_instance::get_width() { return _fx->width(); } -std::uint32_t shader_instance::get_height() +uint32_t shader_instance::get_height() { return _fx->height(); } diff --git a/source/sources/source-shader.hpp b/source/sources/source-shader.hpp index eee9e2fd..a3fc253f 100644 --- a/source/sources/source-shader.hpp +++ b/source/sources/source-shader.hpp @@ -32,8 +32,8 @@ namespace streamfx::source::shader { shader_instance(obs_data_t* data, obs_source_t* self); virtual ~shader_instance(); - virtual std::uint32_t get_width() override; - virtual std::uint32_t get_height() override; + virtual uint32_t get_width() override; + virtual uint32_t get_height() override; void properties(obs_properties_t* props); diff --git a/source/transitions/transition-shader.cpp b/source/transitions/transition-shader.cpp index 918608df..2c7a4fd0 100644 --- a/source/transitions/transition-shader.cpp +++ b/source/transitions/transition-shader.cpp @@ -35,12 +35,12 @@ shader_instance::shader_instance(obs_data_t* data, obs_source_t* self) : obs::so shader_instance::~shader_instance() {} -std::uint32_t shader_instance::get_width() +uint32_t shader_instance::get_width() { return _fx->width(); } -std::uint32_t shader_instance::get_height() +uint32_t shader_instance::get_height() { return _fx->height(); } @@ -84,13 +84,13 @@ void shader_instance::video_render(gs_effect_t* effect) gs::debug_marker gdmp{gs::debug_color_source, "Shader Transition '%s'", obs_source_get_name(_self)}; #endif - obs_transition_video_render( - _self, [](void* data, gs_texture_t* a, gs_texture_t* b, float t, std::uint32_t cx, std::uint32_t cy) { - reinterpret_cast(data)->transition_render(a, b, t, cx, cy); - }); + obs_transition_video_render(_self, + [](void* data, gs_texture_t* a, gs_texture_t* b, float t, uint32_t cx, uint32_t cy) { + reinterpret_cast(data)->transition_render(a, b, t, cx, cy); + }); } -void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, std::uint32_t cx, std::uint32_t cy) +void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, uint32_t cx, uint32_t cy) { _fx->set_input_a(std::make_shared<::gs::texture>(a, false)); _fx->set_input_b(std::make_shared<::gs::texture>(b, false)); @@ -100,7 +100,7 @@ void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float_ _fx->render(); } -bool shader_instance::audio_render(uint64_t* ts_out, obs_source_audio_mix* audio_output, std::uint32_t mixers, +bool shader_instance::audio_render(uint64_t* ts_out, obs_source_audio_mix* audio_output, uint32_t mixers, std::size_t channels, std::size_t sample_rate) { return obs_transition_audio_render( diff --git a/source/transitions/transition-shader.hpp b/source/transitions/transition-shader.hpp index 4766e410..b38cc125 100644 --- a/source/transitions/transition-shader.hpp +++ b/source/transitions/transition-shader.hpp @@ -32,8 +32,8 @@ namespace streamfx::transition::shader { shader_instance(obs_data_t* data, obs_source_t* self); virtual ~shader_instance(); - virtual std::uint32_t get_width() override; - virtual std::uint32_t get_height() override; + virtual uint32_t get_width() override; + virtual uint32_t get_height() override; void properties(obs_properties_t* props); @@ -43,9 +43,9 @@ namespace streamfx::transition::shader { virtual void video_tick(float_t sec_since_last) override; virtual void video_render(gs_effect_t* effect) override; - void transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, std::uint32_t cx, std::uint32_t cy); + void transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, uint32_t cx, uint32_t cy); - virtual bool audio_render(uint64_t* ts_out, struct obs_source_audio_mix* audio_output, std::uint32_t mixers, + virtual bool audio_render(uint64_t* ts_out, struct obs_source_audio_mix* audio_output, uint32_t mixers, std::size_t channels, std::size_t sample_rate) override; virtual void transition_start() override; diff --git a/source/ui/ui-about.hpp b/source/ui/ui-about.hpp index d00e6f7b..2774964b 100644 --- a/source/ui/ui-about.hpp +++ b/source/ui/ui-about.hpp @@ -35,7 +35,7 @@ namespace streamfx::ui { Q_OBJECT public: - enum class role_type : std::int32_t { + enum class role_type : int32_t { NONE, SPACER, THANKYOU, @@ -49,7 +49,7 @@ namespace streamfx::ui { CREATOR, }; - enum class link_type : std::int32_t { + enum class link_type : int32_t { NONE, GENERIC, diff --git a/source/util/util-profiler.hpp b/source/util/util-profiler.hpp index f6ec32c1..5d2a8b40 100644 --- a/source/util/util-profiler.hpp +++ b/source/util/util-profiler.hpp @@ -53,7 +53,7 @@ namespace util { void track(std::chrono::nanoseconds duration); - std::uint64_t count(); + uint64_t count(); std::chrono::nanoseconds total_duration(); diff --git a/source/util/utility.hpp b/source/util/utility.hpp index 35635693..8a604aec 100644 --- a/source/util/utility.hpp +++ b/source/util/utility.hpp @@ -98,17 +98,17 @@ namespace util { obs_property_t* obs_properties_add_tristate(obs_properties_t* props, const char* name, const char* desc); - inline bool is_tristate_enabled(std::int64_t tristate) + inline bool is_tristate_enabled(int64_t tristate) { return tristate == 1; } - inline bool is_tristate_disabled(std::int64_t tristate) + inline bool is_tristate_disabled(int64_t tristate) { return tristate == 0; } - inline bool is_tristate_default(std::int64_t tristate) + inline bool is_tristate_default(int64_t tristate) { return tristate == -1; } @@ -178,27 +178,27 @@ namespace util { { \ return is_power_of_two_loop(v); \ } - P_IS_POWER_OF_TWO_AS_LOOP(std::int8_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::uint8_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::int16_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::uint16_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::int32_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::uint32_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::int64_t) - P_IS_POWER_OF_TWO_AS_LOOP(std::uint64_t) + P_IS_POWER_OF_TWO_AS_LOOP(int8_t) + P_IS_POWER_OF_TWO_AS_LOOP(uint8_t) + P_IS_POWER_OF_TWO_AS_LOOP(int16_t) + P_IS_POWER_OF_TWO_AS_LOOP(uint16_t) + P_IS_POWER_OF_TWO_AS_LOOP(int32_t) + P_IS_POWER_OF_TWO_AS_LOOP(uint32_t) + P_IS_POWER_OF_TWO_AS_LOOP(int64_t) + P_IS_POWER_OF_TWO_AS_LOOP(uint64_t) #undef P_IS_POWER_OF_TWO_AS_LOOP #pragma pop_macro("P_IS_POWER_OF_TWO_AS_LOOP") template - inline std::uint64_t get_power_of_two_exponent_floor(T v) + inline uint64_t get_power_of_two_exponent_floor(T v) { - return std::uint64_t(floor(log10(T(v)) / log10(2.0))); + return uint64_t(floor(log10(T(v)) / log10(2.0))); } template - inline std::uint64_t get_power_of_two_exponent_ceil(T v) + inline uint64_t get_power_of_two_exponent_ceil(T v) { - return std::uint64_t(ceil(log10(T(v)) / log10(2.0))); + return uint64_t(ceil(log10(T(v)) / log10(2.0))); } template