libvideorecord.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // libvideorecord.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "libvideorecord.h"
  4. #include "libvideorecord_impl.h"
  5. // 这是已导出类的构造函数。
  6. // 有关类定义的信息,请参阅 libvideorecord.h
  7. Clibvideorecord::Clibvideorecord(bool *pResult, CHostApi *pHostAPI, const char* audioqueuename, const char* videoqueuename, const char* videoqueue2name, const char* salesaudioqueuename, const char* remotevideoqueuename, const char* remoteaudioqueuename)
  8. {
  9. m_pImpl = new libvideorecord_impl(pResult,pHostAPI,audioqueuename,videoqueuename,videoqueue2name,salesaudioqueuename,remotevideoqueuename,remoteaudioqueuename);
  10. return;
  11. }
  12. Clibvideorecord::~Clibvideorecord()
  13. {
  14. delete m_pImpl;
  15. return;
  16. }
  17. bool Clibvideorecord::StartVideoRecord(
  18. int fps,
  19. int videoquality,
  20. eVideoFormat eFormat,
  21. Rvc_RecordAudioParam_t* pAudioParam,
  22. SubtitleParam *subtitleParam /* = NULL */,
  23. bool bWholeSection /* = false */,
  24. bool bSessionManage /* = false */,
  25. const char *pathname /* = NULL */,
  26. int pathlength /* = 0 */,
  27. const char *filename /* = NULL */,
  28. int filenamelength /* = 0 */
  29. )
  30. {
  31. return m_pImpl->StartVideoRecord(fps, videoquality, eFormat, subtitleParam, bWholeSection, bSessionManage, pathname, pathlength, filename, filenamelength, pAudioParam);
  32. }
  33. bool Clibvideorecord::StopVideoRecord() //退出
  34. {
  35. return m_pImpl->StopVideoRecord();
  36. }
  37. void Clibvideorecord::CloseVideoFile() //结束当前录像
  38. {
  39. m_pImpl->m_bCloseVideo = true;
  40. }
  41. bool Clibvideorecord::PauseRecord() //暂停录像
  42. {
  43. return m_pImpl->PauseRecord();
  44. }
  45. bool Clibvideorecord::ContinueRecord() //继续录像
  46. {
  47. return m_pImpl->ContinueRecord();
  48. }
  49. bool Clibvideorecord::ReNameVideoFile(const char*newfilename)
  50. {
  51. m_pImpl->ChangeFilename(newfilename);
  52. return true;
  53. }
  54. bool Clibvideorecord::SetRightVideoWaterMark(const wchar_t* strWaterMark)
  55. {
  56. bool bRet = false;
  57. if (NULL == strWaterMark){
  58. return bRet;
  59. }
  60. size_t ulen = wcslen(strWaterMark);
  61. bRet = m_pImpl->setRightWaterMark(strWaterMark, ulen * sizeof(wchar_t));
  62. return bRet;
  63. }