提交 e64ec7c5 authored 作者: blu's avatar blu

fix compiler warnings

上级 23f5fa90
...@@ -6,10 +6,6 @@ created: 2019/09/04 ...@@ -6,10 +6,6 @@ created: 2019/09/04
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-lambda-capture"
#include <queue> #include <queue>
#include <cstdlib> #include <cstdlib>
#include <algorithm> #include <algorithm>
...@@ -64,7 +60,7 @@ private: ...@@ -64,7 +60,7 @@ private:
thread thHeartBeat; thread thHeartBeat;
mutex mutHeartBeat; mutex mutHeartBeat;
bool bGotHeartBeat = false; // bool bGotHeartBeat = false;
int heartBeatTimeout = 60 * 1000; int heartBeatTimeout = 60 * 1000;
...@@ -107,7 +103,6 @@ private: ...@@ -107,7 +103,6 @@ private:
// lock_guard<mutex> lock(cacheLock); // lock_guard<mutex> lock(cacheLock);
json &data = this->config; json &data = this->config;
string peerId; string peerId;
pid_t pid;
for(auto &[k,v]:data.items()) { for(auto &[k,v]:data.items()) {
if(k == this->devSn) { if(k == this->devSn) {
peerId = v["sn"].get<string>() + ":evmgr:0"; peerId = v["sn"].get<string>() + ":evmgr:0";
...@@ -368,7 +363,6 @@ private: ...@@ -368,7 +363,6 @@ private:
int handleEdgeMsg(vector<vector<uint8_t> > &body) int handleEdgeMsg(vector<vector<uint8_t> > &body)
{ {
int ret = 0; int ret = 0;
zmq_msg_t msg;
// ID_SENDER, ID_TARGET, meta ,MSG // ID_SENDER, ID_TARGET, meta ,MSG
string selfId, peerId, meta; string selfId, peerId, meta;
if(body.size() == 2 && body[1].size() == 0) { if(body.size() == 2 && body[1].size() == 0) {
...@@ -718,7 +712,7 @@ public: ...@@ -718,7 +712,7 @@ public:
res.set_content(this->config.dump(), "text/json"); res.set_content(this->config.dump(), "text/json");
}); });
svr.Post("/config", [this](const Request& req, Response& res) { svr.Post("/config", [](const Request& req, Response& res) {
json ret; json ret;
ret["code"] = 0; ret["code"] = 0;
ret["msg"] = "ok"; ret["msg"] = "ok";
...@@ -894,7 +888,6 @@ public: ...@@ -894,7 +888,6 @@ public:
void cleanup(int signal) void cleanup(int signal)
{ {
int status;
while (waitpid((pid_t) (-1), 0, WNOHANG) > 0) {} while (waitpid((pid_t) (-1), 0, WNOHANG) > 0) {}
} }
......
...@@ -6,13 +6,6 @@ created: 2019/08/23 ...@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -42,7 +35,6 @@ private: ...@@ -42,7 +35,6 @@ private:
mutex cacheLock; mutex cacheLock;
queue<string> eventQue; queue<string> eventQue;
mutex eventQLock; mutex eventQLock;
time_t tsLastBoot, tsUpdateTime;
string drport = "5549"; string drport = "5549";
thread thCloudMsgHandler; thread thCloudMsgHandler;
...@@ -171,7 +163,6 @@ error_exit: ...@@ -171,7 +163,6 @@ error_exit:
int handleEdgeMsg(vector<vector<uint8_t> > &body) int handleEdgeMsg(vector<vector<uint8_t> > &body)
{ {
int ret = 0; int ret = 0;
zmq_msg_t msg;
// ID_SENDER, ID_TARGET, meta ,MSG // ID_SENDER, ID_TARGET, meta ,MSG
string selfId, peerId, meta; string selfId, peerId, meta;
bool bProcessed = false; bool bProcessed = false;
...@@ -342,8 +333,6 @@ protected: ...@@ -342,8 +333,6 @@ protected:
void run() void run()
{ {
bool bStopSig = false; bool bStopSig = false;
int ret = 0;
while (true) { while (true) {
if(checkStop() == true) { if(checkStop() == true) {
bStopSig = true; bStopSig = true;
......
...@@ -6,13 +6,6 @@ created: 2019/08/23 ...@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -70,13 +63,11 @@ private: ...@@ -70,13 +63,11 @@ private:
int iid; int iid;
AVFormatContext *pAVFormatInput = nullptr; AVFormatContext *pAVFormatInput = nullptr;
AVCodecContext *pCodecCtx = nullptr; AVCodecContext *pCodecCtx = nullptr;
AVDictionary *pOptsRemux = nullptr;
DetectParam detPara = {25, 500, -1, 10, 3, 30, 0.3}; DetectParam detPara = {25, 500, -1, 10, 3, 30, 0.3};
EventState evtState = EventState::NONE; EventState evtState = EventState::NONE;
chrono::system_clock::time_point evtStartTm, evtStartTmLast; chrono::system_clock::time_point evtStartTm, evtStartTmLast;
queue<string> *evtQueue; queue<string> *evtQueue;
int streamIdx = -1; int streamIdx = -1;
time_t tsLastBoot, tsUpdateTime;
json config; json config;
thread thEdgeMsgHandler, thCloudMsgHandler; thread thEdgeMsgHandler, thCloudMsgHandler;
thread thEvent; thread thEvent;
...@@ -88,7 +79,6 @@ private: ...@@ -88,7 +79,6 @@ private:
long long packetTsDelta = 0; long long packetTsDelta = 0;
float pps = 0; float pps = 0;
int pktLag = 0; int pktLag = 0;
int schmittriStatus = 0;
// //
int handleCloudMsg(vector<vector<uint8_t> > v) int handleCloudMsg(vector<vector<uint8_t> > v)
...@@ -415,7 +405,6 @@ private: ...@@ -415,7 +405,6 @@ private:
int ret = 0; int ret = 0;
// find video // find video
for (int i = 0; i < pAVFormatInput->nb_streams; i++) { for (int i = 0; i < pAVFormatInput->nb_streams; i++) {
AVStream *out_stream;
AVStream *in_stream = pAVFormatInput->streams[i]; AVStream *in_stream = pAVFormatInput->streams[i];
AVCodecParameters *in_codecpar = in_stream->codecpar; AVCodecParameters *in_codecpar = in_stream->codecpar;
if (in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO) { if (in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
...@@ -693,8 +682,6 @@ protected: ...@@ -693,8 +682,6 @@ protected:
void run() void run()
{ {
bool bStopSig = false; bool bStopSig = false;
int ret = 0;
int idx = 0;
uint64_t pktCnt = 0; uint64_t pktCnt = 0;
zmq_msg_t msg; zmq_msg_t msg;
AVPacket packet; AVPacket packet;
......
...@@ -6,13 +6,6 @@ created: 2019/08/23 ...@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -40,8 +33,7 @@ private: ...@@ -40,8 +33,7 @@ private:
char *pAVFmtCtxBytes = nullptr; char *pAVFmtCtxBytes = nullptr;
int lenAVFmtCtxBytes = 0; int lenAVFmtCtxBytes = 0;
string urlIn, urlPub, urlDealer, mgrSn, devSn, selfId, ipcPort; string urlIn, urlPub, urlDealer, mgrSn, devSn, selfId, ipcPort;
int *streamList = nullptr, numStreams = 0, iid; int numStreams = 0, iid;
time_t tsLastBoot, tsUpdateTime;
json config; json config;
thread thEdgeMsgHandler, thCloudMsgHandler; thread thEdgeMsgHandler, thCloudMsgHandler;
string proto = "rtsp"; string proto = "rtsp";
......
...@@ -6,13 +6,6 @@ created: 2019/08/23 ...@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -36,11 +29,9 @@ private: ...@@ -36,11 +29,9 @@ private:
void *pSub = nullptr, *pDealer = nullptr, *pDaemonCtx = nullptr, *pDaemon = nullptr; void *pSub = nullptr, *pDealer = nullptr, *pDaemonCtx = nullptr, *pDaemon = nullptr;
string urlOut, urlPub, urlDealer, devSn, pullerGid, mgrSn, selfId; string urlOut, urlPub, urlDealer, devSn, pullerGid, mgrSn, selfId;
int iid; int iid;
bool enablePush = false;
int *streamList = nullptr; int *streamList = nullptr;
AVFormatContext *pAVFormatRemux = nullptr; AVFormatContext *pAVFormatRemux = nullptr;
AVFormatContext *pAVFormatInput = nullptr; AVFormatContext *pAVFormatInput = nullptr;
time_t tsLastBoot, tsUpdateTime;
json config; json config;
thread thCloudMsgHandler, thEdgeMsgHandler; thread thCloudMsgHandler, thEdgeMsgHandler;
string drport = "5549"; string drport = "5549";
...@@ -414,12 +405,9 @@ protected: ...@@ -414,12 +405,9 @@ protected:
void run() void run()
{ {
int ret = 0; int ret = 0;
bool bStopSig = false;
zmq_msg_t msg; zmq_msg_t msg;
AVPacket packet; AVPacket packet;
uint64_t pktCnt = 0; uint64_t pktCnt = 0;
int pktIgnore = 0;
int64_t lastPts = 0;
while (true) { while (true) {
ret =zmq_msg_init(&msg); ret =zmq_msg_init(&msg);
if(ret != 0) { if(ret != 0) {
......
...@@ -6,13 +6,6 @@ created: 2019/08/23 ...@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10 update: 2019/09/10
*/ */
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -50,12 +43,10 @@ private: ...@@ -50,12 +43,10 @@ private:
string urlOut, urlPub, urlRouter, devSn, mgrSn, selfId, pullerGid, ipcSn; string urlOut, urlPub, urlRouter, devSn, mgrSn, selfId, pullerGid, ipcSn;
int iid, hours, seconds, numSlices; int iid, hours, seconds, numSlices;
long bootTime = 0; long bootTime = 0;
bool enablePush = false;
AVFormatContext *pAVFormatRemux = nullptr; AVFormatContext *pAVFormatRemux = nullptr;
AVFormatContext *pAVFormatInput = nullptr; AVFormatContext *pAVFormatInput = nullptr;
AVDictionary *pOptsRemux = nullptr; AVDictionary *pOptsRemux = nullptr;
int *streamList = nullptr; int *streamList = nullptr;
time_t tsLastBoot, tsUpdateTime;
json config; json config;
thread thEdgeMsgHandler, thCloudMsgHandler, thSliceMgr; thread thEdgeMsgHandler, thCloudMsgHandler, thSliceMgr;
string drport = "5549"; string drport = "5549";
...@@ -448,7 +439,6 @@ private: ...@@ -448,7 +439,6 @@ private:
// find all video & audio streams for remuxing // find all video & audio streams for remuxing
streamList = (int *)av_mallocz_array(pAVFormatInput->nb_streams, sizeof(*streamList)); streamList = (int *)av_mallocz_array(pAVFormatInput->nb_streams, sizeof(*streamList));
for (int i = 0; i < pAVFormatInput->nb_streams; i++) { for (int i = 0; i < pAVFormatInput->nb_streams; i++) {
AVStream *out_stream;
AVStream *in_stream = pAVFormatInput->streams[i]; AVStream *in_stream = pAVFormatInput->streams[i];
AVCodecParameters *in_codecpar = in_stream->codecpar; AVCodecParameters *in_codecpar = in_stream->codecpar;
if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO && if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO &&
...@@ -497,9 +487,7 @@ private: ...@@ -497,9 +487,7 @@ private:
protected: protected:
void run() void run()
{ {
bool bStopSig = false;
int ret = 0; int ret = 0;
int idx = 0;
int pktCnt = 0; int pktCnt = 0;
AVStream * out_stream = nullptr; AVStream * out_stream = nullptr;
zmq_msg_t msg; zmq_msg_t msg;
......
...@@ -197,7 +197,6 @@ namespace AVFormatCtxSerializer ...@@ -197,7 +197,6 @@ namespace AVFormatCtxSerializer
int encode(AVFormatContext *ctx, char **bytes) int encode(AVFormatContext *ctx, char **bytes)
{ {
int ret = 0;
int wholeSize = 0; int wholeSize = 0;
int got = 0; int got = 0;
// calc total size // calc total size
......
...@@ -95,8 +95,6 @@ float getEntropy(cv::Mat &frame){ ...@@ -95,8 +95,6 @@ float getEntropy(cv::Mat &frame){
/// Set the ranges ( for B,G,R) ) /// Set the ranges ( for B,G,R) )
float range[] = { 0, 256 } ; float range[] = { 0, 256 } ;
const float* histRange = { range }; const float* histRange = { range };
bool uniform = true;
bool accumulate = false;
/// Compute the histograms: /// Compute the histograms:
cv::Mat hist; cv::Mat hist;
cv::calcHist( &frame, 1, 0, cv::Mat(), hist, 1, &histSize, &histRange, true, false ); cv::calcHist( &frame, 1, 0, cv::Mat(), hist, 1, &histSize, &histRange, true, false );
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论