From 78d9b3543439115fe723770f1facee21a3e1793a Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 21 Nov 2012 09:44:05 -0800 Subject: [PATCH] Camera: Metadata XML cleanup, add README: DO NOT MERGE Change-Id: Ib53757029becbd4148867a144ba3725c4f9e5d82 --- camera/docs/README.md | 13 +++++++++ camera/docs/html.mako | 26 ++++++++++++++++-- camera/docs/metadata_model.py | 2 +- camera/docs/metadata_properties.xml | 55 ++++++++++++++----------------------- camera/docs/metadata_template.mako | 4 +++ 5 files changed, 63 insertions(+), 37 deletions(-) create mode 100644 camera/docs/README.md diff --git a/camera/docs/README.md b/camera/docs/README.md new file mode 100644 index 00000000..b3cf0ce8 --- /dev/null +++ b/camera/docs/README.md @@ -0,0 +1,13 @@ +# Camera Metadata XML +## Introduction +This is a set of scripts to manipulate the camera metadata in an XML form. + +## Generated Files +Many files can be generated from XML, such as the documentation (html/pdf), +C code, Java code, and even XML itself (as a sanity check). + +## Dependencies: +sudo apt-get install python-mako # mako templates. needed to do file generation +sudo apt-get install python-bs4 # beautiful soup. needed to parse the xml +sudo apt-get install tidy # tidy, used to clean up xml/html +sudo apt-get install xmllint # xmllint, used to validate XML against XSD diff --git a/camera/docs/html.mako b/camera/docs/html.mako index a3a90423..c29859ed 100644 --- a/camera/docs/html.mako +++ b/camera/docs/html.mako @@ -16,6 +16,7 @@ limitations under the License. --> + Android Camera HAL2.0 Properties + + <%! # insert word break hints for the browser - # e.g. X/Y/Z -> X/Y//Z. also for X.Y.Z, X_Y_Z. def wbr(text): - replace_chars=['.', '/', '_', ','] new_txt = text + + # for johnyOrange.appleCider.redGuardian also insert wbr before the caps + # => johnyOrange.appleCider.redGuardian + for words in text.split(" "): + if len(words.split(".")) >= 3: # match only x.y.z + addwbr = lambda x: i.isupper() and ("" + i) or i + new_word = "".join([addwbr(i) for i in words]) + new_txt = new_txt.replace(words, new_word) + + # e.g. X/Y/Z -> X/Y//Z. also for X.Y.Z, X_Y_Z. + replace_chars=['.', '/', '_', ','] for i in replace_chars: new_txt = new_txt.replace(i, i + "") diff --git a/camera/docs/metadata_model.py b/camera/docs/metadata_model.py index b6215aed..e916c691 100644 --- a/camera/docs/metadata_model.py +++ b/camera/docs/metadata_model.py @@ -248,7 +248,7 @@ class Metadata(Node): """ tag_ids = [tg.name for tg in self.tags if tg.name == tag] if not tag_ids: - self._tags.append(Tag(tag, self)) + self._tags.append(Tag(tag, self, description)) def insert_entry(self, entry): """ diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml index 0c80cec5..b52919e3 100644 --- a/camera/docs/metadata_properties.xml +++ b/camera/docs/metadata_properties.xml @@ -19,19 +19,19 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata - + Needed for auto white balance - + Needed for backwards compatibility with old Java API - + New features for first camera 2 release (API1) - + Needed for DNG file support @@ -43,23 +43,25 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata TRANSFORM_MATRIX - Use the android.colorCorrection.transform matrix - to do color conversion + Use the android.colorCorrection.transform matrix + to do color conversion + FAST - Must not slow down frame rate relative to raw - bayer output + Must not slow down frame rate relative to raw + bayer output + HIGH_QUALITY - Frame rate may be reduced by high - quality + Frame rate may be reduced by high + quality + - enum - enum: - 9 + 3 + 3 A transform matrix to chromatically adapt pixels in the CIE XYZ (1931) color space from the scene @@ -121,11 +123,13 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata OFF - Autoexposure is disabled; sensor.exposureTime - and sensor.sensitivity are used + Autoexposure is disabled; sensor.exposureTime + and sensor.sensitivity are used + ON - Autoexposure is active, no flash - control + Autoexposure is active, no flash + control + ON_AUTO_FLASH if flash exists Autoexposure is active, auto flash control; flash may be fired when precapture @@ -709,7 +713,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Controls the quality of the demosaicing processing - Enum: @@ -729,7 +732,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Operation mode for edge enhancement - enum: Control the amount of edge enhancement @@ -776,7 +778,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata firingPower Select flash operation mode - enum @@ -837,7 +838,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Current state of the flash unit - enum @@ -857,7 +857,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Operating mode of geometric correction - enum: Control the amount of shading correction @@ -901,7 +900,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Set operational mode for hot pixel correction - Enum: @@ -1061,7 +1059,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Whether optical image stabilization is enabled. - enum android.lens.availableOpticalStabilization Will not be supported on most devices. @@ -1204,8 +1201,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Direction the camera faces relative to device screen - enum - } @@ -1388,7 +1382,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata How much metadata to produce on output - Enum: Lists which camera output streams image data @@ -1415,7 +1408,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata The type of the request; either CAPTURE or REPROCESS - Enum: @@ -1924,7 +1916,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Quality of lens shading correction applied to the image data - enum: Control the amount of shading correction @@ -1953,7 +1944,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata State of the face detector unit - enum android.statistics.availableFaceDetectModes @@ -1965,7 +1955,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Operating mode for histogram generation - enum @@ -1975,7 +1964,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Operating mode for sharpness map generation - enum @@ -2146,7 +2134,6 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata Frame rate may be reduced by high quality - enum: diff --git a/camera/docs/metadata_template.mako b/camera/docs/metadata_template.mako index 6fb1b023..1afc67e3 100644 --- a/camera/docs/metadata_template.mako +++ b/camera/docs/metadata_template.mako @@ -21,7 +21,11 @@ % for tag in metadata.tags: + % if tag.description and tag.description.strip(): + ${tag.description} + % else: + % endif % endfor -- 2.11.0