videocapobj.cpp 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. void VideoCapObj::Debug(const char* fmt, ...)
  40. {
  41. va_list arg;
  42. va_start(arg, fmt);
  43. vDbg(fmt, arg);
  44. va_end(arg);
  45. }
  46. void VideoCapObj::OnCaptureFailed()
  47. {
  48. }
  49. void VideoCapObj::OnVideoCaptureExcption()
  50. {
  51. }