save_snapshot_reprocessing.h 1.01 KB
/*
 * @Author: yangzilong
 * @Date: 2021-12-14 17:51:04
 * @Last Modified by: yangzilong
 * @Email: yangzilong@objecteye.com
 * @Description:
 */
#pragma once
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <string.h>
#include <queue>
#include <mutex>
#include <condition_variable>
#include <thread>

#include "../ai_platform/det_obj_header.h"
#include "../util/JpegUtil.h"
#include "../util/vpc_util.h"


using namespace std;

class DeviceMemory;

struct ImgSaveInfo{
	string file_path {""};
	vpc_img_info img_info;
	string json_str {""};
	sy_rect obj_rect;
};

class save_snapshot_reprocessing
{
public:
	save_snapshot_reprocessing(int devId);
	~save_snapshot_reprocessing();
	

	void reprocessing_process_wo_locus_async(ImgSaveInfo saveInfo);

public:
	void save_img_process();

private:
	void release();

private:

	queue<ImgSaveInfo> waitforsave_img_queue;
	mutable std::mutex waitforsave_img_queue_mutex;
	std::thread m_save_img_thread;

	bool bFinish = false;
	int m_devId;

	JpegUtil jpegUtil;
};