chenshijun
2019-04-16 f946a62d3921e86b44ff8e2973138304b9cd53cd
QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.h
@@ -8,6 +8,7 @@
#include "FFmpegDecoderJPG.h"
#include "28181SDK.h"
#include <basic/pipe/PipeElement.h>
#include <basic/pipe_element/ffmpeg/FfmpegElement.h>
//#include <RtspAnalysManager.h>
//#include <VideoToImageMulth/RtspAnalysManager.h>
@@ -17,6 +18,14 @@
    class VideoCaptureElementWithRtp : public basic::PipeElement {
    public:
        /***
         * VideoCaptureElementWithRtp 视频解码
         * @param chanPubID 通道地(摄像机id)
         * @param fps
         * @param streamTransType 请求的视频流类型
         * @param gpuIdx gpuindex
         * @param manager 上层类的指针
         */
        explicit VideoCaptureElementWithRtp(std::string &chanPubID, int fps, int streamTransType, int gpuIdx = -1,
                                            RtspAnalysManager *manager = nullptr);
@@ -28,6 +37,10 @@
         */
        bool getRunning();
        /***
         * 获取图片
         * @return
         */
        cv::Mat getImage();
        //保存视频接口,从RtspAnalysManager发起调用
@@ -39,7 +52,12 @@
        //根据timeStamp创建路径
        std::string MakeDir(const std::string &timeStamp);
        void startPublishVideo();
        void stopPublishVideo();
    private:
        int reopenTime{10};
        int m_gpuIdx;
        int m_fps;
        int m_streamTransType;
@@ -54,9 +72,12 @@
        std::atomic<bool> m_running;
        std::atomic<bool> m_waitSignal;
        std::atomic<bool> m_waitSignalrunning{false};
        //用来保存录像视频的路径
        std::string m_cutPath;
        std::atomic<bool> m_publishVideoRet{false};
        ffmpeg::PipeVideoPublishElement * videoPublishElement{nullptr};
    private:
        /***
         * 启动实时流接收数据线程
@@ -73,7 +94,7 @@
        /***
         * rtp组包回调函数
         * GB28181 SDK rtp组包回调函数
         * @param handle
         * @param datatype
         * @param frametype