天天看点

Android Camera子系统之源代码View

本文基于android 4.2.2+linux3.6.9+sama5d3 soc从源代码的角度审视android camera子系统。

应用层

androd原生camera应用

/system/app/legacycamera.apk 

camera应用调用android应用框架提供的camera api

import android.hardware.camera;

import android.hardware.camera.area;

import android.hardware.camera.camerainfo;

import android.hardware.camera.face;

import android.hardware.camera.facedetectionlistener;

import android.hardware.camera.parameters;

import android.hardware.camera.picturecallback;

import android.hardware.camera.size;

应用框架层

/system/framework/framework.jar 

jni

/system/lib/libandroid_runtime.so 

camera service

binder proxy

binder proxy是camera client和camera service之间通信的统一通道。camera client和camera

service都会调用camera service binder proxy。

/system/lib/libcamera_client.so 

头文件目录

源文件目录

camera service与camera hal交互,通过binder service的方式为camera

client提供服务。

/system/lib/libcameraservice.so 

hal

camera硬件抽象层定义并实现供camera service调用的标准接口,保证camera硬件的功能能够正常发挥。

/system/lib/hw/camera.sama5d3-ek.so

头文件

kernel

driver

camera驱动程序与camera硬件和hal交互。camera硬件和驱动程序必须支持yv12和nv21图像格式以支持预览和录像。

the v4l2driver for atmel linux

soc cameradriver for omni vision 2640 sensor