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 23, 2024
1 parent c47e875 commit b071cb2
Show file tree
Hide file tree
Showing 46 changed files with 64 additions and 51 deletions.
2 changes: 2 additions & 0 deletions src/projects/api_server/controllers/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ namespace api
class Controller : public ControllerInterface
{
public:
virtual ~Controller() = default;

void SetServer(const std::shared_ptr<Server> &server)
{
_server = server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ namespace api
const std::shared_ptr<mon::StreamMetrics> &stream,
const std::vector<std::shared_ptr<mon::StreamMetrics>> &output_streams)
{
logte("Called OnGetDummyAction. invoke [%s/%s/%s]", vhost->GetName().CStr(), app->GetVHostAppName().GetAppName(), stream->GetName().CStr());
logte("Called OnGetDummyAction. invoke [%s/%s/%s]", vhost->GetName().CStr(), app->GetVHostAppName().GetAppName().CStr(), stream->GetName().CStr());

return app->GetConfig().ToJson();
}
Expand Down
2 changes: 1 addition & 1 deletion src/projects/base/ovcrypto/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ov
return false;
}

size_t output_length = 0;
[[maybe_unused]] size_t output_length = 0;

EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
if (ctx == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/projects/base/ovlibrary/stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std::string_view Trim(const std::string_view &value)
return std::string_view(front, length);
}

std::string_view operator "" _str_v(const char *str, size_t length)
std::string_view operator""_str_v(const char *str, size_t length)
{
return std::string_view(str, length);
}
Expand Down
2 changes: 1 addition & 1 deletion src/projects/base/ovlibrary/stl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ bool HasSubstring(const std::string_view &value, size_t offset, const T (&substr
return value.substr(offset, substring_length) == std::string_view(substring, substring_length);
}

std::string_view operator "" _str_v(const char *str, size_t length);
std::string_view operator""_str_v(const char *str, size_t length);

bool CaseInsensitiveEqual(const std::string_view &first, const std::string_view &second);
2 changes: 1 addition & 1 deletion src/projects/base/ovsocket/socket_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ namespace ov
}

OV_ASSERT2(info != nullptr);
throw ov::SocketAddressError(ov::Error::CreateErrorFromErrno(), "getaddrinfo() returns invalid value: %s", host);
throw ov::SocketAddressError(ov::Error::CreateErrorFromErrno(), "getaddrinfo() returns invalid value: %s", host.CStr());
}

bool SocketAddress::Resolve(ov::String host, SocketAddress::StorageList *storage_list, bool *is_wildcard_host)
Expand Down
2 changes: 1 addition & 1 deletion src/projects/base/ovsocket/socket_datastructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace ov
}
}

struct SocketAddressPair;
class SocketAddressPair;

// For SocketPoolWorker callback
enum class PostProcessMethod
Expand Down
2 changes: 1 addition & 1 deletion src/projects/base/ovsocket/socket_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace ov
{
struct Socket;
class Socket;

String GetStat(Socket socket);

Expand Down
4 changes: 2 additions & 2 deletions src/projects/base/publisher/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ namespace pub

ov::ManagedQueue<std::shared_ptr<StreamData>> _stream_data_queue;

int64_t _last_video_ts_ms = 0;
int64_t _last_audio_ts_ms = 0;
[[maybe_unused]] int64_t _last_video_ts_ms = 0;
[[maybe_unused]] int64_t _last_audio_ts_ms = 0;

std::atomic<uint32_t> _stream_count = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/projects/config/config_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace mon

namespace cfg
{
class Server;
struct Server;

namespace serdes
{
Expand Down
2 changes: 1 addition & 1 deletion src/projects/mediarouter/mediarouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "mediarouter_application.h"
#include "mediarouter_stream.h"

class MediaRouter : public MediaRouterInterface, public ocst::MediaRouterModuleInterface
class MediaRouter final : public MediaRouterInterface, public ocst::MediaRouterModuleInterface
{
public:
static std::shared_ptr<MediaRouter> Create();
Expand Down
4 changes: 2 additions & 2 deletions src/projects/modules/access_control/access_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::tuple<AccessController::VerificationResult, std::shared_ptr<const Admission
}

// Probably this doesn't happen
logte("Could not find VirtualHost (%s)", vhost_name);
logte("Could not find VirtualHost (%s)", vhost_name.CStr());
return {AccessController::VerificationResult::Error, nullptr};
}

Expand Down Expand Up @@ -206,7 +206,7 @@ std::tuple<AccessController::VerificationResult, std::shared_ptr<const Admission
}

// Probably this doesn't happen
logte("Could not find VirtualHost (%s)", vhost_name);
logte("Could not find VirtualHost (%s)", vhost_name.CStr());
return {AccessController::VerificationResult::Error, nullptr};
}

Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/bitstream/aac/audio_specific_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AudioSpecificConfig : public DecoderConfigurationRecord
void SetChannel(uint8_t channel);

// Helpers
ov::String GetCodecsParameter() const;
ov::String GetCodecsParameter() const override;

