summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Ray <aray@google.com>2013-10-07 23:25:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-07 23:25:56 +0000
commitf86b22f887c0f0d5371a3846aa661a7d55e167ba (patch)
tree9e202e3d02acb404949087f40cc961766d6f219a
parent59ccb1e070e988e93e5191a4bf5d0d7e5331e463 (diff)
parentef40ad6249555a0a45c57907f4b9509b59e3e9f5 (diff)
downloadandroid_system_media-f86b22f887c0f0d5371a3846aa661a7d55e167ba.tar.gz
android_system_media-f86b22f887c0f0d5371a3846aa661a7d55e167ba.tar.bz2
android_system_media-f86b22f887c0f0d5371a3846aa661a7d55e167ba.zip
Merge "camera_metadata: add non-full hw level optional tag" into klp-dev
-rw-r--r--camera/docs/CameraCharacteristicsTest.mako26
-rw-r--r--camera/docs/CameraMetadataKeys.mako12
-rw-r--r--camera/docs/docs.html16
-rw-r--r--camera/docs/metadata_model.py16
-rwxr-xr-xcamera/docs/metadata_parser_xml.py5
-rw-r--r--camera/docs/metadata_properties.xml17
-rw-r--r--camera/docs/metadata_properties.xsd8
-rw-r--r--camera/docs/metadata_template.mako3
8 files changed, 90 insertions, 13 deletions
diff --git a/camera/docs/CameraCharacteristicsTest.mako b/camera/docs/CameraCharacteristicsTest.mako
index 2c6c8693..a983e672 100644
--- a/camera/docs/CameraCharacteristicsTest.mako
+++ b/camera/docs/CameraCharacteristicsTest.mako
@@ -67,14 +67,26 @@ public class CameraCharacteristicsTest extends AndroidTestCase {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
- assertNotNull("Invalid property: ${entry.name}",
- props.get(CameraCharacteristics.${jkey_identifier(entry.name)}));
- List<Key<?>> allKeys = props.getKeys();
- assertNotNull(String.format("Can't get camera characteristics keys from: ID %s", ids[i],
- props));
- assertTrue("Key not in keys list: ${entry.name}",
- allKeys.contains(CameraCharacteristics.${jkey_identifier(entry.name)}));
+ % if entry.applied_optional:
+ Integer hwLevel = props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
+ assertNotNull("No hardware level reported! android.info.supportedHardwareLevel",
+ hwLevel);
+ if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
+ % endif
+ {
+
+ assertNotNull("Invalid property: ${entry.name}",
+ props.get(CameraCharacteristics.${jkey_identifier(entry.name)}));
+
+ List<Key<?>> allKeys = props.getKeys();
+ assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
+ ids[i], props));
+ assertTrue("Key not in keys list: ${entry.name}", allKeys.contains(
+ CameraCharacteristics.${jkey_identifier(entry.name)}));
+
+ }
+
}
}
% endif
diff --git a/camera/docs/CameraMetadataKeys.mako b/camera/docs/CameraMetadataKeys.mako
index 5e2f1c56..5c7ff2d2 100644
--- a/camera/docs/CameraMetadataKeys.mako
+++ b/camera/docs/CameraMetadataKeys.mako
@@ -39,6 +39,16 @@ ${entry.notes | javadoc}\
* @see #${jenum_value(entry, value)}
% endfor
% endif
+ % if entry.optional:
+ *
+ * <b>Optional</b> - This value may be null on some devices.
+ % endif
+ % if any(tag.name == 'FULL' for tag in entry.tags):
+ *
+ * <b>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL}</b> -
+ * Present on all devices that report being FULL level hardware devices in the
+ * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL HARDWARE_LEVEL} key.
+ % endif
% if entry.applied_visibility == 'hidden':
*
* @hide
@@ -82,4 +92,4 @@ ${generate_key(entry)}
${single_kind_keys(java_class, xml_kind)}\
/*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
* End generated code
- *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ \ No newline at end of file
+ *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 5c80c26d..d4f29fb6 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -8247,6 +8247,7 @@
<td class="entry_tags">
<ul class="entry_tags">
<li><a href="#tag_V1">V1</a></li>
+ <li><a href="#tag_FULL">FULL</a></li>
</ul>
</td>
@@ -8558,6 +8559,7 @@
<td class="entry_tags">
<ul class="entry_tags">
<li><a href="#tag_V1">V1</a></li>
+ <li><a href="#tag_FULL">FULL</a></li>
</ul>
</td>
@@ -9015,6 +9017,9 @@
</td>
<td class="entry_tags">
+ <ul class="entry_tags">
+ <li><a href="#tag_FULL">FULL</a></li>
+ </ul>
</td>
</tr> <!-- end of entry -->
@@ -11380,7 +11385,7 @@
</ul>
</li> <!-- tag_EXIF -->
<li id="tag_HAL2">HAL2 -
- Tag only used by camera device HAL 2.x
+ Entry is only used by camera device HAL 2.x
<ul class="tags_entries">
<li><a href="#controls_android.request.inputStreams">android.request.inputStreams</a> (controls)</li>
@@ -11389,6 +11394,15 @@
<li><a href="#controls_android.blackLevel.lock">android.blackLevel.lock</a> (controls)</li>
</ul>
</li> <!-- tag_HAL2 -->
+ <li id="tag_FULL">FULL -
+ Entry is required for full hardware level devices, and optional for other hardware levels
+
+ <ul class="tags_entries">
+ <li><a href="#static_android.sensor.baseGainFactor">android.sensor.baseGainFactor</a> (static)</li>
+ <li><a href="#static_android.sensor.maxAnalogSensitivity">android.sensor.maxAnalogSensitivity</a> (static)</li>
+ <li><a href="#dynamic_android.sensor.temperature">android.sensor.temperature</a> (dynamic)</li>
+ </ul>
+ </li> <!-- tag_FULL -->
</ul>
</div>
diff --git a/camera/docs/metadata_model.py b/camera/docs/metadata_model.py
index 66fe9d61..7db5ffe1 100644
--- a/camera/docs/metadata_model.py
+++ b/camera/docs/metadata_model.py
@@ -1018,6 +1018,11 @@ class Entry(Node):
public entries are visible in the Android SDK.
applied_visibility: As visibility, but always valid, defaulting to 'system'
if no visibility is given for an entry.
+ optional: a bool representing the optional attribute, which denotes the entry
+ is required for hardware level full devices, but optional for other
+ hardware levels. None if not present.
+ applied_optional: As optional but always valid, defaulting to False if no
+ optional attribute is present.
tuple_values: A sequence of strings describing the tuple values,
None if container is not 'tuple'.
description: A string description, or None.
@@ -1066,6 +1071,7 @@ class Entry(Node):
type_notes: A string with the notes for the type
visibility: A string describing the visibility, eg 'system', 'hidden',
'public'
+ optional: A bool to mark whether optional for non-full hardware devices
typedef: A string corresponding to a typedef's name attribute.
"""
@@ -1099,6 +1105,14 @@ class Entry(Node):
return self._visibility or 'system'
@property
+ def optional(self):
+ return self._optional
+
+ @property
+ def applied_optional(self):
+ return self._optional or False
+
+ @property
def name_short(self):
return self.get_name_minimal()
@@ -1203,6 +1217,7 @@ class Entry(Node):
self._enum = None
self._visibility = kwargs.get('visibility')
+ self._optional = kwargs.get('optional')
self._property_keys = kwargs
@@ -1397,6 +1412,7 @@ class MergedEntry(Entry):
'type',
'type_notes',
'visibility',
+ 'optional',
'typedef'
]
diff --git a/camera/docs/metadata_parser_xml.py b/camera/docs/metadata_parser_xml.py
index f0ed12e1..ec6957f2 100755
--- a/camera/docs/metadata_parser_xml.py
+++ b/camera/docs/metadata_parser_xml.py
@@ -158,6 +158,11 @@ class MetadataParserXml:
d['visibility'] = entry.get('visibility')
#
+ # Optional for non-full hardware level devices
+ #
+ d['optional'] = entry.get('optional') == 'true'
+
+ #
# Typedef
#
d['type_name'] = entry.get('typedef')
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 6e338b86..3e898c62 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -37,7 +37,10 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
<!-- TODO: fill the tag description -->
</tag>
<tag id="HAL2">
- Tag only used by camera device HAL 2.x
+ Entry is only used by camera device HAL 2.x
+ </tag>
+ <tag id="FULL">
+ Entry is required for full hardware level devices, and optional for other hardware levels
</tag>
</tags>
@@ -1938,10 +1941,12 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
<tag id="DNG" />
</entry>
</namespace>
- <entry name="baseGainFactor" type="rational" visibility="public">
+ <entry name="baseGainFactor" type="rational" visibility="public"
+ optional="true">
<description>Gain factor from electrons to raw units when
ISO=100</description>
<tag id="V1" />
+ <tag id="FULL" />
</entry>
<entry name="blackLevelPattern" type="int32"
type_notes="2x2 raw count block" container="array">
@@ -2020,7 +2025,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
adaptation</description>
<tag id="DNG" />
</entry>
- <entry name="maxAnalogSensitivity" type="int32" visibility="public">
+ <entry name="maxAnalogSensitivity" type="int32" visibility="public"
+ optional="true">
<description>Maximum sensitivity that is implemented
purely through analog gain</description>
<notes>For android.sensor.sensitivity values less than or
@@ -2028,6 +2034,7 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
values above this, it can be a mix of analog and
digital</notes>
<tag id="V1" />
+ <tag id="FULL" />
</entry>
<entry name="noiseModelCoefficients" type="float"
type_notes="float constants A, B for the noise variance model"
@@ -2114,7 +2121,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
system</notes>
<tag id="BC" />
</entry>
- <entry name="temperature" type="float" visibility="public">
+ <entry name="temperature" type="float" visibility="public"
+ optional="true">
<description>The temperature of the sensor, sampled at the time
exposure began for this frame.
@@ -2124,6 +2132,7 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
<units>celsius</units>
<range>Optional. This value is missing if no temperature is available.</range>
+ <tag id="FULL" />
</entry>
</dynamic>
</section>
diff --git a/camera/docs/metadata_properties.xsd b/camera/docs/metadata_properties.xsd
index 4e990bb7..851dfd6a 100644
--- a/camera/docs/metadata_properties.xsd
+++ b/camera/docs/metadata_properties.xsd
@@ -197,6 +197,14 @@
</restriction>
</simpleType>
</attribute>
+ <attribute name="optional" default="false">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="false" />
+ <enumeration value="true" />
+ </restriction>
+ </simpleType>
+ </attribute>
<attribute name="typedef" type="string" />
</complexType>
diff --git a/camera/docs/metadata_template.mako b/camera/docs/metadata_template.mako
index 5c03d3d1..da151030 100644
--- a/camera/docs/metadata_template.mako
+++ b/camera/docs/metadata_template.mako
@@ -85,6 +85,9 @@
% if prop.visibility:
visibility="${prop.visibility}"
% endif
+ % if prop.optional:
+ optional="${str(prop.optional).lower()}"
+ % endif
% if prop.enum:
enum="true"
% endif