Qualcomm Camera HAL3: Add a VendorTag

I. Overview

MetadataTag has two manifestations in CamX, which can be a predefined AndroidTag or a custom VendorTag.

VendorTag is defined in HAL to support additional metadata required by Camx and Chi

There are three VendorTag types:

  • hwVendorTagInfo
  • componentvendortaginfo
  • coreVendorTagInfo

Add corresponding VendorTag according to different specific situations

  • hwVendorTagInfo: Defined in camxtitan17xcontext.cpp and used by Core, HWL, SWL and etc. Most of these VendorTag do not belong to HWL, and they are HW independent.
  • componentvendortaginfo: These VendorTag depend on CHI node and are defined in each CHI component accordingly.
  • coreVendorTagInfo: defined in the core layer (camxvendortags.cpp) and used by core or other layers.

The interface for accessing metadata through VendorTag is different in each layer. The following is a sample code on how to set metadata in the APP and obtain metadata in different layers by using VendorTag (all operations are in the processRequests stage) .

example:

Add a VendorTag to control the Super Night Feature:
//Since the Super Night Feature in the project is implemented by RawHdr Feature, the relevant code uses "HDR", and the actual function is to control the Super Night Feature

2. Define and fill VendorTag:

2.1 Step1:

\chi-cdk\api\common\chivendortagdefines.h

Add CHIVENDORTAGDATA Static variable:

2.2 Step2:

\camx\src\api\vendortag\camxvendortagdefines.h

This section can be added to g_HwVendorTagSections[ ] in camxvendortagdefines.h

You can also add g_VendorTagSectionDataChiOverride[ ] in chivendortagdefines.h

Added in Camx is HWVendorTag, it is best to add it in chivendortagdefines.h

2.3 Step3: Fill in Metadata default data

\camx\src\core\chi\camxchicontext.cpp

2.4 Step4: Add enumeration Index

\chi-cdk\core\chiutils\chxdefs.h

2.5 Step5:

\chi-cdk\core\chiframework\chxextensionmodule.cpp

3. Use VendorTag:

3.1 Step1:

\chi-cdk\oem\qcom\feature2\chifeature2graphselector\chifeature2graphselector.cpp

Parse pAppSettings before selecting FeatureGraph

3.2 Step2:ParseAppRequestSetting()

3.3 Step3: Description of related enumerations, variables, and functions:

(1).\chi-cdk\oem\qcom\feature2\chifeature2graphselector\chifeature2graphselector.h

TEnable: An enumeration used to identify HDR status. In actual Super Night, only T_OFF and T_ON are used.

m_hdrEnable: variable used to record the HDR status passed from the upper layer

(2).\chi-cdk\oem\qcom\feature2\chifeature2graphselector\chifeature2graphselector.cpp

After judging the HDR status, it is called by other functions

(3).\chi-cdk\oem\qcom\feature2\chifeature2graphselector\chifeature2graphselector.cpp

Call isHDREanble() in the function that selects FeatureGraph when taking a photo

4. End

After adding the VendorTag, compiling, and Push So,

You can use the command: adb shell dumpsys media.camera > D:\temp\media.camera.txt to check whether the Tag is added normally

Guess you like

Origin blog.csdn.net/geyichongchujianghu/article/details/131033898