mmhguo
2025-07-29 7ecb7f6c19d07348c1de7331da311c2790b9ada1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef VIDEOSTORAGEMANAGER_H
#define VIDEOSTORAGEMANAGER_H
 
#include <QObject>
 
class VideoStorageManager : public QObject {
    Q_OBJECT
public:
    explicit VideoStorageManager(QObject *parent = nullptr);
 
    // 存储视频片段
    bool storeVideo(const QString &cameraId, const QByteArray &videoData,
                   const QDateTime &timestamp);
 
    // 检索视频片段
    QByteArray retrieveVideo(const QString &cameraId,
                            const QDateTime &startTime,
                            const QDateTime &endTime);
 
    // 视频文件清理策略
    void applyRetentionPolicy(int maxDays);
 
private:
    QString m_storagePath;
    QMutex m_mutex;
};
 
#endif // VIDEOSTORAGEMANAGER_H