修复编译警告
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run

This commit is contained in:
xia-chu 2026-01-08 21:18:00 +08:00
parent 48c37d4f46
commit a59809047c
12 changed files with 18 additions and 19 deletions

View File

@ -327,6 +327,7 @@ API_EXPORT uint16_t API_CALL mk_ice_server_start(uint16_t port){
iceServer_udp = std::make_shared<UdpServer>(); iceServer_udp = std::make_shared<UdpServer>();
iceServer_udp->start<IceSession>(port); iceServer_udp->start<IceSession>(port);
iceServer_tcp->start<IceSession>(port); iceServer_tcp->start<IceSession>(port);
return 0;
} catch (std::exception &ex) { } catch (std::exception &ex) {
iceServer_udp = nullptr; iceServer_udp = nullptr;
iceServer_tcp = nullptr; iceServer_tcp = nullptr;

View File

@ -57,7 +57,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override; toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override; void setExtraData(const uint8_t *data, size_t size) override;
protected: protected:
aom_av1_t _context = {0}; aom_av1_t _context {};
}; };
} // namespace mediakit } // namespace mediakit

View File

@ -20,7 +20,7 @@ using namespace toolkit;
namespace mediakit { namespace mediakit {
Buffer::Ptr G711Track::getExtraData() const { Buffer::Ptr G711Track::getExtraData() const {
struct wave_format_t wav = {0}; struct wave_format_t wav {};
wav.wFormatTag = getCodecId() == CodecG711A ? WAVE_FORMAT_ALAW : WAVE_FORMAT_MULAW; wav.wFormatTag = getCodecId() == CodecG711A ? WAVE_FORMAT_ALAW : WAVE_FORMAT_MULAW;
wav.nChannels = getAudioChannel(); wav.nChannels = getAudioChannel();
wav.nSamplesPerSec = getAudioSampleRate(); wav.nSamplesPerSec = getAudioSampleRate();

View File

@ -28,7 +28,7 @@ void OpusTrack::setExtraData(const uint8_t *data, size_t size) {
} }
Buffer::Ptr OpusTrack::getExtraData() const { Buffer::Ptr OpusTrack::getExtraData() const {
struct opus_head_t opus = { 0 }; struct opus_head_t opus {};
opus.version = 1; opus.version = 1;
opus.channels = getAudioChannel(); opus.channels = getAudioChannel();
opus.input_sample_rate = getAudioSampleRate(); opus.input_sample_rate = getAudioSampleRate();

View File

@ -41,7 +41,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override; toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override; void setExtraData(const uint8_t *data, size_t size) override;
private: private:
webm_vpx_t _vpx = {0}; webm_vpx_t _vpx {};
}; };
} // namespace mediakit } // namespace mediakit

View File

@ -334,7 +334,7 @@ bool VP8RtpEncoder::inputFrame(const Frame::Ptr &frame) {
bool key = frame->keyFrame(); bool key = frame->keyFrame();
bool mark = false; bool mark = false;
for (size_t pos = 0; pos < len; pos += pdu_size) { for (size_t pos = 0; pos < len; pos += pdu_size) {
if (len - pos <= pdu_size) { if (static_cast<int>(len - pos) <= pdu_size) {
pdu_size = len - pos; pdu_size = len - pos;
mark = true; mark = true;
} }

View File

@ -56,9 +56,6 @@ public:
using Ptr = std::shared_ptr<VP8RtpEncoder>; using Ptr = std::shared_ptr<VP8RtpEncoder>;
bool inputFrame(const Frame::Ptr &frame) override; bool inputFrame(const Frame::Ptr &frame) override;
private:
uint16_t _pic_id = 0;
}; };
}//namespace mediakit }//namespace mediakit

View File

@ -41,7 +41,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override; toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override; void setExtraData(const uint8_t *data, size_t size) override;
private: private:
webm_vpx_t _vpx = {0}; webm_vpx_t _vpx {};
}; };
} // namespace mediakit } // namespace mediakit

View File

