您现在的位置是:首页 >技术杂谈 >14 媒体存储的封装2网站首页技术杂谈

14 媒体存储的封装2

hope_wisdom 2024-07-04 06:01:03
简介14 媒体存储的封装2

媒体存储实现类

        媒体存储实现类派生于媒体存储接口类,也派生于线程基类。媒体存储实现类的头文件如下:

#pragma once

#include <HP_Base/HP_BaseThread.h>
#include <HP_Base/HP_Mutex.h>
#include <HP_Base/HP_FifoMemPool.h>

#include "HP_MediaStorage.h"
#include "MediaDisk.h"

class CMediaStorage : public CHP_MediaStorage, public CHP_BaseThread
{
public:
    static void Open();
    static CMediaStorage *&Singleton();
    static void Close();

    virtual int Init(const TMppMediaStorageParam &param);
    virtual int SetRecordDuration(unsigned int uiDurationMinutes);

    virtual int WriteVideoFrame(unsigned int uiCameraChannel, unsigned char *pFrame, unsigned int uiFrameLen, 
        const TMppRecordVideoFrameInfo &info);
    virtual int WriteAudioFrame(unsigned int uiCameraChannel, unsigned char *pFrame, unsigned int uiFrameLen,
        const TMppRecordAudioFrameInfo &info);
    virtual int WritePicture(unsigned int uiCamer
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。