diff --git a/api/include/mk_frame.h b/api/include/mk_frame.h index 56309d4f..a17f0654 100644 --- a/api/include/mk_frame.h +++ b/api/include/mk_frame.h @@ -27,17 +27,17 @@ extern "C" { #define MK_FRAME_FLAG_NOT_DECODE_ABLE (1 << 3) //codec id常量定义 -API_EXPORT extern const int MKCodecH264; -API_EXPORT extern const int MKCodecH265; -API_EXPORT extern const int MKCodecAAC; -API_EXPORT extern const int MKCodecG711A; -API_EXPORT extern const int MKCodecG711U; -API_EXPORT extern const int MKCodecOpus; -API_EXPORT extern const int MKCodecL16; -API_EXPORT extern const int MKCodecVP8; -API_EXPORT extern const int MKCodecVP9; -API_EXPORT extern const int MKCodecAV1; -API_EXPORT extern const int MKCodecJPEG; +extern const int MKCodecH264; +extern const int MKCodecH265; +extern const int MKCodecAAC; +extern const int MKCodecG711A; +extern const int MKCodecG711U; +extern const int MKCodecOpus; +extern const int MKCodecL16; +extern const int MKCodecVP8; +extern const int MKCodecVP9; +extern const int MKCodecAV1; +extern const int MKCodecJPEG; typedef struct mk_frame_t *mk_frame; diff --git a/api/source/mk_frame.cpp b/api/source/mk_frame.cpp index adf03e1c..c84453d3 100644 --- a/api/source/mk_frame.cpp +++ b/api/source/mk_frame.cpp @@ -15,7 +15,7 @@ using namespace mediakit; extern "C" { -#define XX(name, type, value, str, mpeg_id, mp4_id) API_EXPORT const int MK##name = value; +#define XX(name, type, value, str, mpeg_id, mp4_id) const int MK##name = value; CODEC_MAP(XX) #undef XX } diff --git a/ext-codec/AACRtp.cpp b/ext-codec/AACRtp.cpp index c9e4bfea..006630f7 100644 --- a/ext-codec/AACRtp.cpp +++ b/ext-codec/AACRtp.cpp @@ -86,7 +86,7 @@ bool AACRtpDecoder::inputRtp(const RtpPacket::Ptr &rtp, bool key_pos) { } // 每个audio unit时间戳增量 - auto dts_inc = (stamp - _last_dts) / au_header_count; + auto dts_inc = static_cast(stamp - _last_dts) / au_header_count; if (dts_inc < 0 || dts_inc > 100) { // 时间戳增量异常,忽略 dts_inc = 0; diff --git a/ext-codec/JPEGRtp.cpp b/ext-codec/JPEGRtp.cpp index 99456b21..b2e2240e 100644 --- a/ext-codec/JPEGRtp.cpp +++ b/ext-codec/JPEGRtp.cpp @@ -598,7 +598,7 @@ void JPEGRtpEncoder::rtpSendJpeg(const uint8_t *buf, int size, uint64_t pts, uin { const uint8_t *qtables[4] = { NULL }; int nb_qtables = 0; - uint8_t w, h; + uint8_t w { 0 }, h { 0 }; uint8_t *p; int off = 0; /* fragment offset of the current JPEG frame */ int len; diff --git a/src/Player/PlayerProxy.h b/src/Player/PlayerProxy.h index cc10a4e6..c484ca6a 100644 --- a/src/Player/PlayerProxy.h +++ b/src/Player/PlayerProxy.h @@ -129,12 +129,12 @@ private: void setTranslationInfo(); private: - ProtocolOption _option; int _retry_count; int _reconnect_delay_min; int _reconnect_delay_max; int _reconnect_delay_step; MediaTuple _tuple; + ProtocolOption _option; std::string _pull_url; toolkit::Timer::Ptr _timer; std::function _on_disconnect; diff --git a/src/Rtp/RtpCache.h b/src/Rtp/RtpCache.h index bd570c47..c63e18f4 100644 --- a/src/Rtp/RtpCache.h +++ b/src/Rtp/RtpCache.h @@ -41,7 +41,7 @@ private: class RtpCachePS : public RtpCache, public PSEncoderImp { public: RtpCachePS(onFlushed cb, uint32_t ssrc, uint8_t payload_type = 96, bool ps_or_ts = true) : - RtpCache(std::move(cb)), PSEncoderImp(ssrc, ps_or_ts ? payload_type : Rtsp::PT_MP2T, ps_or_ts) {}; + RtpCache(std::move(cb)), PSEncoderImp(ssrc, ps_or_ts ? payload_type : static_cast(Rtsp::PT_MP2T), ps_or_ts) {}; void flush() override; diff --git a/tests/test_bench_forward.cpp b/tests/test_bench_forward.cpp index c75b45ed..20a3d2e5 100644 --- a/tests/test_bench_forward.cpp +++ b/tests/test_bench_forward.cpp @@ -223,8 +223,8 @@ int main(int argc, char *argv[]) { option.enable_hls = false; option.enable_mp4 = false; option.modify_stamp = (int)ProtocolOption::kModifyStampRelative; - //添加拉流代理 - auto tuple = MediaTuple{DEFAULT_VHOST, "app", std::to_string(i)}; + //添加拉流代理 + auto tuple = MediaTuple { DEFAULT_VHOST, "app", std::to_string(i), "" }; auto proxy = std::make_shared(tuple, option, -1, nullptr, 1); //开始拉流代理 proxy->play(input_urls[i]); diff --git a/tests/test_bench_push.cpp b/tests/test_bench_push.cpp index 8ae0d41c..317b0cdd 100644 --- a/tests/test_bench_push.cpp +++ b/tests/test_bench_push.cpp @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) { MediaSource::Ptr src = nullptr; PlayerProxy::Ptr proxy = nullptr;; - auto tuple = MediaTuple{DEFAULT_VHOST, app, stream}; + auto tuple = MediaTuple { DEFAULT_VHOST, app, stream, "" }; if (end_with(in_url, ".mp4")) { // create MediaSource from mp4file auto reader = std::make_shared(tuple, in_url); diff --git a/tests/test_rtp.cpp b/tests/test_rtp.cpp index 8946aa59..bf9167e6 100644 --- a/tests/test_rtp.cpp +++ b/tests/test_rtp.cpp @@ -75,7 +75,7 @@ static bool loadFile(const char *path, const EventPoller::Ptr &poller) { return 0; } - auto diff = stamp - stamp_last; + auto diff = static_cast(stamp - stamp_last); if (diff < 0 || diff > 500) { diff = 1; }