--- /dev/null
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_EFFECT_DYNAMICSPROCESSING_CORE_H_
+#define ANDROID_EFFECT_DYNAMICSPROCESSING_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_DYNAMICSPROCESSING_ = { 0x7261676f, 0x6d75, 0x7369, 0x6364,
+ { 0x28, 0xe2, 0xfd, 0x3a, 0xc3, 0x9e } };
+const effect_uuid_t * const SL_IID_DYNAMICSPROCESSING = &SL_IID_DYNAMICSPROCESSING_;
+#endif //OPENSL_ES_H_
+
+/* enumerated parameters for dynamics processing effect */
+typedef enum
+{
+ DP_PARAM_GET_CHANNEL_COUNT = 0x10,
+ DP_PARAM_INPUT_GAIN = 0x20,
+ DP_PARAM_ENGINE_ARCHITECTURE = 0x30,
+ DP_PARAM_PRE_EQ = 0x40,
+ DP_PARAM_PRE_EQ_BAND = 0x45,
+ DP_PARAM_MBC = 0x50,
+ DP_PARAM_MBC_BAND = 0x55,
+ DP_PARAM_POST_EQ = 0x60,
+ DP_PARAM_POST_EQ_BAND = 0x65,
+ DP_PARAM_LIMITER = 0x70,
+} t_dynamicsprocessing_params;
+
+/* enumerated variants */
+typedef enum
+{
+ VARIANT_FAVOR_FREQUENCY_RESOLUTION = 0x00,
+ VARIANT_FAVOR_TIME_RESOLUTION = 0x01,
+} t_dynamicsprocessing_variants;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+
+#endif /*ANDROID_EFFECT_DYNAMICSPROCESSING_CORE_H_*/
--- /dev/null
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_DYNAMICSPROCESSING_H_
+#define ANDROID_EFFECT_DYNAMICSPROCESSING_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_dynamicsprocessing.h>
+
+#endif /*ANDROID_EFFECT_DYNAMICSPROCESSING_H_*/
% endif
<% gotSections = False %>\
+<% gotFirstNewSection = False %>\
% for idx, section in enumerate(find_all_sections_added_in_hal(metadata, hal_major_version(), hal_minor_version())):
% if idx == 0:
<% gotSections = True %>\
*/
enum CameraMetadataSection : ${'uint32_t' if first_hal_minor_version(hal_major_version()) == hal_minor_version() else '@%d.%d::CameraMetadataSection' % (hal_major_version(), hal_minor_version()-1)} {
% endif
- % if first_hal_minor_version(hal_major_version()) != hal_minor_version():
+ % if first_hal_minor_version(hal_major_version()) != hal_minor_version() and not gotFirstNewSection:
${path_name(section) | csym} =
android.hardware.camera.metadata@${hal_major_version()}.${hal_minor_version()-1}::CameraMetadataSection:ANDROID_SECTION_COUNT,
+<% gotFirstNewSection = True %>\
% else:
${path_name(section) | csym},
% endif
optional int32 android_reprocess_maxCaptureStall = 1638400;
optional bool android_depth_depthIsExclusive = 1703936;
optional int32 android_logicalMultiCamera_sensorSyncType = 1769472;
+ repeated int32 android_distortionCorrection_availableModes = 1835008;
// End of codegen fields
}
</li>
</ul> <!-- toc_section -->
</li>
+ <li>
+ <span class="toc_section_header"><a href="#section_distortionCorrection">distortionCorrection</a></span>
+ <ul class="toc_section">
+ <li>
+ <span class="toc_kind_header">controls</span>
+ <ul class="toc_section">
+ <li
+ ><a href="#controls_android.distortionCorrection.mode">android.distortionCorrection.mode</a></li>
+ </ul>
+ </li>
+ <li>
+ <span class="toc_kind_header">static</span>
+ <ul class="toc_section">
+ <li
+ ><a href="#static_android.distortionCorrection.availableModes">android.distortionCorrection.availableModes</a></li>
+ </ul>
+ </li>
+ <li>
+ <span class="toc_kind_header">dynamic</span>
+ <ul class="toc_section">
+ <li
+ ><a href="#dynamic_android.distortionCorrection.mode">android.distortionCorrection.mode</a></li>
+ </ul>
+ </li>
+ </ul> <!-- toc_section -->
+ </li>
</ul>
</tbody>
<!-- end of section -->
+ <tr><td colspan="7" id="section_distortionCorrection" class="section">distortionCorrection</td></tr>
+
+
+ <tr><td colspan="7" class="kind">controls</td></tr>
+
+ <thead class="entries_header">
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_hal_version">Initial HIDL HAL version</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="controls_android.distortionCorrection.mode">
+ <td class="entry_name
+ " rowspan="3">
+ android.<wbr/>distortion<wbr/>Correction.<wbr/>mode
+ </td>
+ <td class="entry_type">
+ <span class="entry_type_name entry_type_name_enum">byte</span>
+
+ <span class="entry_type_visibility"> [public]</span>
+
+
+
+
+
+ <ul class="entry_type_enum">
+ <li>
+ <span class="entry_type_enum_name">OFF (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>No distortion correction is applied.<wbr/></p></span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">FAST (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>Lens distortion correction is applied without reducing frame rate
+relative to sensor output.<wbr/> It may be the same as OFF if distortion correction would
+reduce frame rate relative to sensor.<wbr/></p></span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">HIGH_QUALITY (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>High-quality distortion correction is applied,<wbr/> at the cost of
+possibly reduced frame rate relative to sensor output.<wbr/></p></span>
+ </li>
+ </ul>
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ <p>Mode of operation for the lens distortion correction block.<wbr/></p>
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ <p><a href="#static_android.distortionCorrection.availableModes">android.<wbr/>distortion<wbr/>Correction.<wbr/>available<wbr/>Modes</a></p>
+ </td>
+
+ <td class="entry_hal_version">
+ <p>3.<wbr/>3</p>
+ </td>
+
+ <td class="entry_tags">
+ </td>
+
+ </tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="6">Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="6">
+ <p>The lens distortion correction block attempts to improve image quality by fixing
+radial,<wbr/> tangential,<wbr/> or other geometric aberrations in the camera device's optics.<wbr/> If
+available,<wbr/> the <a href="#static_android.lens.distortion">android.<wbr/>lens.<wbr/>distortion</a> field documents the lens's distortion parameters.<wbr/></p>
+<p>OFF means no distortion correction is done.<wbr/></p>
+<p>FAST/<wbr/>HIGH_<wbr/>QUALITY both mean camera device determined distortion correction will be
+applied.<wbr/> HIGH_<wbr/>QUALITY mode indicates that the camera device will use the highest-quality
+correction algorithms,<wbr/> even if it slows down capture rate.<wbr/> FAST means the camera device
+will not slow down capture rate when applying correction.<wbr/> FAST may be the same as OFF if
+any correction at all would slow down capture rate.<wbr/> Every output stream will have a
+similar amount of enhancement applied.<wbr/></p>
+<p>The correction only applies to processed outputs such as YUV,<wbr/> JPEG,<wbr/> or DEPTH16; it is not
+applied to any RAW output.<wbr/> Metadata coordinates such as face rectangles or metering
+regions are also not affected by correction.<wbr/></p>
+<p>Applications enabling distortion correction need to pay extra attention when converting
+image coordinates between corrected output buffers and the sensor array.<wbr/> For example,<wbr/> if
+the app supports tap-to-focus and enables correction,<wbr/> it then has to apply the distortion
+model described in <a href="#static_android.lens.distortion">android.<wbr/>lens.<wbr/>distortion</a> to the image buffer tap coordinates to properly
+calculate the tap position on the sensor active array to be used with
+<a href="#controls_android.control.afRegions">android.<wbr/>control.<wbr/>af<wbr/>Regions</a>.<wbr/> The same applies in reverse to detected face rectangles if
+they need to be drawn on top of the corrected output buffers.<wbr/></p>
+ </td>
+ </tr>
+
+
+ <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+ <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+ <tr><td colspan="7" class="kind">static</td></tr>
+
+ <thead class="entries_header">
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_hal_version">Initial HIDL HAL version</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="static_android.distortionCorrection.availableModes">
+ <td class="entry_name
+ " rowspan="5">
+ android.<wbr/>distortion<wbr/>Correction.<wbr/>available<wbr/>Modes
+ </td>
+ <td class="entry_type">
+ <span class="entry_type_name">byte</span>
+ <span class="entry_type_container">x</span>
+
+ <span class="entry_type_array">
+ n
+ </span>
+ <span class="entry_type_visibility"> [public as enumList]</span>
+
+
+
+
+ <div class="entry_type_notes">list of enums</div>
+
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ <p>List of distortion correction modes for <a href="#controls_android.distortionCorrection.mode">android.<wbr/>distortion<wbr/>Correction.<wbr/>mode</a> that are
+supported by this camera device.<wbr/></p>
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ <p>Any value listed in <a href="#controls_android.distortionCorrection.mode">android.<wbr/>distortion<wbr/>Correction.<wbr/>mode</a></p>
+ </td>
+
+ <td class="entry_hal_version">
+ <p>3.<wbr/>3</p>
+ </td>
+
+ <td class="entry_tags">
+ <ul class="entry_tags">
+ <li><a href="#tag_V1">V1</a></li>
+ <li><a href="#tag_REPROC">REPROC</a></li>
+ </ul>
+ </td>
+
+ </tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="6">Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="6">
+ <p>No device is required to support this API; such devices will always list only 'OFF'.<wbr/>
+All devices that support this API will list both FAST and HIGH_<wbr/>QUALITY.<wbr/></p>
+ </td>
+ </tr>
+
+ <tr class="entries_header">
+ <th class="th_details" colspan="6">HAL Implementation Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="6">
+ <p>HAL must support both FAST and HIGH_<wbr/>QUALITY if distortion correction is available
+on the camera device,<wbr/> but the underlying implementation can be the same for both modes.<wbr/>
+That is,<wbr/> if the highest quality implementation on the camera device does not slow down
+capture rate,<wbr/> then FAST and HIGH_<wbr/>QUALITY will generate the same output.<wbr/></p>
+ </td>
+ </tr>
+
+ <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+ <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+ <tr><td colspan="7" class="kind">dynamic</td></tr>
+
+ <thead class="entries_header">
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_hal_version">Initial HIDL HAL version</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="dynamic_android.distortionCorrection.mode">
+ <td class="entry_name
+ " rowspan="3">
+ android.<wbr/>distortion<wbr/>Correction.<wbr/>mode
+ </td>
+ <td class="entry_type">
+ <span class="entry_type_name entry_type_name_enum">byte</span>
+
+ <span class="entry_type_visibility"> [public]</span>
+
+
+
+
+
+ <ul class="entry_type_enum">
+ <li>
+ <span class="entry_type_enum_name">OFF (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>No distortion correction is applied.<wbr/></p></span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">FAST (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>Lens distortion correction is applied without reducing frame rate
+relative to sensor output.<wbr/> It may be the same as OFF if distortion correction would
+reduce frame rate relative to sensor.<wbr/></p></span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">HIGH_QUALITY (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>High-quality distortion correction is applied,<wbr/> at the cost of
+possibly reduced frame rate relative to sensor output.<wbr/></p></span>
+ </li>
+ </ul>
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ <p>Mode of operation for the lens distortion correction block.<wbr/></p>
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ <p><a href="#static_android.distortionCorrection.availableModes">android.<wbr/>distortion<wbr/>Correction.<wbr/>available<wbr/>Modes</a></p>
+ </td>
+
+ <td class="entry_hal_version">
+ <p>3.<wbr/>3</p>
+ </td>
+
+ <td class="entry_tags">
+ </td>
+
+ </tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="6">Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="6">
+ <p>The lens distortion correction block attempts to improve image quality by fixing
+radial,<wbr/> tangential,<wbr/> or other geometric aberrations in the camera device's optics.<wbr/> If
+available,<wbr/> the <a href="#static_android.lens.distortion">android.<wbr/>lens.<wbr/>distortion</a> field documents the lens's distortion parameters.<wbr/></p>
+<p>OFF means no distortion correction is done.<wbr/></p>
+<p>FAST/<wbr/>HIGH_<wbr/>QUALITY both mean camera device determined distortion correction will be
+applied.<wbr/> HIGH_<wbr/>QUALITY mode indicates that the camera device will use the highest-quality
+correction algorithms,<wbr/> even if it slows down capture rate.<wbr/> FAST means the camera device
+will not slow down capture rate when applying correction.<wbr/> FAST may be the same as OFF if
+any correction at all would slow down capture rate.<wbr/> Every output stream will have a
+similar amount of enhancement applied.<wbr/></p>
+<p>The correction only applies to processed outputs such as YUV,<wbr/> JPEG,<wbr/> or DEPTH16; it is not
+applied to any RAW output.<wbr/> Metadata coordinates such as face rectangles or metering
+regions are also not affected by correction.<wbr/></p>
+<p>Applications enabling distortion correction need to pay extra attention when converting
+image coordinates between corrected output buffers and the sensor array.<wbr/> For example,<wbr/> if
+the app supports tap-to-focus and enables correction,<wbr/> it then has to apply the distortion
+model described in <a href="#static_android.lens.distortion">android.<wbr/>lens.<wbr/>distortion</a> to the image buffer tap coordinates to properly
+calculate the tap position on the sensor active array to be used with
+<a href="#controls_android.control.afRegions">android.<wbr/>control.<wbr/>af<wbr/>Regions</a>.<wbr/> The same applies in reverse to detected face rectangles if
+they need to be drawn on top of the corrected output buffers.<wbr/></p>
+ </td>
+ </tr>
+
+
+ <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+ <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+
+ <!-- end of section -->
<!-- </namespace> -->
</table>
<li><a href="#dynamic_android.statistics.hotPixelMap">android.statistics.hotPixelMap</a> (dynamic)</li>
<li><a href="#dynamic_android.sync.frameNumber">android.sync.frameNumber</a> (dynamic)</li>
<li><a href="#static_android.sync.maxLatency">android.sync.maxLatency</a> (static)</li>
+ <li><a href="#static_android.distortionCorrection.availableModes">android.distortionCorrection.availableModes</a> (static)</li>
<li><a href="#dynamic_android.edge.mode">android.edge.mode</a> (dynamic)</li>
<li><a href="#dynamic_android.hotPixel.mode">android.hotPixel.mode</a> (dynamic)</li>
<li><a href="#dynamic_android.lens.aperture">android.lens.aperture</a> (dynamic)</li>
<li><a href="#static_android.scaler.availableInputOutputFormatsMap">android.scaler.availableInputOutputFormatsMap</a> (static)</li>
<li><a href="#controls_android.reprocess.effectiveExposureFactor">android.reprocess.effectiveExposureFactor</a> (controls)</li>
<li><a href="#static_android.reprocess.maxCaptureStall">android.reprocess.maxCaptureStall</a> (static)</li>
+ <li><a href="#static_android.distortionCorrection.availableModes">android.distortionCorrection.availableModes</a> (static)</li>
<li><a href="#dynamic_android.edge.mode">android.edge.mode</a> (dynamic)</li>
<li><a href="#dynamic_android.noiseReduction.mode">android.noiseReduction.mode</a> (dynamic)</li>
</ul>
</entry>
</static>
</section>
+ <section name="distortionCorrection">
+ <controls>
+ <entry name="mode" type="byte" visibility="public" enum="true" hal_version="3.3">
+ <enum>
+ <value>OFF
+ <notes>No distortion correction is applied.</notes></value>
+ <value>FAST <notes>Lens distortion correction is applied without reducing frame rate
+ relative to sensor output. It may be the same as OFF if distortion correction would
+ reduce frame rate relative to sensor.</notes></value>
+ <value>HIGH_QUALITY <notes>High-quality distortion correction is applied, at the cost of
+ possibly reduced frame rate relative to sensor output.</notes></value>
+ </enum>
+ <description>Mode of operation for the lens distortion correction block.</description>
+ <range>android.distortionCorrection.availableModes</range>
+ <details>The lens distortion correction block attempts to improve image quality by fixing
+ radial, tangential, or other geometric aberrations in the camera device's optics. If
+ available, the android.lens.distortion field documents the lens's distortion parameters.
+
+ OFF means no distortion correction is done.
+
+ FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
+ applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
+ correction algorithms, even if it slows down capture rate. FAST means the camera device
+ will not slow down capture rate when applying correction. FAST may be the same as OFF if
+ any correction at all would slow down capture rate. Every output stream will have a
+ similar amount of enhancement applied.
+
+ The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
+ applied to any RAW output. Metadata coordinates such as face rectangles or metering
+ regions are also not affected by correction.
+
+ Applications enabling distortion correction need to pay extra attention when converting
+ image coordinates between corrected output buffers and the sensor array. For example, if
+ the app supports tap-to-focus and enables correction, it then has to apply the distortion
+ model described in android.lens.distortion to the image buffer tap coordinates to properly
+ calculate the tap position on the sensor active array to be used with
+ android.control.afRegions. The same applies in reverse to detected face rectangles if
+ they need to be drawn on top of the corrected output buffers.
+ </details>
+ </entry>
+ </controls>
+ <static>
+ <entry name="availableModes" type="byte" visibility="public"
+ type_notes="list of enums" container="array" typedef="enumList" hal_version="3.3">
+ <array>
+ <size>n</size>
+ </array>
+ <description>
+ List of distortion correction modes for android.distortionCorrection.mode that are
+ supported by this camera device.
+ </description>
+ <range>Any value listed in android.distortionCorrection.mode</range>
+ <details>
+ No device is required to support this API; such devices will always list only 'OFF'.
+ All devices that support this API will list both FAST and HIGH_QUALITY.
+ </details>
+ <hal_details>
+ HAL must support both FAST and HIGH_QUALITY if distortion correction is available
+ on the camera device, but the underlying implementation can be the same for both modes.
+ That is, if the highest quality implementation on the camera device does not slow down
+ capture rate, then FAST and HIGH_QUALITY will generate the same output.
+ </hal_details>
+ <tag id="V1" />
+ <tag id="REPROC" />
+ </entry>
+ </static>
+ <dynamic>
+ <clone entry="android.distortionCorrection.mode" kind="controls" hal_version="3.3">
+ </clone>
+ </dynamic>
+ </section>
</namespace>
</metadata>
</restriction>
</simpleType>
</attribute>
+ <attribute name="hal_version" type="decimal" default="3.2" />
</complexType>
</schema>
target_kind = p.target_kind
target_entry = self._entry_map[target_kind].get(p.name)
p._entry = target_entry
-
+ if (p.hal_major_version == 0):
+ p._hal_major_version = target_entry._hal_major_version
+ p._hal_minor_version = target_entry._hal_minor_version
# should not throw if we pass validation
# but can happen when importing obsolete CSV entries
if target_entry is None:
hal_version = kwargs.get('hal_version')
if hal_version is None:
- self._hal_major_version = 3
- self._hal_minor_version = 2
+ if self.is_clone():
+ self._hal_major_version = 0
+ self._hal_minor_version = 0
+ else:
+ self._hal_major_version = 3
+ self._hal_minor_version = 2
else:
self._hal_major_version = int(hal_version.partition('.')[0])
self._hal_minor_version = int(hal_version.partition('.')[2])
# no type_notes since its the same
}
d2 = {}
+ if 'hal_version' in entry.attrs:
+ d2['hal_version'] = entry['hal_version']
insert = self.metadata.insert_clone
<%def name="insert_entry(prop)">
% if prop.is_clone():
- <clone entry="${prop.name}" kind="${prop.target_kind}">
+ <clone entry="${prop.name}" kind="${prop.target_kind}"
+ % if ('hal_version' in prop._property_keys):
+ hal_version="${prop.hal_major_version}.${prop.hal_minor_version}"
+ % endif
+ >
% if prop.details is not None:
<details>${prop.details}</details>
validate_error(error_msg)
success = False
+ if matching_entry is not None:
+ entry_hal_major_version = 3
+ entry_hal_minor_version = 2
+ entry_hal_version = matching_entry.get('hal_version')
+ if entry_hal_version is not None:
+ entry_hal_major_version = int(entry_hal_version.partition('.')[0])
+ entry_hal_minor_version = int(entry_hal_version.partition('.')[2])
+
+ clone_hal_major_version = entry_hal_major_version
+ clone_hal_minor_version = entry_hal_minor_version
+ clone_hal_version = clone.get('hal_version')
+ if clone_hal_version is not None:
+ clone_hal_major_version = int(clone_hal_version.partition('.')[0])
+ clone_hal_minor_version = int(clone_hal_version.partition('.')[2])
+
+ if clone_hal_major_version < entry_hal_major_version or \
+ (clone_hal_major_version == entry_hal_major_version and \
+ clone_hal_minor_version < entry_hal_minor_version):
+ error_msg = ("Clone '%s' HAL version '%d.%d' is older than entry target HAL version '%d.%d'" \
+ % (clone_name, clone_hal_major_version, clone_hal_minor_version, entry_hal_major_version, entry_hal_minor_version))
+ validate_error(error_msg)
+ success = False
+
return success
# All <entry> elements with container=$foo have a <$foo> child
ANDROID_REPROCESS,
ANDROID_DEPTH,
ANDROID_LOGICAL_MULTI_CAMERA,
+ ANDROID_DISTORTION_CORRECTION,
ANDROID_SECTION_COUNT,
VENDOR_SECTION = 0x8000
ANDROID_LOGICAL_MULTI_CAMERA_START
= ANDROID_LOGICAL_MULTI_CAMERA
<< 16,
+ ANDROID_DISTORTION_CORRECTION_START
+ = ANDROID_DISTORTION_CORRECTION
+ << 16,
VENDOR_SECTION_START = VENDOR_SECTION << 16
} camera_metadata_section_start_t;
ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE, // enum | public | HIDL v3.3
ANDROID_LOGICAL_MULTI_CAMERA_END,
+ ANDROID_DISTORTION_CORRECTION_MODE = // enum | public | HIDL v3.3
+ ANDROID_DISTORTION_CORRECTION_START,
+ ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES, // byte[] | public | HIDL v3.3
+ ANDROID_DISTORTION_CORRECTION_END,
+
} camera_metadata_tag_t;
/**
} camera_metadata_enum_android_logical_multi_camera_sensor_sync_type_t;
+// ANDROID_DISTORTION_CORRECTION_MODE
+typedef enum camera_metadata_enum_android_distortion_correction_mode {
+ ANDROID_DISTORTION_CORRECTION_MODE_OFF , // HIDL v3.3
+ ANDROID_DISTORTION_CORRECTION_MODE_FAST , // HIDL v3.3
+ ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY , // HIDL v3.3
+} camera_metadata_enum_android_distortion_correction_mode_t;
+
+
[ANDROID_REPROCESS] = "android.reprocess",
[ANDROID_DEPTH] = "android.depth",
[ANDROID_LOGICAL_MULTI_CAMERA] = "android.logicalMultiCamera",
+ [ANDROID_DISTORTION_CORRECTION]
+ = "android.distortionCorrection",
};
unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
ANDROID_DEPTH_END },
[ANDROID_LOGICAL_MULTI_CAMERA] = { ANDROID_LOGICAL_MULTI_CAMERA_START,
ANDROID_LOGICAL_MULTI_CAMERA_END },
+ [ANDROID_DISTORTION_CORRECTION]
+ = { ANDROID_DISTORTION_CORRECTION_START,
+ ANDROID_DISTORTION_CORRECTION_END },
};
static tag_info_t android_color_correction[ANDROID_COLOR_CORRECTION_END -
{ "sensorSyncType", TYPE_BYTE },
};
+static tag_info_t android_distortion_correction[ANDROID_DISTORTION_CORRECTION_END -
+ ANDROID_DISTORTION_CORRECTION_START] = {
+ [ ANDROID_DISTORTION_CORRECTION_MODE - ANDROID_DISTORTION_CORRECTION_START ] =
+ { "mode", TYPE_BYTE },
+ [ ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES - ANDROID_DISTORTION_CORRECTION_START ] =
+ { "availableModes", TYPE_BYTE },
+};
+
tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
android_color_correction,
android_reprocess,
android_depth,
android_logical_multi_camera,
+ android_distortion_correction,
};
int camera_metadata_enum_snprint(uint32_t tag,
break;
}
+ case ANDROID_DISTORTION_CORRECTION_MODE: {
+ switch (value) {
+ case ANDROID_DISTORTION_CORRECTION_MODE_OFF:
+ msg = "OFF";
+ ret = 0;
+ break;
+ case ANDROID_DISTORTION_CORRECTION_MODE_FAST:
+ msg = "FAST";
+ ret = 0;
+ break;
+ case ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY:
+ msg = "HIGH_QUALITY";
+ ret = 0;
+ break;
+ default:
+ msg = "error: enum value out of range";
+ }
+ break;
+ }
+ case ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES: {
+ break;
+ }
+
}
strncpy(dst, msg, size - 1);