Edit online

数据结构设计

DVP 自定义的数据结构都在 aic_dvp.h 中。
  • struct aic_dvp:属于 Driver 层接口,定义了 DVP 控制器的设备管理信息:
    struct aic_dvp {
        struct aic_dvp_config   cfg; /* The configuration of DVP HW */
        struct dvp_out_fmt      fmt; /* The format of output data */
    
        /* Videobuf */
        struct vb_queue         queue;
        struct list_head        active_list;
        aicos_mutex_t           active_lock; /* lock of active buf list */
        unsigned int            sequence;
        unsigned int            streaming;
    
        aicos_mutex_t           lock;
    };
  • struct aic_dvp_config:定义了 L2 媒体数据的配置信息:
    /* Save the configuration information for DVP controller. */
    struct aic_dvp_config {
        /* Input format */
        enum dvp_input          input;
        enum dvp_input_yuv_seq  input_seq;
        u32                     flags;
    
        /* Output format */
        enum dvp_output output;
        u32             width;
        u32             height;
        u32             stride[DVP_PLANE_NUM];
        u32             sizeimage[DVP_PLANE_NUM];
    };
  • 输入输出的数据格式
    • enum dvp_input属于 HAL 层接口,定义了 DVP 输入数据的格式:
      enum dvp_input {
          DVP_IN_RAW  = 0,
          DVP_IN_YUV422   = 1,
          DVP_IN_BT656    = 2,
      };
    • enum dvp_input_yuv_seq属于 HAL 层接口,定义了 DVP 输入数据的 YUV 格式:
      enum dvp_input_yuv_seq {
          DVP_YUV_DATA_SEQ_YUYV   = 0,
          DVP_YUV_DATA_SEQ_YVYU   = 1,
          DVP_YUV_DATA_SEQ_UYVY   = 2,
          DVP_YUV_DATA_SEQ_VYUY   = 3,
      };
    • enum dvp_output属于 HAL 层接口,定义了 DVP 输出数据的格式:
      enum dvp_output {
          DVP_OUT_RAW_PASSTHROUGH     = 0,
          DVP_OUT_YUV422_COMBINED_NV16    = 1,
          DVP_OUT_YUV420_COMBINED_NV12    = 2,
      };