Chinaunix首页 | 论坛 | 博客
  • 博客访问: 133562
  • 博文数量: 20
  • 博客积分: 266
  • 博客等级: 二等列兵
  • 技术积分: 317
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-28 14:15
文章存档

2013年(4)

2012年(16)

我的朋友

分类: LINUX

2012-12-17 00:42:43

今晚下载了4.2的源码,下载过程中碰到了许多蛋痛的问题,最蛋痛的问题就是fetch100%后 代码解压出错,究竟了半天最后发现是git版本不一致,git升级到1.8OK了。

最近连续调了一个多月的摄像头,貌似对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中的内容如下:

点击(此处)折叠或打开

  1. LOCAL_PATH:= $(call my-dir)

  2. #
  3. # libcameraservice
  4. #

  5. include $(CLEAR_VARS)

  6. LOCAL_SRC_FILES:= \
  7.     CameraService.cpp

  8. LOCAL_SHARED_LIBRARIES:= \
  9.     libui \
  10.     libutils \
  11.     libbinder \
  12.     libcutils \
  13.     libmedia \
  14.     libmedia_native \
  15.     libcamera_client \
  16.     libgui \
  17.     libhardware

  18. LOCAL_MODULE:= libcameraservice

  19. include $(BUILD_SHARED_LIBRARY)

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中的内容:

点击(此处)折叠或打开

  1. LOCAL_PATH:= $(call my-dir)

  2. #
  3. # libcameraservice
  4. #

  5. include $(CLEAR_VARS)

  6. LOCAL_SRC_FILES:= \
  7.     CameraService.cpp \
  8.     CameraClient.cpp \
  9.     Camera2Client.cpp \
  10.     Camera2Device.cpp \
  11.     camera2/CameraMetadata.cpp \
  12.     camera2/Parameters.cpp \
  13.     camera2/FrameProcessor.cpp \
  14.     camera2/StreamingProcessor.cpp \
  15.     camera2/JpegProcessor.cpp \
  16.     camera2/CallbackProcessor.cpp \
  17.     camera2/ZslProcessor.cpp \
  18.     camera2/BurstCapture.cpp \
  19.     camera2/JpegCompressor.cpp \
  20.     camera2/CaptureSequencer.cpp

  21. LOCAL_SHARED_LIBRARIES:= \
  22.     libui \
  23.     libutils \
  24.     libbinder \
  25.     libcutils \
  26.     libmedia \
  27.     libmedia_native \
  28.     libcamera_client \
  29.     libgui \
  30.     libhardware \
  31.     libsync \
  32.     libcamera_metadata \
  33.     libjpeg

  34. LOCAL_C_INCLUDES += \
  35.     system/media/camera/include \
  36.     external/jpeg

  37. LOCAL_MODULE:= libcameraservice

  38. include $(BUILD_SHARED_LIBRARY)

从两个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版本处理的,不过在貌似没使用

阅读(5225) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~