diff --git a/source/encoders/generic.cpp b/source/encoders/generic.cpp index b875f83..a5e87b1 100644 --- a/source/encoders/generic.cpp +++ b/source/encoders/generic.cpp @@ -803,7 +803,7 @@ int encoder::generic::receive_packet(bool* received_packet, struct encoder_packe return res; } -int encoder::generic::send_frame(std::shared_ptr frame) +int encoder::generic::send_frame(std::shared_ptr const frame) { int res = avcodec_send_frame(this->context, frame.get()); switch (res) { diff --git a/source/ffmpeg/avframe-queue.cpp b/source/ffmpeg/avframe-queue.cpp index 06a5b98..29edcd2 100644 --- a/source/ffmpeg/avframe-queue.cpp +++ b/source/ffmpeg/avframe-queue.cpp @@ -45,7 +45,7 @@ ffmpeg::avframe_queue::~avframe_queue() clear(); } -void ffmpeg::avframe_queue::set_resolution(uint32_t width, uint32_t height) +void ffmpeg::avframe_queue::set_resolution(uint32_t const width, uint32_t const height) { this->resolution.first = width; this->resolution.second = height; @@ -67,7 +67,7 @@ uint32_t ffmpeg::avframe_queue::get_height() return this->resolution.second; } -void ffmpeg::avframe_queue::set_pixel_format(AVPixelFormat format) +void ffmpeg::avframe_queue::set_pixel_format(AVPixelFormat const format) { this->format = format; } @@ -90,7 +90,7 @@ void ffmpeg::avframe_queue::clear() frames.clear(); } -void ffmpeg::avframe_queue::push(std::shared_ptr frame) +void ffmpeg::avframe_queue::push(std::shared_ptr const frame) { std::unique_lock ulock(this->lock); frames.push_back(frame); diff --git a/source/ffmpeg/swscale.cpp b/source/ffmpeg/swscale.cpp index 564c13a..9bbb4b3 100644 --- a/source/ffmpeg/swscale.cpp +++ b/source/ffmpeg/swscale.cpp @@ -176,8 +176,8 @@ bool ffmpeg::swscale::initialize(int flags) } sws_setColorspaceDetails(this->context, sws_getCoefficients(source_colorspace), source_full_range ? 1 : 0, - sws_getCoefficients(target_colorspace), target_full_range ? 1 : 0, 1l << 16 | 0l, - 1l << 16 | 0l, 1l << 16 | 0l); + sws_getCoefficients(target_colorspace), target_full_range ? 1 : 0, 1L << 16 | 0l, + 1L << 16 | 0l, 1L << 16 | 0l); return true; } diff --git a/source/ffmpeg/tools.cpp b/source/ffmpeg/tools.cpp index 38edf2c..f628070 100644 --- a/source/ffmpeg/tools.cpp +++ b/source/ffmpeg/tools.cpp @@ -64,7 +64,7 @@ std::string ffmpeg::tools::translate_encoder_capabilities(int capabilities) }; std::stringstream sstr; - for (auto kv : caps) { + for (auto const kv : caps) { if (capabilities & kv.first) { capabilities &= ~kv.first; sstr << kv.second; diff --git a/source/plugin.cpp b/source/plugin.cpp index 5832a77..4b9ee2c 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -45,12 +45,12 @@ std::list> obsffmpeg::finalizers; static std::map> codec_to_handler_map; static std::shared_ptr debug_handler = std::make_shared(); -void obsffmpeg::register_codec_handler(std::string codec, std::shared_ptr handler) +void obsffmpeg::register_codec_handler(std::string const codec, std::shared_ptr const handler) { codec_to_handler_map.emplace(codec, handler); } -std::shared_ptr obsffmpeg::find_codec_handler(std::string codec) +std::shared_ptr obsffmpeg::find_codec_handler(std::string const codec) { auto found = codec_to_handler_map.find(codec); if (found == codec_to_handler_map.end()) @@ -58,7 +58,7 @@ std::shared_ptr obsffmpeg::find_codec_handler(std::strin return found->second; } -bool obsffmpeg::has_codec_handler(std::string codec) +bool obsffmpeg::has_codec_handler(std::string const codec) { auto found = codec_to_handler_map.find(codec); return (found != codec_to_handler_map.end()); @@ -72,7 +72,7 @@ try { avcodec_register_all(); // Run all initializers. - for (auto func : obsffmpeg::initializers) { + for (auto const func : obsffmpeg::initializers) { func(); } @@ -91,7 +91,7 @@ try { obsffmpeg::encoder::prores_aw::initialize(); return true; -} catch (std::exception ex) { +} catch (std::exception const& ex) { PLOG_ERROR("Exception during initalization: %s.", ex.what()); return false; } catch (...) { @@ -104,10 +104,10 @@ try { obsffmpeg::encoder::prores_aw::finalize(); // Run all finalizers. - for (auto func : obsffmpeg::finalizers) { + for (auto const func : obsffmpeg::finalizers) { func(); } -} catch (std::exception ex) { +} catch (std::exception const& ex) { PLOG_ERROR("Exception during finalizing: %s.", ex.what()); } catch (...) { PLOG_ERROR("Unrecognized exception during finalizing.");