Vehicle_Road_Counter/src/videoService/video_pipeline.hpp

41 lines
742 B
C++
Raw Normal View History

#ifndef VIDEO_PIPELINE_HPP
#define VIDEO_PIPELINE_HPP
#include <atomic>
#include <string>
#include <thread>
#include "algorithm_service.hpp"
#include "rtsp_camera_service.hpp"
#include "rtsp_stream_pusher.hpp"
class VideoPipeline {
public:
VideoPipeline();
~VideoPipeline();
// 启动流水线
// inputUrl: 拉流地址 (摄像头)
// outputUrl: 推流地址 (MediaMTX)
void Start(const std::string& inputUrl, const std::string& outputUrl);
// 停止流水线
void Stop();
private:
void pipelineLoop();
private:
RtspCameraService camera;
RtspStreamPusher pusher;
AlgorithmService algo;
std::string inputUrl;
std::string outputUrl;
std::thread workThread;
std::atomic<bool> isRunning;
};
#endif // VIDEO_PIPELINE_HPP