protected:
// Table 1.16 - Syntax of GetAudioObjectType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace bmff
int64_t _start_timestamp_delta = -1;

double _max_chunk_duration_ms = 0;
double _min_chunk_duration_ms = std::numeric_limits<uint64_t>::max();
double _min_chunk_duration_ms = static_cast<double>(std::numeric_limits<uint64_t>::max());

int64_t _target_segment_duration_ms = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace mpegts
_tag = tag;
_data = data;
}
virtual ~Descriptor() = default;

std::shared_ptr<const ov::Data> Build()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ID3v2PrivFrame : public ID3v2Frame
SetPrivateData(private_data);
}

~ID3v2PrivFrame(){}
virtual ~ID3v2PrivFrame(){}

void SetOwner(const ov::String &owner)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ID3v2TextFrame : public ID3v2Frame
SetText(text);
}

~ID3v2TextFrame(){}
virtual ~ID3v2TextFrame(){}

void SetText(const ov::String &text)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ID3v2TxxxFrame : public ID3v2Frame
SetValue(value);
}

~ID3v2TxxxFrame(){}
virtual ~ID3v2TxxxFrame(){}

void SetDescription(const ov::String &description)
{
Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/data_format/id3v2/id3v2_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ID3v2Frame
{
public:
ID3v2Frame();
~ID3v2Frame();
virtual ~ID3v2Frame();

void SetFrameId(const ov::String &frame_id);

Expand Down
4 changes: 2 additions & 2 deletions src/projects/modules/dtls_srtp/dtls_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class DtlsTransport : public ov::Node
// Implementation of Node
//--------------------------------------------------------------------
// Receive data from upper node, and send data to lower node.
bool OnDataReceivedFromPrevNode(NodeType from_node, const std::shared_ptr<ov::Data> &data);
bool OnDataReceivedFromPrevNode(NodeType from_node, const std::shared_ptr<ov::Data> &data) override;
// Receive data from lower node, and send data to upper node.
bool OnDataReceivedFromNextNode(NodeType from_node, const std::shared_ptr<const ov::Data> &data);
bool OnDataReceivedFromNextNode(NodeType from_node, const std::shared_ptr<const ov::Data> &data) override;

// IcePort -> Publisher ->[queue] Application {thread}-> Session -> DtlsTransport -> SRTP -> RTP/RTCP
// ICE에서는 STUN을 제외한 모든 패킷을 위로 올린다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace http
return false;
}

auto _last_stream_id = ByteReader<uint32_t>::ReadBigEndian(payload_data + payload_offset);
[[maybe_unused]] auto _last_stream_id = ByteReader<uint32_t>::ReadBigEndian(payload_data + payload_offset);
payload_offset += sizeof(uint32_t);

// unset first bit (reserved)
Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/http/server/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace ocst
{
struct VirtualHost;
class VirtualHost;
}

namespace http
Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/ice/ice_tcp_demultiplexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IceTcpDemultiplexer

private:
IcePacketIdentifier::PacketType _type = IcePacketIdentifier::PacketType::UNKNOWN;
uint16_t _channel_number = 0; // Only use if packet is from channel data message
[[maybe_unused]] uint16_t _channel_number = 0; // Only use if packet is from channel data message
std::shared_ptr<ov::Data> _data = nullptr;
};

Expand Down
15 changes: 13 additions & 2 deletions src/projects/modules/rtmp/chunk/rtmp_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,27 @@ enum class RtmpCommand : uint16_t
AckError, // "_error"
};

constexpr bool ConstExprStrCmp(const char *str1, const char *str2)
{
while (*str1 && (*str1 == *str2))
{
++str1;
++str2;
}

return *str1 == *str2;
}

#define _DECLARE_STRING_TO_RTMP_COMMAND(enum_name, command) \
do \
{ \
if (::strcmp(name, command) == 0) \
if (ConstExprStrCmp(name, command)) \
{ \
return RtmpCommand::enum_name; \
} \
} while (false)

