69 lines
1.3 KiB
C
69 lines
1.3 KiB
C
|
|
//OpenCV RTSP拉流引擎(包含视频解码)
|
||
|
|
#ifndef _VIDEO_ENGINE_H
|
||
|
|
#define _VIDEO_ENGINE_H
|
||
|
|
|
||
|
|
#include <iostream>
|
||
|
|
#include <chrono>
|
||
|
|
#include <cmath>
|
||
|
|
#include <utility>
|
||
|
|
#include <thread>
|
||
|
|
#include <chrono>
|
||
|
|
#include <functional>
|
||
|
|
#include <atomic>
|
||
|
|
#include <time.h>
|
||
|
|
#include <sys/time.h>
|
||
|
|
#include <unistd.h>
|
||
|
|
#include <queue>
|
||
|
|
#include <mutex>
|
||
|
|
#include <semaphore.h>
|
||
|
|
#include <algorithm>
|
||
|
|
#include <string>
|
||
|
|
#include <stdio.h>
|
||
|
|
#include <stdarg.h>
|
||
|
|
#include <string.h>
|
||
|
|
#include <vector>
|
||
|
|
#include <memory>
|
||
|
|
|
||
|
|
#include <opencv2/opencv.hpp>
|
||
|
|
#include <opencv2/core/core.hpp>
|
||
|
|
#include <opencv2/highgui/highgui.hpp>
|
||
|
|
#include <opencv2/imgproc/imgproc.hpp>
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C"
|
||
|
|
{
|
||
|
|
#endif
|
||
|
|
#include <libavcodec/avcodec.h>
|
||
|
|
#include <libavutil/samplefmt.h>
|
||
|
|
#include <libavformat/avformat.h>
|
||
|
|
#ifdef __cplusplus
|
||
|
|
};
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#include "EngineBase.h"
|
||
|
|
#include "EngineFactory.h"
|
||
|
|
#include "MyYaml.h"
|
||
|
|
#include "myutils.h"
|
||
|
|
#include "AppCommon.h"
|
||
|
|
|
||
|
|
#define RTSP_PULL_CAMERA_VIDEO_STREAM
|
||
|
|
|
||
|
|
class VideoEngine : public ai_matrix::EngineBase
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
VideoEngine();
|
||
|
|
~VideoEngine();
|
||
|
|
|
||
|
|
APP_ERROR Init() override;
|
||
|
|
APP_ERROR DeInit() override;
|
||
|
|
APP_ERROR Process() override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
ai_matrix::DataSourceConfig dataSourceConfig_;
|
||
|
|
std::string strPort0_;
|
||
|
|
unsigned int width_, height_;
|
||
|
|
};
|
||
|
|
|
||
|
|
ENGINE_REGIST(VideoEngine)
|
||
|
|
|
||
|
|
#endif //_VIDEO_ENGINE_H
|