diff --git a/plugins/alarm/uploaders/minio_uploader.cpp b/plugins/alarm/uploaders/minio_uploader.cpp index 2de9f52..39c4a32 100644 --- a/plugins/alarm/uploaders/minio_uploader.cpp +++ b/plugins/alarm/uploaders/minio_uploader.cpp @@ -17,6 +17,7 @@ namespace rk3588 { namespace { std::string GetEnvOrDefault(const std::string& env_name, const std::string& default_val) { + (void)env_name; // Handle ${ENV_VAR} syntax if (default_val.size() > 3 && default_val.substr(0, 2) == "${" && default_val.back() == '}') { diff --git a/plugins/input_rtsp/input_rtsp_node.cpp b/plugins/input_rtsp/input_rtsp_node.cpp index 8bf6832..e1797f1 100644 --- a/plugins/input_rtsp/input_rtsp_node.cpp +++ b/plugins/input_rtsp/input_rtsp_node.cpp @@ -227,7 +227,7 @@ private: frame->data_size = buffer->size(); frame->plane_count = plane_count; frame->frame_id = ++frame_id_; - auto best_pts = av_frame_get_best_effort_timestamp(&f); + auto best_pts = f.pts; // av_frame_get_best_effort_timestamp is deprecated frame->pts = best_pts == AV_NOPTS_VALUE ? 0 : static_cast(av_rescale_q(best_pts, time_base, {1, 1000})); frame->data_owner = buffer; @@ -358,7 +358,7 @@ private: MppBufferGroup group = frame_group; size_t buf_size = mpp_frame_get_buf_size(frame); if (!group) { - if (mpp_buffer_group_get_internal(&group, MPP_BUFFER_TYPE_DRM) != MPP_OK) return; + if (mpp_buffer_group_get_internal(&group, MPP_BUFFER_TYPE_DRM, NULL) != MPP_OK) return; frame_group = group; } else { mpp_buffer_group_clear(group); diff --git a/plugins/preprocess/preprocess_node.cpp b/plugins/preprocess/preprocess_node.cpp index d53f204..0968dd6 100644 --- a/plugins/preprocess/preprocess_node.cpp +++ b/plugins/preprocess/preprocess_node.cpp @@ -374,7 +374,6 @@ private: << " -> " << out_w << "x" << out_h << "\n"; } } -#endif static AVPixelFormat ToAvFormat(PixelFormat fmt) { switch (fmt) { diff --git a/plugins/publish/publish_node.cpp b/plugins/publish/publish_node.cpp index 38a2423..7953fca 100644 --- a/plugins/publish/publish_node.cpp +++ b/plugins/publish/publish_node.cpp @@ -94,26 +94,28 @@ public: if (!ready_ || !fmt_ || !stream_) return false; if (pkt.data.empty()) return false; - AVPacket out; - av_init_packet(&out); - if (av_new_packet(&out, static_cast(pkt.data.size())) < 0) { + AVPacket* out = av_packet_alloc(); + if (!out) return false; + + if (av_new_packet(out, static_cast(pkt.data.size())) < 0) { + av_packet_free(&out); return false; } - std::memcpy(out.data, pkt.data.data(), pkt.data.size()); - out.stream_index = stream_->index; - out.flags = pkt.key ? AV_PKT_FLAG_KEY : 0; + std::memcpy(out->data, pkt.data.data(), pkt.data.size()); + out->stream_index = stream_->index; + out->flags = pkt.key ? AV_PKT_FLAG_KEY : 0; // Simple PTS mapping int64_t pts = av_rescale_q(pkt.pts_ms, AVRational{1, 1000}, stream_->time_base); if (pts <= last_pts_) pts = last_pts_ + 1; last_pts_ = pts; - out.pts = pts; - out.dts = pts; - out.duration = av_rescale_q(1000 / std::max(1, fps_), AVRational{1, 1000}, stream_->time_base); + out->pts = pts; + out->dts = pts; + out->duration = av_rescale_q(1000 / std::max(1, fps_), AVRational{1, 1000}, stream_->time_base); - int ret = av_interleaved_write_frame(fmt_, &out); - av_packet_unref(&out); + int ret = av_interleaved_write_frame(fmt_, out); + av_packet_free(&out); if (ret < 0) { if (!warned_) { @@ -406,8 +408,8 @@ public: mpp_packet_deinit(&hdr); } - if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_DRM) != MPP_OK) { - if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_NORMAL) != MPP_OK) { + if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_DRM, NULL) != MPP_OK) { + if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_NORMAL, NULL) != MPP_OK) { std::cerr << "[publish] mpp_buffer_group_get_internal failed\n"; return false; } diff --git a/plugins/storage/storage_node.cpp b/plugins/storage/storage_node.cpp index 53fe39c..37410b1 100644 --- a/plugins/storage/storage_node.cpp +++ b/plugins/storage/storage_node.cpp @@ -119,8 +119,8 @@ public: MppEncHeaderMode header_mode = MPP_ENC_HEADER_MODE_EACH_IDR; mpi_->control(ctx_, MPP_ENC_SET_HEADER_MODE, &header_mode); - if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_DRM) != MPP_OK) { - mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_NORMAL); + if (mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_DRM, NULL) != MPP_OK) { + mpp_buffer_group_get_internal(&frm_grp_, MPP_BUFFER_TYPE_NORMAL, NULL); } // Get header diff --git a/src/ai_scheduler.cpp b/src/ai_scheduler.cpp index 61972b8..b78db2c 100644 --- a/src/ai_scheduler.cpp +++ b/src/ai_scheduler.cpp @@ -114,6 +114,7 @@ ModelHandle AiScheduler::LoadModel(const std::string& model_path, std::string& e return handle; #else + (void)model_path; err = "RKNN not enabled"; return kInvalidModelHandle; #endif