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

fix compiler warnings

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