123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef __MAS_DET_STREAMPIPE_H
- #define __MAS_DET_STREAMPIPE_H
- #include "DetectorLib.h"
- #include "MAS_Definition.h"
- #include "StreamDef.h"
- #include "Locks.h"
- NAMESPACE_MAS_BEGIN
- class DetStreamPipe : public IStreamPipe, public tzc::OSThread {
- public:
- DetStreamPipe(TZ_INT rscID, TZ_INT detId, TZ_INT intype, const ExcepInfo & einfo);
- virtual ~DetStreamPipe();
- virtual TZ_INT Initialize(SPtr<DetectorLib> detLib, const std::string & initParam);
- virtual TZ_INT Dispose();
- virtual void SuperIsInactive(){};
- TZ_INT TurnOnGPU();
- TZ_INT TurnOffGPU();
- TZ_INT SetDetectCfg(const std::string& param);
- TZ_INT GetInputType() const;
- protected:
- virtual std::tuple<TZ_BOOL, TZ_BOOL> streamArrived(SPtr<StreamInfo> & streamInfo) override;
- private:
- virtual void Entry();
- static TZ_INT detCallback(SPtr<StreamInfo> & streamInfo, void * ctx);
- private:
- std::string m_detKey;
- TZ_INT m_iType;
- SPtr<DetectorLib> m_detLib;
- Detector * m_detector;
- std::list<SPtr<StreamInfo>> m_cacheInfo;
- tzc::Mutex m_lock;
- tzc::Semaphore m_detSema;
- };
- inline TZ_INT DetStreamPipe::GetInputType() const
- {
- return m_iType;
- }
- NAMESPACE_MAS_END
- #endif // __MAS_DET_STREAMPIPE_H
|