123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /***** (C) Copyright, Shenzhen SUNWIN Intelligent Co.,Ltd. ******source file****
- * File name : user_app.h
- * Author : ShengYin Li
- * Brief :
- ********************************************************************************
- * modify
- * Version Date Author Described
- * V1.00 2021/05/21 ShengYin Li Created
- *******************************************************************************/
- #ifndef _USER_APP_H
- #define _USER_APP_H
- #include <string>
- #include <memory>
- #include "yuv_queue.h"
- #include "sdc_data_src.h"
- #include "sdc_os_api.h"
- #include "Encoder.h"
- #include <unistd.h>
- #include <fstream>
- #include "JpegQueue.h"
- #include "inifile.h"
- // live555
- #include "BasicUsageEnvironment.hh"
- #include "RTSPServer.hh"
- #include "liveMedia.hh"
- #include "BasicUsageEnvironment.hh"
- #include "GroupsockHelper.hh"
- #include "MJPEGVideoSource.h"
- namespace HWYolov3App
- {
- class ProtoBuffer;
- class IYuvDataSrc;
- class UserApp
- {
- public:
- virtual ~UserApp(void);
- UserApp(void);
- int32_t Init(std::string &appName);
- int32_t SetYuvChanAttr(sdc_yuv_channel_param_s &yuv_param);
- int32_t SubscribeYuvDataAndForward(std::shared_ptr<IYuvDataSrc> dataSrc);
- void Destroy(void);
- uint32_t GetYuvChannelId(void) const;
- void PretreatObjectData(SDC_SSD_OBJECT_INFO_S &data);
- SDC_SSD_INPUT_SIZE_S m_videoSize; // 输入模型的大小
- SDC_SSD_INPUT_SIZE_S m_inputSize; // 输入模型的大小
- std::string m_RtspSrc = "/tmp/live";
- std::string m_resultFifo = "/tmp/result";
- std::string m_streamName = "live";
- const std::string m_configSrc = "../config/config.ini";
-
- RTSPServer* m_rtspServer = NULL;
- int m_fdRtspSrc = -1;
- int m_fdResultFifo = -1;
- protected:
- // Yuv循环队列的默认大小为50
- static const int32_t MAX_YUV_BUF_NUM = 50;
- static float m_confidenceThres; // 置信度阈值
- private:
- UserApp(const UserApp&);
- UserApp& operator=(const UserApp&);
- UserApp(UserApp&&);
- UserApp& operator=(UserApp&&);
- // 处理线程函数
- static void* VideoSrvReadThrd(void *arg); // 视频服务线程
- static void* WatchdogThread(void *arg); // 系统资源监控
- static void* YuvDataProThrd(void *arg); // 数据处理线程
- static void* RtspServerThrd(void *arg); // RTSP服务器线程
- std::string m_appName;
- // ReceiveThread & ProcessThread
- pthread_t m_tidpPro;
- pthread_t m_tidpRecv;
- pthread_t m_tidpWatchdog;
- pthread_t m_tidpRtspServer;
- uint32_t m_yuvChnId;
- YuvQueue m_yuvQue; // 循环队列保存Yuv数据帧
- std::shared_ptr<IYuvDataSrc> m_dataSrc; // 指定数据源
- int m_fdFile;
- // 数据订阅
- int m_USER_DET_IMG_W = 960; // 指定订阅使用的检测分辨率宽
- int m_USER_DET_IMG_H = 544; // 指定订阅使用的检测分辨率高
- int m_USER_DET_FRAME_RATE = 25; // 指定订阅帧率
- int m_MODEL_INPUT_SIZE_WIDTH = 416; // 模型输入大小宽
- int m_MODEL_INPUT_SIZE_HEIGHT = 416; // 模型输入大小高
- };
- }
- #endif
- /******** (C) Copyright, Shenzhen SUNWIN Intelligent Co.,Ltd. ******** End *****/
|