capture_op.h 1.4 KB

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