#ifndef MAIN_H #define MAIN_H #include #include "MvObjectEventDetect.h" #include "HxDisk.h" #include "HxTask.h" #include "HxJson.h" #include "HxThread.h" // #include "HxReadMe.h" #include "HxBroadcast.h" #if USE_ALGORITHM #include "rk_mpi.h" #include "mpp_mem.h" #include "mpp_time.h" #include "mpp_env.h" #include "mpp_common.h" #include "mpp_frame.h" #include "mpp_buffer_impl.h" #include "RgaUtils.h" #include "im2d.hpp" #endif #include extern "C" { #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavutil/pixfmt.h" #include "libavutil/imgutils.h" #include "libswscale/swscale.h" #include "libswresample/swresample.h" } #define CHANNEL_MAX 6 #define BROADCAST_PORT 5001 /* 写日志 */ #define WRITE_LOG(type, index, message, data) HxBroadcast::publish_json(4, {{"timestamp", QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")}, \ {"type", type}, \ {"index", index}, \ {"message", message}, \ {"data", data}}) /* 写入系统日志 */ #define WRITE_SYSTEM_LOG(message, data) WRITE_LOG(0, -1, message, data); typedef struct __HxVideoFrame { QDateTime time; AVPacket* packet; __HxVideoFrame() {} __HxVideoFrame(QDateTime time, AVPacket* packet) { this->time = time; this->packet = av_packet_clone(packet); } __HxVideoFrame copy() { return __HxVideoFrame(this->time, this->packet); } void free() { if (packet) { av_packet_unref(packet); av_packet_free(&packet); } } } HxVideoFrame; /* 车辆状态信息 */ extern CarInfoInput car_info; #endif // MAIN_H