Android camera porting (HAL layer porting)

Source: Internet
Author: User

This article is from kandroid. It can also be found in the android source code development/PDK/. It is recently implemented in the android camera module. We can see this article. Although it is concise, most of it is quite useful, so remember to share your reference here.

Android camera

Brief:

  • Compile libcamera. So Library
  • Time Sequence Diagram
  • Interface

The android camera subsystem associates the "top-layer camera application" with the application framework layer and various libraries of the user space (the media library camera Library), and connects the camera hardware abstraction layer to operate the physical camera.

Describes the structure of the camera subsystem:

Note: In the multimedia framework, the Android 2.3 system stagefright replaces opencore.

Compile a libcamera. So Library

To implement a camera driver, you need to defineThe camerahardwareinterface. H Interface is compiled into a dynamic link library. The dynamic link library must be named libcamera. So, so that the anroid runtime can be loaded from/system/lib. We recommend that you put the camera source code and Android. mk in this directory.

vendor/acme/chipset_or_board/libcamera/

The following Android. mk stub file ensures that libcamera can be linked to the corresponding library during compilation:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := libcamera

LOCAL_SHARED_LIBRARIES := \
    libutils \
    librpc \
    liblog

LOCAL_SRC_FILES += MyCameraHardware.cpp

LOCAL_CFLAGS +=

LOCAL_C_INCLUDES +=

LOCAL_STATIC_LIBRARIES += \
    libcamera-common \
    libclock-rpc \
    libcommondefs-rpc

include $(BUILD_SHARED_LIBRARY)


Time Sequence Diagram

A preview timeline and a picture timeline.

Preview

The following diagram illustrates the function call and action sequence necessary for camera preview:

Photography

The following diagram illustrates the function call and action sequence diagrams necessary for camera photography:

Interface

For more information about the Function interfaces for camera operations, see camerahardwareinteface. h. See examples.

Add:

Android source code: There are a lot of device Hal code in the device/directory. For example, camera is implemented in the Samsung/crepo/libcamera/path. This is Nexus S.

Refer to the Hal code of the front and rear cameras and then debug your own code.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.