libvideorecord.cpp 2.3 KB

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