派生自 development/c++

pansen
2019-04-03 adb08adc83dfe9dc5d6170c2322952d77a93c510
QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.h
@@ -13,13 +13,12 @@
#include <iostream>
#include <unistd.h>
#include <MyQueue.h>
#include <Debug.h>
#include <atomic>
#include "GlobalSignalWaitLock.hpp"
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include <list>
#include "GlobalSignalWaitLock.hpp"
#include "basic_struct_for_video_image.h"
extern "C"
@@ -38,6 +37,7 @@
}
#include <mutex>
#include <basic/pipe/TimerElement.h>
namespace BASICGB28181 {
@@ -49,6 +49,11 @@
    static void initFFmpeg();
    /***
     * AVframe转cvmat
     * @param frame
     * @return
     */
    static cv::Mat avframe_to_cvmat(AVFrame *frame);
    typedef struct _buffInfo {
@@ -57,6 +62,7 @@
        std::string camIdx;
    } frameBuffInfo;
    //************录像模块使用的结构体********************//
    struct FrameIdPackage_s_t {
        int64_t m_frameId;
        AVPacket m_packet;
@@ -83,6 +89,7 @@
        RECORDING_VIDEO,
        STOP_RECORD,
    };
    //********************************//
//    std::map<std::string, MyQueue<frameBuffInfo *> > MapMyQueue;
    static std::mutex g_mutex;
@@ -167,7 +174,18 @@
        //对收到的帧进行计数
        int64_t m_frameIndex = 0;
//*******************************************
        AVFormatContext *ic;
        unsigned char *iobuffer;
        AVIOContext *avio;
        AVStream *stream;
        AVCodecContext *ctx;
        AVCodec *codec;
        AVCodec *codec_cuvid;
        AVPacket pkt;
        AVFrame *frame;
        //*******************************************
        //将帧保存到帧数组
        void SaveToPacketVector(AVPacket &packet);
@@ -189,7 +207,8 @@
        int stopWrite();
        //对packet做转换
        void conversion(void *packet, const long int &firstKeyPts, const long int &firstKeyDts, void *inVideoStream);
        void conversion(void *packet, const long int &firstKeyPts, const long int &firstKeyDts, void *inVideoStream,
                        unsigned long int frame_index = 0);
        bool m_bstartWrite = {false};
        bool m_bFirstKeyFrame = {false};
@@ -216,6 +235,7 @@
        int m_gpuIdx;
        int m_fps;
        bool m_PackageState;
        bool m_SnapshotNotSaveRet{true};
        std::string m_camIdx;
        MyQueue<frameBuffInfo *> m_rtpQueue;