高通camx-chi主要数据结构

本文详细介绍了Android Camera HAL中的核心数据结构,包括camera_module_t、camera_info_t、camera3_device_t及其相关组件,如hw_module_t、camera3_device_ops_t、stream配置等。同时,也探讨了camx模块中的camera_module_t实例以及chi数据结构中的AdvancedCameraUsecase和UsecaseId。
摘要由CSDN通过智能技术生成

目录

hal主进程数据结构

camera_module_t

hw_module_t

hw_module_methods_t

camera_info_t 

camera3_device_t 

hw_device_t

camera3_device_ops_t 

camera3_callback_ops 

camera3_stream_configuration

camera3_stream_t

camera3_stream_type_t

camera3_capture_request_t

camera3_capture_result_t 

camera3_stream_buffer_t

camera3_notify_msg_t

camera3_msg_type_t 

camera3_error_msg_t 

camera3_shutter_msg_t

camx数据结构

camera_module_t 实例

3.1 UsecaseId


一、hal主进程数据结构

参考文章:

Android Camera原理之camera HAL底层数据结构与类总结_cameradevicestatuschange-CSDN博客

hardware/libhardware/include/hardware/camera_common.h

camera_module_t

每个硬件模块抽象出的设备必须实现,第一个成员必须是hw_module_t

typedef struct camera_module {
    hw_module_t common;
    int (*get_number_of_cameras)(void);
    int (*get_camera_info)(int camera_id, struct camera_info *info);
    int (*set_callbacks)(const camera_module_callbacks_t *callbacks);
    void (*get_vendor_tag_ops)(vendor_tag_ops_t* ops);
    int (*open_legacy)(const struct hw_module_t* module, const char* id,
            uint32_t halVersion, struct hw_device_t** device);
    int (*set_torch_mode)(const char* camera_id, bool enabled);
    int (*init)();
    void* reserved[5];
} camera_module_t;

camera_module_t的camx实例在后面

 hardware/libhardware/include/hardware/hardware.h

hw_module_t

typedef struct hw_module_t {
    /** tag must be initialized to HARDWARE_MODULE_TAG */
    uint32_t tag;
 
    uint16_t module_api_version;
#define version_major module_api_version
 
    uint16_t hal_api_version;
#define version_minor hal_api_version
 
    /** Identifier of module */
    const char *id;
 
    /** Name of this module */
    const char *name;
 
    /** Author/owner/implementor of the module */
    const char *author;
 
    /** Modules methods */
    struct hw_module_methods_t* methods;
 
    /** module's dso */
    void* dso;
 
#ifdef __LP64__
    uint64_t reserved[32-7];
#else
    /** padding to 128 bytes, reserved for future use */
    uint32_t reserved[32-7];
#endif
 
} hw_module_t;
hw_module_methods_t

必须包含open函数指针,具体实现有hal层实现。 

typedef struct hw_module_methods_t {
    /** Open a specific device */
    int (*open)(const struct hw_module_t* module, const char* id,
            struct hw_device_t** device);
 
} hw_module_methods_t;

camera_info_t 

描述camera信息,通过get_camera_info获取

typedef struct camera_info {
    int facing;
    int orientation;
    uint32_t device_version;
    const camera_metadata_t *static_camera_characteristics;
    int resource_cost;
    char** conflicting_devices;
    size_t conflicting_devices_length;
} camera_info_t;

camera3_device_t 

代表一个打开的设备,通过上面的open函数获取,第一个成员必须是hw_device_t

typedef struct camera3_device {
    hw_device_t common;
    camera3_device_ops_t *ops;
    void *priv;
} camera3_device_t;

hw_device_t

包含close和hw_module_t

typedef struct hw_device_t {
    /** tag must be initi
  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值