// libvideorecord.cpp : 定义 DLL 应用程序的导出函数。 // #ifdef _WIN32 #include "stdafx.h" #endif #include "libvideorecord.h" #include "libvideorecord_impl.h" // 这是已导出类的构造函数。 // 有关类定义的信息,请参阅 libvideorecord.h Clibvideorecord::Clibvideorecord(bool *pResult, CHostApi *pHostAPI, const char* audioqueuename, const char* videoqueuename, const char* videoqueue2name, const char* salesaudioqueuename, const char* remotevideoqueuename, const char* remoteaudioqueuename) { m_pImpl = new libvideorecord_impl(pResult,pHostAPI,audioqueuename,videoqueuename,videoqueue2name,salesaudioqueuename,remotevideoqueuename,remoteaudioqueuename); return; } Clibvideorecord::~Clibvideorecord() { delete m_pImpl; return; } bool Clibvideorecord::StartVideoRecord( int fps, int videoquality, eVideoFormat eFormat, Rvc_RecordAudioParam_t* pAudioParam, SubtitleParam *subtitleParam /* = NULL */, bool bWholeSection /* = false */, bool bSessionManage /* = false */, const char *pathname /* = NULL */, int pathlength /* = 0 */, const char *filename /* = NULL */, int filenamelength /* = 0 */ ) { return m_pImpl->StartVideoRecord(fps, videoquality, eFormat, subtitleParam, bWholeSection, bSessionManage, pathname, pathlength, filename, filenamelength, pAudioParam); } bool Clibvideorecord::StopVideoRecord() //退出 { return m_pImpl->StopVideoRecord(); } void Clibvideorecord::CloseVideoFile() //结束当前录像 { m_pImpl->m_bCloseVideo = true; } bool Clibvideorecord::PauseRecord() //暂停录像 { return m_pImpl->PauseRecord(); } bool Clibvideorecord::ContinueRecord() //继续录像 { return m_pImpl->ContinueRecord(); } bool Clibvideorecord::ReNameVideoFile(const char*newfilename) { m_pImpl->ChangeFilename(newfilename); return true; } #ifdef _WIN32 bool Clibvideorecord::SetRightVideoWaterMark(const char* strWaterMark) { bool bRet = false; if (NULL == strWaterMark){ return bRet; } uint32_t ulen = (uint32_t)strlen(strWaterMark); return m_pImpl->setRightWaterMark(strWaterMark, ulen); } #else bool Clibvideorecord::SetRightVideoWaterMark(const wchar_t* strWaterMark) { bool bRet = false; if (NULL == strWaterMark){ return bRet; } uint32_t ulen = (uint32_t)wcslen(strWaterMark); bRet = m_pImpl->setRightWaterMark(strWaterMark, ulen * sizeof(wchar_t)); return bRet; } #endif