Skip to content

Commit

Permalink
Fixed compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dimiden committed Dec 27, 2024
1 parent d736c00 commit ad9f3bf
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/projects/base/info/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ namespace info
class Application
{
public:
virtual ~Application() = default;

virtual const char *GetApplicationTypeName()
{
return "ApplicationInfo";
Expand Down
2 changes: 2 additions & 0 deletions src/projects/base/info/decoder_configuration_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
class DecoderConfigurationRecord
{
public:
virtual ~DecoderConfigurationRecord() = default;

std::shared_ptr<const ov::Data> GetData()
{
if (_updated)
Expand Down
4 changes: 2 additions & 2 deletions src/projects/base/ovlibrary/dump_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ namespace ov
if (offset > 0)
{
// ========== xxxxx 0x12345678 + 0xABCDEF01 (102400 / 1024000) ==========
dump.AppendFormat("%s========== %s 0x%08X + 0x%08X (%d/%" PRIi64 " bytes) ==========", line_prefix, title, data, offset, dump_bytes, length);
dump.AppendFormat("%s========== %s 0x%08llX + 0x%08llX (%d/%" PRIi64 " bytes) ==========", line_prefix, title, data, offset, dump_bytes, length);
}
else
{
// ========== xxxxx 0x12345678 (102400 / 1024000) ==========
dump.AppendFormat("%s========== %s 0x%08X (%d/%" PRIi64 " bytes) ==========", line_prefix, title, data, dump_bytes, length);
dump.AppendFormat("%s========== %s 0x%08llX (%d/%" PRIi64 " bytes) ==========", line_prefix, title, data, dump_bytes, length);
}

if (dump_bytes == 0L)
Expand Down
17 changes: 14 additions & 3 deletions src/projects/base/ovlibrary/memory_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@
#if __cplusplus
namespace ov
{
template <typename T, typename std::enable_if_t<std::is_enum_v<T>, int> = 0>
template <typename T, typename = std::enable_if_t<std::is_enum_v<T>>, typename U = typename std::underlying_type_t<T>>
inline bool CheckFlag(const T &lhs, const T &rhs)
{
using U = typename std::underlying_type<T>::type;
return OV_CHECK_FLAG(static_cast<U>(lhs), static_cast<U>(rhs));
return OV_CHECK_FLAG(static_cast<const U>(lhs), static_cast<const U>(rhs));
}

template <typename T, typename = std::enable_if_t<std::is_enum_v<T>>, typename U = typename std::underlying_type_t<T>>
inline bool CheckFlag(const T &lhs, const U &rhs)
{
return OV_CHECK_FLAG(static_cast<const U>(lhs), static_cast<const U>(rhs));
}

template <typename T, typename = std::enable_if_t<std::is_enum_v<T>>, typename U = typename std::underlying_type_t<T>>
inline bool CheckFlag(const U &lhs, const T &rhs)
{
return OV_CHECK_FLAG(static_cast<const U>(lhs), static_cast<const U>(rhs));
}
} // namespace ov
#endif // __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/rtp_rtcp/rtp_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void RtpPacket::SetExtensions(const RtpHeaderExtensions& extensions)

// Write Extensions
auto extensions_map = extensions.GetMap();
for(const auto [id, extension] : extensions_map)
for(const auto &[id, extension] : extensions_map)
{
_extension_buffer_offset[id] = offset;

Expand Down
2 changes: 2 additions & 0 deletions src/projects/modules/segment_writer/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,8 @@ bool Writer::WritePacket(const std::shared_ptr<const MediaPacket> &packet)
[[fallthrough]];
case cmn::BitstreamFormat::OVEN_EVENT:
[[fallthrough]];
case cmn::BitstreamFormat::CUE:
[[fallthrough]];
case cmn::BitstreamFormat::PNG:
break;
}
Expand Down
5 changes: 4 additions & 1 deletion src/projects/monitoring/application_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ namespace mon
~ApplicationMetrics()
{
_host_metrics.reset();

std::unique_lock<std::shared_mutex> lock(_streams_guard);
_streams.clear();
}

void Release()
{
std::unique_lock<std::shared_mutex> lock(_streams_guard);
_streams.clear();
}

Expand Down Expand Up @@ -67,4 +70,4 @@ namespace mon
mutable std::shared_mutex _reserved_streams_guard;
std::map<uint32_t, std::shared_ptr<ReservedStreamMetrics>> _reserved_streams;
};
} // namespace mon
} // namespace mon
9 changes: 7 additions & 2 deletions src/projects/monitoring/host_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ namespace mon

void Release()
{
for (const auto &app : _applications)
std::map<uint32_t, std::shared_ptr<ApplicationMetrics>> applications;
{
std::unique_lock<std::shared_mutex> lock(_map_guard);
applications = std::move(_applications);
}

for (const auto &app : applications)
{
app.second->Release();
}
_applications.clear();
}

ov::String GetInfoString(bool show_children = true) override;
Expand Down
2 changes: 1 addition & 1 deletion src/projects/transcoder/transcoder_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void TranscodeEncoder::SendBuffer(std::shared_ptr<const MediaFrame> frame)

void TranscodeEncoder::SetCompleteHandler(CompleteHandler complete_handler)
{
_complete_handler = move(complete_handler);
_complete_handler = std::move(complete_handler);
}

void TranscodeEncoder::Complete(std::shared_ptr<MediaPacket> packet)
Expand Down

0 comments on commit ad9f3bf

Please sign in to comment.