全部博文(20)
分类: LINUX
2012-12-17 00:42:43
最近连续调了一个多月的摄像头,貌似对android照相机系统产生兴趣了,于是就看了4.2 CameraService
的部分代码,发现和4.1的版本的区别还是比较大的,具体变化多大还没来得及分析.先从他们的代码布局变化看起吧
看了大家肯定会无语的。
Android_JellyBean_4.1.2 Camera Service 代码布局:
frameworks/av/services/camera/libcameraservice/Android.mk
frameworks/av/services/camera/libcameraservice/CameraHardwareInterface.h
frameworks/av/services/camera/libcameraservice/CameraHardwareStub.cpp
frameworks/av/services/camera/libcameraservice/CameraHardwareStub.h
frameworks/av/services/camera/libcameraservice/CameraService.cpp
frameworks/av/services/camera/libcameraservice/CameraService.h
frameworks/av/services/camera/libcameraservice/CannedJpeg.h
frameworks/av/services/camera/libcameraservice/FakeCamera.cpp
frameworks/av/services/camera/libcameraservice/FakeCamera.h
Android.mk中的内容如下:
点击(此处)折叠或打开
Android_JellyBean_4.2.1 Camera Service 代码布局:
frameworks/av/services/camera/libcameraservice/Android.mk
frameworks/av/services/camera/libcameraservice/Camera2Client.cpp
frameworks/av/services/camera/libcameraservice/Camera2Client.h
frameworks/av/services/camera/libcameraservice/Camera2Device.cpp
frameworks/av/services/camera/libcameraservice/Camera2Device.h
frameworks/av/services/camera/libcameraservice/CameraClient.cpp
frameworks/av/services/camera/libcameraservice/CameraClient.h
frameworks/av/services/camera/libcameraservice/CameraService.cpp
frameworks/av/services/camera/libcameraservice/CameraHardwareInterface.h
frameworks/av/services/camera/libcameraservice/CameraService.h
frameworks/av/services/camera/libcameraservice/camera2/BurstCapture.cpp
frameworks/av/services/camera/libcameraservice/camera2/BurstCapture.h
frameworks/av/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
frameworks/av/services/camera/libcameraservice/camera2/CallbackProcessor.h
frameworks/av/services/camera/libcameraservice/camera2/CameraMetadata.cpp
frameworks/av/services/camera/libcameraservice/camera2/CameraMetadata.h
frameworks/av/services/camera/libcameraservice/camera2/Camera2Heap.h
frameworks/av/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
frameworks/av/services/camera/libcameraservice/camera2/CaptureSequencer.h
frameworks/av/services/camera/libcameraservice/camera2/FrameProcessor.cpp
frameworks/av/services/camera/libcameraservice/camera2/FrameProcessor.h
frameworks/av/services/camera/libcameraservice/camera2/JpegCompressor.cpp
frameworks/av/services/camera/libcameraservice/camera2/JpegCompressor.h
frameworks/av/services/camera/libcameraservice/camera2/JpegProcessor.cpp
frameworks/av/services/camera/libcameraservice/camera2/JpegProcessor.h
frameworks/av/services/camera/libcameraservice/camera2/Parameters.cpp
frameworks/av/services/camera/libcameraservice/camera2/Parameters.h
frameworks/av/services/camera/libcameraservice/camera2/StreamingProcessor.cpp
frameworks/av/services/camera/libcameraservice/camera2/StreamingProcessor.h
frameworks/av/services/camera/libcameraservice/camera2/ZslProcessor.cpp
frameworks/av/services/camera/libcameraservice/camera2/ZslProcessor.h
Android.mk中的内容:
点击(此处)折叠或打开
从两个Android.mk中可以看出,android4.2中在camera 中还是变动比较大,其中多了一个camera2目录
这个目录是由硬件抽象的版本来决定的,其实在4.1中的hardware/libhardware/include/hardware/Camera_common.h中就定义了下面两个宏
#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0)
这两个宏是控制camera HAL版本处理的,不过在貌似没使用