capture_op.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #include "../include/api.h"
  3. typedef struct
  4. {
  5. /* User accessible pointer */
  6. unsigned char * start;
  7. /* Buffer length */
  8. unsigned int size;
  9. /* File descriptor of NvBuffer */
  10. int dmabuff_fd;
  11. } nv_buffer;
  12. typedef struct
  13. {
  14. /* Camera v4l2 context */
  15. // char cam_dev[16];
  16. int cam_fd;
  17. // int cam_fd1;
  18. // int fd_r;
  19. unsigned int cam_pixfmt;
  20. unsigned int cam_w;
  21. unsigned int cam_h;
  22. // unsigned int frame;
  23. /* Global buffer ptr */
  24. nv_buffer * g_buff;
  25. bool capture_dmabuf;
  26. /* EGL renderer
  27. NvEglRenderer *renderer; */
  28. // int render_dmabuf_fd;
  29. int fps;
  30. /* CUDA processing
  31. bool enable_cuda;
  32. EGLDisplay egl_display;
  33. EGLImageKHR egl_image;*/
  34. /* MJPEG decoding
  35. NvJPEGDecoder *jpegdec;*/
  36. /* Verbose option */
  37. bool enable_verbose;
  38. } context_t;
  39. class CaptureOp
  40. {
  41. public:
  42. CaptureOp(RenderPosition type,int32_t index);
  43. RenderPosition GetType();
  44. int32_t GetIndex();
  45. void SetForward(bool bfront);
  46. bool IsForward();
  47. context_t* _ctx0=nullptr;
  48. context_t* _ctx1=nullptr;
  49. private:
  50. RenderPosition _type;
  51. bool _forward;
  52. int32_t _index;
  53. };