Camera: Metadata XML cleanup, add README: DO NOT MERGE
Change-Id: Ib53757029becbd4148867a144ba3725c4f9e5d82
diff --git a/camera/docs/README.md b/camera/docs/README.md
new file mode 100644
index 0000000..b3cf0ce
--- /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 a3a9042..c29859e 100644
--- a/camera/docs/html.mako
+++ b/camera/docs/html.mako
@@ -16,6 +16,7 @@
limitations under the License.
-->
<head>
+ <!-- automatically generated from html.mako. do NOT edit directly -->
<meta charset="utf-8" />
<title>Android Camera HAL2.0 Properties</title>
<style type="text/css">
@@ -56,14 +57,35 @@
/* TODO for each x.y.z try to link it to the entry */
</style>
+
+ <style>
+
+ {
+ /* broken...
+ supposedly there is a bug in chrome that it lays out tables before
+ it knows its being printed, so the page-break-* styles are ignored
+ */
+ tr { page-break-after: always; page-break-inside: avoid; }
+ }
+
+ </style>
</head>
<%!
# insert word break hints for the browser
- # e.g. X/Y/Z -> X/<wbr>Y/<wbr>/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
+ # => johny<wbr>Orange.apple<wbr>Cider.red<wbr>Guardian
+ for words in text.split(" "):
+ if len(words.split(".")) >= 3: # match only x.y.z
+ addwbr = lambda x: i.isupper() and ("<wbr>" + 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/<wbr>Y/<wbr>/Z. also for X.Y.Z, X_Y_Z.
+ replace_chars=['.', '/', '_', ',']
for i in replace_chars:
new_txt = new_txt.replace(i, i + "<wbr>")
diff --git a/camera/docs/metadata_model.py b/camera/docs/metadata_model.py
index b6215ae..e916c69 100644
--- a/camera/docs/metadata_model.py
+++ b/camera/docs/metadata_model.py
@@ -248,7 +248,7 @@
"""
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 0c80cec..b52919e 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -19,19 +19,19 @@
<tags>
<tag id="AWB">
- <!-- TODO: fill the tag description -->
+ Needed for auto white balance
</tag>
<tag id="BC">
- <!-- TODO: fill the tag description -->
+ Needed for backwards compatibility with old Java API
</tag>
<tag id="V1">
- <!-- TODO: fill the tag description -->
+ New features for first camera 2 release (API1)
</tag>
<tag id="ADV">
<!-- TODO: fill the tag description -->
</tag>
<tag id="DNG">
- <!-- TODO: fill the tag description -->
+ Needed for DNG file support
</tag>
<tag id="EXIF">
<!-- TODO: fill the tag description -->
@@ -43,23 +43,25 @@
<entry name="mode" type="enum">
<enum>
<value>TRANSFORM_MATRIX
- <notes>Use the android.colorCorrection.transform matrix
- to do color conversion</notes></value>
+ <notes>Use the android.colorCorrection.transform matrix
+ to do color conversion</notes>
+ </value>
<value>FAST
- <notes>Must not slow down frame rate relative to raw
- bayer output</notes></value>
+ <notes>Must not slow down frame rate relative to raw
+ bayer output</notes>
+ </value>
<value>HIGH_QUALITY
- <notes>Frame rate may be reduced by high
- quality</notes></value>
+ <notes>Frame rate may be reduced by high
+ quality</notes>
+ </value>
</enum>
- <description>enum</description>
- <units>enum:</units>
</entry>
<entry name="transform" type="float"
type_notes="3x3 float matrix in row-major order"
container="array">
<array>
- <size>9</size>
+ <size>3</size>
+ <size>3</size>
</array>
<description>A transform matrix to chromatically adapt
pixels in the CIE XYZ (1931) color space from the scene
@@ -121,11 +123,13 @@
<entry name="aeMode" type="enum">
<enum>
<value>OFF
- <notes>Autoexposure is disabled; sensor.exposureTime
- and sensor.sensitivity are used</notes></value>
+ <notes>Autoexposure is disabled; sensor.exposureTime
+ and sensor.sensitivity are used</notes>
+ </value>
<value>ON
- <notes>Autoexposure is active, no flash
- control</notes></value>
+ <notes>Autoexposure is active, no flash
+ control</notes>
+ </value>
<value>ON_AUTO_FLASH
<notes>if flash exists Autoexposure is active, auto
flash control; flash may be fired when precapture
@@ -709,7 +713,6 @@
</enum>
<description>Controls the quality of the demosaicing
processing</description>
- <units>Enum:</units>
<tag id="V1" />
</entry>
</controls>
@@ -729,7 +732,6 @@
</enum>
<description>Operation mode for edge
enhancement</description>
- <units>enum:</units>
</entry>
<entry name="strength" type="byte">
<description>Control the amount of edge enhancement
@@ -776,7 +778,6 @@
firingPower</notes></value>
</enum>
<description>Select flash operation mode</description>
- <units>enum</units>
<tag id="BC" />
</entry>
</controls>
@@ -837,7 +838,6 @@
</enum>
<description>Current state of the flash
unit</description>
- <units>enum</units>
</entry>
</dynamic>
</section>
@@ -857,7 +857,6 @@
</enum>
<description>Operating mode of geometric
correction</description>
- <units>enum:</units>
</entry>
<entry name="strength" type="byte">
<description>Control the amount of shading correction
@@ -901,7 +900,6 @@
</enum>
<description>Set operational mode for hot pixel
correction</description>
- <units>Enum:</units>
<tag id="V1" />
</entry>
</controls>
@@ -1061,7 +1059,6 @@
</enum>
<description>Whether optical image stabilization is
enabled.</description>
- <units>enum</units>
<range>android.lens.availableOpticalStabilization</range>
<notes>Will not be supported on most devices.</notes>
<tag id="V1" />
@@ -1204,8 +1201,6 @@
</enum>
<description>Direction the camera faces relative to
device screen</description>
- <units>enum</units>
- <notes>}</notes>
</entry>
<entry name="opticalAxisAngle" type="float"
type_notes="degrees. First defines the angle of separation between the perpendicular to the screen and the camera optical axis. The second then defines the clockwise rotation of the optical axis from native device up."
@@ -1287,7 +1282,6 @@
</enum>
<description>Mode of operation for the noise reduction
algorithm</description>
- <units>enum:</units>
<range>android.noiseReduction.availableModes</range>
<tag id="V1" />
</entry>
@@ -1388,7 +1382,6 @@
</enum>
<description>How much metadata to produce on
output</description>
- <units>Enum:</units>
</entry>
<entry name="outputStreams" type="byte">
<description>Lists which camera output streams image data
@@ -1415,7 +1408,6 @@
</enum>
<description>The type of the request; either CAPTURE or
REPROCESS</description>
- <units>Enum:</units>
</entry>
</controls>
<static>
@@ -1924,7 +1916,6 @@
</enum>
<description>Quality of lens shading correction applied
to the image data</description>
- <units>enum:</units>
</entry>
<entry name="strength" type="byte">
<description>Control the amount of shading correction
@@ -1953,7 +1944,6 @@
</enum>
<description>State of the face detector
unit</description>
- <units>enum</units>
<range>
android.statistics.availableFaceDetectModes</range>
<tag id="BC" />
@@ -1965,7 +1955,6 @@
</enum>
<description>Operating mode for histogram
generation</description>
- <units>enum</units>
<tag id="V1" />
</entry>
<entry name="sharpnessMapMode" type="enum">
@@ -1975,7 +1964,6 @@
</enum>
<description>Operating mode for sharpness map
generation</description>
- <units>enum</units>
<tag id="V1" />
</entry>
</controls>
@@ -2146,7 +2134,6 @@
<notes>Frame rate may be reduced by high
quality</notes></value>
</enum>
- <units>enum:</units>
</entry>
</controls>
<static>
diff --git a/camera/docs/metadata_template.mako b/camera/docs/metadata_template.mako
index 6fb1b02..1afc67e 100644
--- a/camera/docs/metadata_template.mako
+++ b/camera/docs/metadata_template.mako
@@ -21,7 +21,11 @@
<tags>
% for tag in metadata.tags:
+ % if tag.description and tag.description.strip():
+ <tag id="${tag.id}">${tag.description}</tag>
+ % else:
<tag id="${tag.id}"><!-- TODO: fill the tag description --></tag>
+ % endif
% endfor
</tags>