vcap_fmt.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef VCAP_FMT_H
  2. #define VCAP_FMT_H
  3. #include <linux/videodev2.h>
  4. #define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE)
  5. #define VCAP_GENERIC_NOTIFY_EVENT 0
  6. #define VCAP_VC_PIX_ERR_EVENT 1
  7. #define VCAP_VC_LINE_ERR_EVENT 2
  8. #define VCAP_VC_VSYNC_ERR_EVENT 3
  9. #define VCAP_VC_NPL_OFLOW_ERR_EVENT 4
  10. #define VCAP_VC_LBUF_OFLOW_ERR_EVENT 5
  11. #define VCAP_VC_BUF_OVERWRITE_EVENT 6
  12. #define VCAP_VC_VSYNC_SEQ_ERR 7
  13. #define VCAP_VP_REG_R_ERR_EVENT 8
  14. #define VCAP_VP_REG_W_ERR_EVENT 9
  15. #define VCAP_VP_IN_HEIGHT_ERR_EVENT 10
  16. #define VCAP_VP_IN_WIDTH_ERR_EVENT 11
  17. #define VCAP_VC_UNEXPECT_BUF_DONE 12
  18. #define VCAP_MAX_NOTIFY_EVENT 13
  19. enum hal_vcap_mode {
  20. HAL_VCAP_MODE_PRO = 0,
  21. HAL_VCAP_MODE_INT,
  22. };
  23. enum hal_vcap_polar {
  24. HAL_VCAP_POLAR_POS = 0,
  25. HAL_VCAP_POLAR_NEG,
  26. };
  27. enum hal_vcap_color {
  28. HAL_VCAP_YUV = 0,
  29. HAL_VCAP_RGB,
  30. };
  31. enum nr_threshold_mode {
  32. NR_THRESHOLD_STATIC = 0,
  33. NR_THRESHOLD_DYNAMIC,
  34. };
  35. enum nr_mode {
  36. NR_DISABLE = 0,
  37. NR_AUTO,
  38. NR_MANUAL,
  39. };
  40. enum nr_decay_ratio {
  41. NR_Decay_Ratio_26 = 0,
  42. NR_Decay_Ratio_25,
  43. NR_Decay_Ratio_24,
  44. NR_Decay_Ratio_23,
  45. NR_Decay_Ratio_22,
  46. NR_Decay_Ratio_21,
  47. NR_Decay_Ratio_20,
  48. NR_Decay_Ratio_19,
  49. };
  50. struct nr_config {
  51. uint8_t max_blend_ratio;
  52. uint8_t scale_diff_ratio;
  53. uint8_t diff_limit_ratio;
  54. uint8_t scale_motion_ratio;
  55. uint8_t blend_limit_ratio;
  56. };
  57. struct nr_param {
  58. enum nr_threshold_mode threshold;
  59. enum nr_mode mode;
  60. enum nr_decay_ratio decay_ratio;
  61. uint8_t window;
  62. struct nr_config luma;
  63. struct nr_config chroma;
  64. };
  65. #define VCAPIOC_NR_S_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+0), struct nr_param)
  66. #define VCAPIOC_NR_G_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+1), struct nr_param)
  67. #define VCAPIOC_S_NUM_VC_BUF _IOWR('V', (BASE_VIDIOC_PRIVATE+2), int)
  68. struct v4l2_format_vc_ext {
  69. enum hal_vcap_mode mode;
  70. enum hal_vcap_polar h_polar;
  71. enum hal_vcap_polar v_polar;
  72. enum hal_vcap_polar d_polar;
  73. enum hal_vcap_color color_space;
  74. uint32_t clk_freq;
  75. uint32_t frame_rate;
  76. uint32_t vtotal;
  77. uint32_t htotal;
  78. uint32_t hactive_start;
  79. uint32_t hactive_end;
  80. uint32_t vactive_start;
  81. uint32_t vactive_end;
  82. uint32_t vsync_start;
  83. uint32_t vsync_end;
  84. uint32_t hsync_start;
  85. uint32_t hsync_end;
  86. uint32_t f2_vactive_start;
  87. uint32_t f2_vactive_end;
  88. uint32_t f2_vsync_h_start;
  89. uint32_t f2_vsync_h_end;
  90. uint32_t f2_vsync_v_start;
  91. uint32_t f2_vsync_v_end;
  92. uint32_t sizeimage;
  93. uint32_t bytesperline;
  94. };
  95. enum vcap_type {
  96. VC_TYPE,
  97. VP_IN_TYPE,
  98. VP_OUT_TYPE,
  99. };
  100. enum vcap_stride {
  101. VC_STRIDE_16,
  102. VC_STRIDE_32,
  103. };
  104. struct vcap_priv_fmt {
  105. enum vcap_type type;
  106. enum vcap_stride stride;
  107. union {
  108. struct v4l2_format_vc_ext timing;
  109. struct v4l2_pix_format pix;
  110. /* Once VP is created there will be another type in here */
  111. } u;
  112. };
  113. #endif