inline constexpr RtmpCommand RtmpCommandFromString(const char *name)
constexpr RtmpCommand RtmpCommandFromString(const char *name)
{
_DECLARE_STRING_TO_RTMP_COMMAND(Connect, "connect");
_DECLARE_STRING_TO_RTMP_COMMAND(Call, "call");
Expand Down
2 changes: 1 addition & 1 deletion src/projects/modules/rtp_rtcp/rtcp_info/sender_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SenderReport : public RtcpInfo

bool Parse(const RtcpPacket &packet) override;
std::shared_ptr<ov::Data> GetData() const override;
void DebugPrint();
void DebugPrint() override;

RtcpPacketType GetPacketType() const override
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ class RtpHeaderExtensionFrameMarking : public RtpHeaderExtension
uint8_t _temporal_id = 0;

// Not used
uint8_t _layer_id = 0;
uint8_t _tl0picidx = 0;
[[maybe_unused]] uint8_t _layer_id = 0;
[[maybe_unused]] uint8_t _tl0picidx = 0;
};
2 changes: 1 addition & 1 deletion src/projects/providers/rtmp/rtmp_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace pvd
if (rtmp_address_list.empty())
{
logte("Could not obtain IP list from IP(s): %s, port: %d",
ov::String::Join(server.GetIPList(), ", "),
ov::String::Join(server.GetIPList(), ", ").CStr(),
static_cast<uint16_t>(rtmp_config.GetPort().GetPort()));

return false;
Expand Down
2 changes: 1 addition & 1 deletion src/projects/providers/rtmp/rtmp_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ namespace pvd
ov::String message_name;
auto message_name_property = document.GetProperty(0);
auto message_name_type = (message_name_property != nullptr) ? message_name_property->GetType() : AmfTypeMarker::Undefined;
if ((message_name_type == AmfTypeMarker::String))
if (message_name_type == AmfTypeMarker::String)
{
message_name = message_name_property->GetString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/projects/providers/rtmp/rtmp_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace pvd
{
class RtmpStream : public pvd::PushStream
class RtmpStream final : public pvd::PushStream
{
public:
static std::shared_ptr<RtmpStream> Create(StreamSourceType source_type, uint32_t channel_id, const std::shared_ptr<ov::Socket> &client_socket, const std::shared_ptr<PushProvider> &provider);
Expand Down
2 changes: 1 addition & 1 deletion src/projects/providers/webrtc/webrtc_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace pvd
{
class WebRTCStream : public pvd::PushStream, public RtpRtcpInterface, public ov::Node
class WebRTCStream final : public pvd::PushStream, public RtpRtcpInterface, public ov::Node
{
public:
static std::shared_ptr<WebRTCStream> Create(StreamSourceType source_type, ov::String stream_name,
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/file/file_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace pub
{
class FileApplication : public pub::Application
class FileApplication final : public pub::Application
{
public:
static std::shared_ptr<FileApplication> Create(const std::shared_ptr<pub::Publisher> &publisher, const info::Application &application_info);
Expand Down
4 changes: 2 additions & 2 deletions src/projects/publishers/file/file_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace pub
{
class FileStream : public pub::Stream
class FileStream final : public pub::Stream
{
public:
static std::shared_ptr<FileStream> Create(const std::shared_ptr<pub::Application> application,
Expand All @@ -22,7 +22,7 @@ namespace pub
void SendFrame(const std::shared_ptr<MediaPacket> &media_packet);
void SendVideoFrame(const std::shared_ptr<MediaPacket> &media_packet) override;
void SendAudioFrame(const std::shared_ptr<MediaPacket> &media_packet) override;
void SendDataFrame(const std::shared_ptr<MediaPacket> &media_packet) override {} // Not supported
void SendDataFrame(const std::shared_ptr<MediaPacket> &media_packet) override {} // Not supported

std::shared_ptr<FileSession> CreateSession();
bool DeleteSession(uint32_t session_id);
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/hls/hls_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "hls_stream.h"

class HlsApplication : public pub::Application
class HlsApplication final : public pub::Application
{
public:
static std::shared_ptr<HlsApplication> Create(const std::shared_ptr<pub::Publisher> &publisher, const info::Application &application_info);
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/hls/hls_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// max initial media packet buffer size, for OOM protection
#define MAX_INITIAL_MEDIA_PACKET_BUFFER_SIZE 10000

class HlsStream : public pub::Stream, public mpegts::PackagerSink
class HlsStream final : public pub::Stream, public mpegts::PackagerSink
{
public:
static std::shared_ptr<HlsStream> Create(const std::shared_ptr<pub::Application> application,
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/llhls/llhls_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "llhls_stream.h"

class LLHlsApplication : public pub::Application
class LLHlsApplication final: public pub::Application
{
public:
static std::shared_ptr<LLHlsApplication> Create(const std::shared_ptr<pub::Publisher> &publisher, const info::Application &application_info);
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/llhls/llhls_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// max initial media packet buffer size, for OOM protection
#define MAX_INITIAL_MEDIA_PACKET_BUFFER_SIZE 10000

class LLHlsStream : public pub::Stream, public bmff::FMp4StorageObserver
class LLHlsStream final : public pub::Stream, public bmff::FMp4StorageObserver
{
public:
static std::shared_ptr<LLHlsStream> Create(const std::shared_ptr<pub::Application> application,
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/ovt/ovt_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "ovt_stream.h"

class OvtApplication : public pub::Application
class OvtApplication final : public pub::Application
{
public:
static std::shared_ptr<OvtApplication> Create(const std::shared_ptr<pub::Publisher> &publisher, const info::Application &application_info);
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/ovt/ovt_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "monitoring/monitoring.h"

class OvtStream : public pub::Stream, public OvtPacketizerInterface
class OvtStream final : public pub::Stream, public OvtPacketizerInterface
{
public:
static std::shared_ptr<OvtStream> Create(const std::shared_ptr<pub::Application> application,
Expand Down
2 changes: 1 addition & 1 deletion src/projects/publishers/push/push_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace pub
{
class PushApplication : public pub::Application
class PushApplication final : public pub::Application
{
public:
enum ErrorCode
Expand Down
Loading

0 comments on commit b071cb2

Please sign in to comment.