videocapobj.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include"videocapobj.h"
  2. #include<stdlib.h>
  3. #include<string.h>
  4. #include<stdarg.h>
  5. #include <time.h>
  6. #include <stdio.h>
  7. #include "SpBase.h"
  8. VideoCapObj::VideoCapObj()
  9. {
  10. m_pVideoCap = NULL;
  11. }
  12. VideoCapObj::~VideoCapObj()
  13. {
  14. if (NULL != m_pVideoCap){
  15. DestroyVideoCaptureObj(m_pVideoCap);
  16. }
  17. }
  18. int VideoCapObj::Init()
  19. {
  20. int iRet = -1;
  21. m_pVideoCap = CreateVideoCaptureObj(this);
  22. if (NULL != m_pVideoCap){
  23. iRet = 0;
  24. }
  25. return iRet;
  26. }
  27. int VideoCapObj::SetVideoCaptureParam(videocap_param_t* param)
  28. {
  29. return m_pVideoCap->VideoCaptureSetParam(param);
  30. }
  31. int VideoCapObj::StartVideoCapture()
  32. {
  33. return m_pVideoCap->StartVideoCapture();
  34. }
  35. int VideoCapObj::StopVideoCapture()
  36. {
  37. return m_pVideoCap->StopVideoCapture();
  38. }
  39. int VideoCapObj::GetCamBrightness(int* ibright)
  40. {
  41. return m_pVideoCap->GetCamBrightness(ibright);
  42. }
  43. int VideoCapObj::SetCamBrightness(int ibright)
  44. {
  45. return m_pVideoCap->SetCamBrightness(ibright);
  46. }
  47. int VideoCapObj::SetCamAutoBrightness()
  48. {
  49. return m_pVideoCap->SetCamAutoBrightness();
  50. }
  51. void VideoCapObj::Debug(const char* fmt, ...)
  52. {
  53. va_list arg;
  54. va_start(arg, fmt);
  55. vDbg(fmt, arg);
  56. va_end(arg);
  57. }
  58. void VideoCapObj::OnCaptureFailed()
  59. {
  60. }
  61. void VideoCapObj::OnVideoCaptureExcption()
  62. {
  63. }