@ -297,7 +297,7 @@ bool VP9RtpEncoder::inputFrame(const Frame::Ptr &frame) {
int pdu_size = getRtpInfo().getMaxSize() - nheader; int pdu_size = getRtpInfo().getMaxSize() - nheader;
bool mark = false; bool mark = false;
for (size_t pos = 0; pos < len; pos += pdu_size) { for (int pos = 0; pos < len; pos += pdu_size) {
if (len - pos <= pdu_size) { if (len - pos <= pdu_size) {
pdu_size = len - pos; pdu_size = len - pos;
header[0] |= kEBit; header[0] |= kEBit;

View File

@ -60,8 +60,8 @@ uint8_t getCodecFlags(CodecId cid) {
#define XX(a, b, c) case a: return static_cast<uint8_t>(b); #define XX(a, b, c) case a: return static_cast<uint8_t>(b);
RTMP_CODEC_MAP(XX) RTMP_CODEC_MAP(XX)
#undef XX #undef XX
default: return 0;
} }
return 0;
} }
uint32_t getCodecFourCC(CodecId cid) { uint32_t getCodecFourCC(CodecId cid) {
@ -69,8 +69,8 @@ uint32_t getCodecFourCC(CodecId cid) {
#define XX(a, b, c) case a: return static_cast<uint32_t>(c); #define XX(a, b, c) case a: return static_cast<uint32_t>(c);
RTMP_CODEC_MAP(XX) RTMP_CODEC_MAP(XX)
#undef XX #undef XX
default: return 0;
} }
return 0;
} }
CodecId getFourccCodec(uint32_t id) { CodecId getFourccCodec(uint32_t id) {
@ -195,12 +195,10 @@ bool RtmpPacket::isConfigFrame() const {
switch (type_id) { switch (type_id) {
case MSG_AUDIO: { case MSG_AUDIO: {
switch ((RtmpAudioCodec)getRtmpCodecId()) { switch ((RtmpAudioCodec)getRtmpCodecId()) {
case RtmpAudioCodec::aac: case RtmpAudioCodec::aac: return (RtmpAACPacketType)buffer[1] == RtmpAACPacketType::aac_config_header;
return (RtmpAACPacketType)buffer[1] == RtmpAACPacketType::aac_config_header; case RtmpAudioCodec::ex_header: return (RtmpPacketType)(buffer[0] & 0x0f) == RtmpPacketType::PacketTypeSequenceStart;
case RtmpAudioCodec::ex_header: default: return false;
return (RtmpPacketType)(buffer[0] & 0x0f) == RtmpPacketType::PacketTypeSequenceStart;
} }
return false;
} }
case MSG_VIDEO: { case MSG_VIDEO: {
if (!isVideoKeyFrame()) { if (!isVideoKeyFrame()) {

View File

@ -64,7 +64,6 @@ public:
private: private:
MultiMediaSourceMuxer::Ptr _muxer; MultiMediaSourceMuxer::Ptr _muxer;
uint64_t timeStamp = 0;
uint64_t timeStamp_last = 0; uint64_t timeStamp_last = 0;
}; };

View File

@ -83,6 +83,10 @@ struct sniff_tcp {
#define TH_URG 0x20 #define TH_URG 0x20
#define TH_ECE 0x40 #define TH_ECE 0x40
#define TH_CWR 0x80 #define TH_CWR 0x80
#if defined(TH_FLAGS)
#undef TH_FLAGS
#endif
#define TH_FLAGS (TH_FINTH_SYNTH_RSTTH_ACKTH_URGTH_ECETH_CWR) #define TH_FLAGS (TH_FINTH_SYNTH_RSTTH_ACKTH_URGTH_ECETH_CWR)
u_short th_win; /* TCP滑动窗口 */ u_short th_win; /* TCP滑动窗口 */
u_short th_sum; /* 头部校验和 */ u_short th_sum; /* 头部校验和 */
@ -154,7 +158,7 @@ static bool loadFile(const char *path, const EventPoller::Ptr &poller) {
return false; return false;
} }
auto total_size = std::make_shared<size_t>(0); auto total_size = std::make_shared<size_t>(0);
struct pcap_pkthdr header = {0}; struct pcap_pkthdr header {};
while (true) { while (true) {
const u_char *pkt_buff = pcap_next(handle.get(), &header); const u_char *pkt_buff = pcap_next(handle.get(), &header);
if (!pkt_buff) { if (!pkt_buff) {