OSDN Git Service

Merge "Camera: Add support for camera HEIC output"
authorShuzhen Wang <shuzhenwang@google.com>
Thu, 7 Feb 2019 19:15:32 +0000 (19:15 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 7 Feb 2019 19:15:32 +0000 (19:15 +0000)
camera/docs/docs.html
camera/docs/metadata_definitions.xml
camera/include/system/camera_metadata_tags.h
camera/src/camera_metadata_tag_info.c

index f7c6701..acf1864 100644 (file)
         </li>
       </ul> <!-- toc_section -->
     </li>
+    <li>
+      <span class="toc_section_header"><a href="#section_heic">heic</a></span>
+      <ul class="toc_section">
+        <li>
+          <span class="toc_kind_header">static</span>
+          <ul class="toc_section">
+
+            <li
+            ><a href="#static_android.heic.info.supported">android.heic.info.supported</a></li>
+            <li
+            ><a href="#static_android.heic.info.maxJpegAppSegmentsCount">android.heic.info.maxJpegAppSegmentsCount</a></li>
+
+            <li
+            ><a href="#static_android.heic.availableHeicStreamConfigurations">android.heic.availableHeicStreamConfigurations</a></li>
+            <li
+            ><a href="#static_android.heic.availableHeicMinFrameDurations">android.heic.availableHeicMinFrameDurations</a></li>
+            <li
+            ><a href="#static_android.heic.availableHeicStallDurations">android.heic.availableHeicStallDurations</a></li>
+          </ul>
+        </li>
+      </ul> <!-- toc_section -->
+    </li>
   </ul>
 
 
@@ -11405,6 +11427,7 @@ are stuck at an arbitrary value or are oversensitive).<wbr/></p>
               <p>Setting a location object in a request will include the GPS coordinates of the location
 into any JPEG images captured based on the request.<wbr/> These coordinates can then be
 viewed by anyone who receives the JPEG image.<wbr/></p>
+<p>This tag is also used for HEIC image capture.<wbr/></p>
             </td>
           </tr>
 
@@ -11415,7 +11438,7 @@ viewed by anyone who receives the JPEG image.<wbr/></p>
                 
           <tr class="entry" id="controls_android.jpeg.gpsCoordinates">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Coordinates
             </td>
             <td class="entry_type">
@@ -11459,6 +11482,14 @@ EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -11467,7 +11498,7 @@ EXIF.<wbr/></p>
                 
           <tr class="entry" id="controls_android.jpeg.gpsProcessingMethod">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Processing<wbr/>Method
             </td>
             <td class="entry_type">
@@ -11506,6 +11537,14 @@ include in EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -11514,7 +11553,7 @@ include in EXIF.<wbr/></p>
                 
           <tr class="entry" id="controls_android.jpeg.gpsTimestamp">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Timestamp
             </td>
             <td class="entry_type">
@@ -11553,6 +11592,14 @@ EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -11635,6 +11682,10 @@ sensors which are not EXTERNAL,<wbr/> the following sample code may be used:</p>
 </code></pre>
 <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
 also be set to EXTERNAL.<wbr/> The above code is not relevant in such case.<wbr/></p>
+<p>This tag is also used to describe the orientation of the HEIC image capture,<wbr/> in which
+case the rotation is reflected by
+<a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>,<wbr/> and not by
+rotating the image data itself.<wbr/></p>
             </td>
           </tr>
 
@@ -11689,7 +11740,8 @@ image.<wbr/></p>
           </tr>
           <tr class="entry_cont">
             <td class="entry_details" colspan="6">
-              <p>85-95 is typical usage range.<wbr/></p>
+              <p>85-95 is typical usage range.<wbr/> This tag is also used to describe the quality
+of the HEIC image capture.<wbr/></p>
             </td>
           </tr>
 
@@ -11700,7 +11752,7 @@ image.<wbr/></p>
                 
           <tr class="entry" id="controls_android.jpeg.thumbnailQuality">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>thumbnail<wbr/>Quality
             </td>
             <td class="entry_type">
@@ -11739,6 +11791,14 @@ thumbnail.<wbr/></p>
             </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>This tag is also used to describe the quality of the HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -11816,6 +11876,10 @@ the camera device will handle thumbnail rotation in one of the following ways:</
   orientation is requested.<wbr/> LEGACY device will always report unrotated thumbnail
   size.<wbr/></li>
 </ul>
+<p>The tag is also used as thumbnail size for HEIC image format capture,<wbr/> in which case the
+the thumbnail rotation is reflected by
+<a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>,<wbr/> and not by
+rotating the thumbnail data itself.<wbr/></p>
             </td>
           </tr>
 
@@ -11927,6 +11991,7 @@ one corresponding size that has the same aspect ratio in availableThumbnailSizes
 and vice versa.<wbr/></li>
 <li>All non-<code>(0,<wbr/> 0)</code> sizes will have non-zero widths and heights.<wbr/></li>
 </ul>
+<p>This list is also used as supported thumbnail sizes for HEIC image format capture.<wbr/></p>
             </td>
           </tr>
 
@@ -12061,6 +12126,7 @@ JPEG</p>
               <p>Setting a location object in a request will include the GPS coordinates of the location
 into any JPEG images captured based on the request.<wbr/> These coordinates can then be
 viewed by anyone who receives the JPEG image.<wbr/></p>
+<p>This tag is also used for HEIC image capture.<wbr/></p>
             </td>
           </tr>
 
@@ -12071,7 +12137,7 @@ viewed by anyone who receives the JPEG image.<wbr/></p>
                 
           <tr class="entry" id="dynamic_android.jpeg.gpsCoordinates">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Coordinates
             </td>
             <td class="entry_type">
@@ -12115,6 +12181,14 @@ EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -12123,7 +12197,7 @@ EXIF.<wbr/></p>
                 
           <tr class="entry" id="dynamic_android.jpeg.gpsProcessingMethod">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Processing<wbr/>Method
             </td>
             <td class="entry_type">
@@ -12162,6 +12236,14 @@ include in EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -12170,7 +12252,7 @@ include in EXIF.<wbr/></p>
                 
           <tr class="entry" id="dynamic_android.jpeg.gpsTimestamp">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>gps<wbr/>Timestamp
             </td>
             <td class="entry_type">
@@ -12209,6 +12291,14 @@ EXIF.<wbr/></p>
             </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>This tag is also used for HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -12291,6 +12381,10 @@ sensors which are not EXTERNAL,<wbr/> the following sample code may be used:</p>
 </code></pre>
 <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
 also be set to EXTERNAL.<wbr/> The above code is not relevant in such case.<wbr/></p>
+<p>This tag is also used to describe the orientation of the HEIC image capture,<wbr/> in which
+case the rotation is reflected by
+<a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>,<wbr/> and not by
+rotating the image data itself.<wbr/></p>
             </td>
           </tr>
 
@@ -12345,7 +12439,8 @@ image.<wbr/></p>
           </tr>
           <tr class="entry_cont">
             <td class="entry_details" colspan="6">
-              <p>85-95 is typical usage range.<wbr/></p>
+              <p>85-95 is typical usage range.<wbr/> This tag is also used to describe the quality
+of the HEIC image capture.<wbr/></p>
             </td>
           </tr>
 
@@ -12417,7 +12512,7 @@ the JPEG stream will be 1000000 bytes,<wbr/> of which the first
                 
           <tr class="entry" id="dynamic_android.jpeg.thumbnailQuality">
             <td class="entry_name
-             " rowspan="1">
+             " rowspan="3">
               android.<wbr/>jpeg.<wbr/>thumbnail<wbr/>Quality
             </td>
             <td class="entry_type">
@@ -12456,6 +12551,14 @@ thumbnail.<wbr/></p>
             </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>This tag is also used to describe the quality of the HEIC image capture.<wbr/></p>
+            </td>
+          </tr>
 
 
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
@@ -12533,6 +12636,10 @@ the camera device will handle thumbnail rotation in one of the following ways:</
   orientation is requested.<wbr/> LEGACY device will always report unrotated thumbnail
   size.<wbr/></li>
 </ul>
+<p>The tag is also used as thumbnail size for HEIC image format capture,<wbr/> in which case the
+the thumbnail rotation is reflected by
+<a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>,<wbr/> and not by
+rotating the thumbnail data itself.<wbr/></p>
             </td>
           </tr>
 
@@ -31573,6 +31680,457 @@ own requirements.<wbr/></p>
       </tbody>
 
   <!-- end of section -->
+  <tr><td colspan="7" id="section_heic" class="section">heic</td></tr>
+
+
+      <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.heic.info.supported">
+            <td class="entry_name
+             " rowspan="3">
+              android.<wbr/>heic.<wbr/>info.<wbr/>supported
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name entry_type_name_enum">byte</span>
+
+              <span class="entry_type_visibility"> [system as boolean]</span>
+
+
+              <span class="entry_type_hwlevel">[limited] </span>
+
+
+
+                <ul class="entry_type_enum">
+                  <li>
+                    <span class="entry_type_enum_name">FALSE (v3.4)</span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">TRUE (v3.4)</span>
+                  </li>
+                </ul>
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>Whether this camera device can support identical set of stream combinations
+involving HEIC image format,<wbr/> compared to the
+<a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureSession">table of combinations</a>
+involving JPEG image format required for the device's hardware level and capabilities.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_HEIC">HEIC</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>All the static,<wbr/> control and dynamic metadata tags related to JPEG apply to HEIC formats
+as well.<wbr/> For example,<wbr/> the same <a href="#controls_android.jpeg.orientation">android.<wbr/>jpeg.<wbr/>orientation</a> and <a href="#controls_android.jpeg.quality">android.<wbr/>jpeg.<wbr/>quality</a> are
+used to control the orientation and quality of the HEIC image.<wbr/> Configuring JPEG and
+HEIC streams at the same time is not supported.<wbr/></p>
+<p>If a camera device supports HEIC format (ISO/<wbr/>IEC 23008-12),<wbr/> not only does it
+support the existing mandatory stream
+<a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureSession">combinations</a>
+required for the device's hardware level and capabilities,<wbr/> it also supports swapping
+each JPEG stream with HEIC stream in all guaranteed combinations.<wbr/></p>
+<p>For every HEIC stream configured by the application,<wbr/> the camera framework sets up 2
+internal streams with camera HAL:</p>
+<ul>
+<li>A YUV_<wbr/>420_<wbr/>888 or IMPLEMENTATION_<wbr/>DEFINED HAL stream as input to HEIC or HEVC encoder.<wbr/></li>
+<li>A BLOB stream with JPEG_<wbr/>APPS_<wbr/>SEGMENTS dataspace to extract application markers
+including EXIF and thumbnail to be saved in HEIF container.<wbr/></li>
+</ul>
+<p>A camera device can output HEIC format to the application if and only if:</p>
+<ul>
+<li>The system contains a HEIC or HEVC encoder with constant quality mode,<wbr/> and</li>
+<li>This tag is set to TRUE,<wbr/> meaning that camera HAL supports replacing JPEG streams in
+all mandatory stream combinations with a [YUV_<wbr/>420_<wbr/>888/<wbr/>IMPLEMENTATION_<wbr/>DEFINED stream +
+JPEG_<wbr/>APPS_<wbr/>SEGMENT BLOB stream] combo.<wbr/></li>
+</ul>
+<p>As an example,<wbr/> if the camera device's hardware level is LIMITED,<wbr/> and it supports HEIC,<wbr/>
+in addition to the required stream combinations,<wbr/> HAL must support below stream
+combinations as well:</p>
+<ul>
+<li>IMPLEMENTATION_<wbr/>DEFINED/<wbr/>YUV_<wbr/>420_<wbr/>888 MAXIMUM + JPEG_<wbr/>SEGMENTS_<wbr/>BLOB,<wbr/></li>
+<li>PRIV PREVIEW + IMPLEMENTATION_<wbr/>DEFINED/<wbr/>YUV_<wbr/>420_<wbr/>888 MAXIMUM + JPEG_<wbr/>SEGMENTS_<wbr/>BLOB,<wbr/></li>
+<li>YUV PREVIEW + IMPLEMENTATION_<wbr/>DEFINED/<wbr/>YUV_<wbr/>420_<wbr/>888 MAXIMUM + JPEG_<wbr/>SEGMENTS_<wbr/>BLOB,<wbr/></li>
+<li>PRIV PREVIEW + YUV PREVIEW + IMPLEMENTATION_<wbr/>DEFINED/<wbr/>YUV_<wbr/>420_<wbr/>888 MAXIMUM +
+JPEG_<wbr/>SEGMENTS_<wbr/>BLOB</li>
+</ul>
+<p>The selection logic between YUV_<wbr/>420_<wbr/>888 and IMPLEMENTATION_<wbr/>DEFINED for HAL internal
+stream is as follows:</p>
+<pre><code>if (HEIC encoder exists and supports the size) {
+    use IMPLEMENTATION_<wbr/>DEFINED with GRALLOC_<wbr/>USAGE_<wbr/>HW_<wbr/>IMAGE_<wbr/>ENCODER usage flag;
+} else {
+    //<wbr/> HVC encoder exists
+    if (size is less than framework predefined tile size) {
+        use IMPLEMENTATINO_<wbr/>DEFINED with GRALLOC_<wbr/>USAGE_<wbr/>HW_<wbr/>VIDEO_<wbr/>ENCODER usage flag;
+    } else {
+        use YUV_<wbr/>420_<wbr/>888;
+    }
+}
+</code></pre>
+            </td>
+          </tr>
+
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
+                
+          <tr class="entry" id="static_android.heic.info.maxJpegAppSegmentsCount">
+            <td class="entry_name
+             " rowspan="3">
+              android.<wbr/>heic.<wbr/>info.<wbr/>max<wbr/>Jpeg<wbr/>App<wbr/>Segments<wbr/>Count
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name">byte</span>
+
+              <span class="entry_type_visibility"> [system]</span>
+
+
+              <span class="entry_type_hwlevel">[limited] </span>
+
+
+
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>The maximum number of Jpeg APP segments supported by the camera HAL device.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_HEIC">HEIC</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>The camera framework will use this value to derive the size of the BLOB buffer with
+JPEG_<wbr/>APP_<wbr/>SEGMENTS dataspace,<wbr/> with each APP segment occupying at most 64K bytes.<wbr/> If the
+value of this tag is n,<wbr/> the size of the framework allocated buffer will be:</p>
+<pre><code>n * (2 + 0xFFFF) + sizeof(struct CameraBlob)
+</code></pre>
+<p>where 2 is number of bytes for APP marker,<wbr/> 0xFFFF is the maximum size per APP segment
+(including segment size).<wbr/></p>
+<p>The value of this tag must be at least 1,<wbr/> and APP1 marker (0xFFE1) segment must be the
+first segment stored in the JPEG_<wbr/>APPS_<wbr/>SEGMENTS BLOB buffer.<wbr/> APP1 segment stores EXIF and
+thumbnail.<wbr/></p>
+<p>Since media encoder embeds the orientation in the metadata of the output image,<wbr/> to be
+consistent between main image and thumbnail,<wbr/> camera HAL must not rotate the thumbnail
+image data based on <a href="#controls_android.jpeg.orientation">android.<wbr/>jpeg.<wbr/>orientation</a>.<wbr/> The framework will write the orientation
+into EXIF and HEIC container.<wbr/></p>
+<p>APP1 segment is followed immediately by one or multiple APP2 segments,<wbr/> and APPn
+segments.<wbr/> After the HAL fills and returns the JPEG_<wbr/>APP_<wbr/>SEGMENTS buffer,<wbr/> the camera
+framework modifies the APP1 segment by filling in the EXIF tags that are related to
+main image bitstream and the tags that can be derived from capture result metadata,<wbr/>
+before saving them into the HEIC container.<wbr/></p>
+<p>The value of this tag must not be more than 16.<wbr/></p>
+            </td>
+          </tr>
+
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
+        
+        
+
+                
+          <tr class="entry" id="static_android.heic.availableHeicStreamConfigurations">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>heic.<wbr/>available<wbr/>Heic<wbr/>Stream<wbr/>Configurations
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name entry_type_name_enum">int32</span>
+                <span class="entry_type_container">x</span>
+
+                <span class="entry_type_array">
+                  n x 4
+                </span>
+              <span class="entry_type_visibility"> [ndk_public as streamConfiguration]</span>
+
+
+              <span class="entry_type_hwlevel">[limited] </span>
+
+
+
+                <ul class="entry_type_enum">
+                  <li>
+                    <span class="entry_type_enum_name">OUTPUT (v3.4)</span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">INPUT (v3.4)</span>
+                  </li>
+                </ul>
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>The available HEIC (ISO/<wbr/>IEC 23008-12) stream
+configurations that this camera device supports
+(i.<wbr/>e.<wbr/> format,<wbr/> width,<wbr/> height,<wbr/> output/<wbr/>input stream).<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_HEIC">HEIC</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>The configurations are listed as <code>(format,<wbr/> width,<wbr/> height,<wbr/> input?)</code> tuples.<wbr/></p>
+<p>If the camera device supports HEIC image format,<wbr/> it will support identical set of stream
+combinations involving HEIC image format,<wbr/> compared to the combinations involving JPEG
+image format as required by the device's hardware level and capabilities.<wbr/></p>
+<p>All the static,<wbr/> control,<wbr/> and dynamic metadata tags related to JPEG apply to HEIC formats.<wbr/>
+Configuring JPEG and HEIC streams at the same time is not supported.<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>These are output stream configurations for use with dataSpace HAL_<wbr/>DATASPACE_<wbr/>HEIF.<wbr/></p>
+<p>Do not set this property directly.<wbr/> It is populated by camera framework and must not be
+set by the HAL layer.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
+                
+          <tr class="entry" id="static_android.heic.availableHeicMinFrameDurations">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>heic.<wbr/>available<wbr/>Heic<wbr/>Min<wbr/>Frame<wbr/>Durations
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name">int64</span>
+                <span class="entry_type_container">x</span>
+
+                <span class="entry_type_array">
+                  4 x n
+                </span>
+              <span class="entry_type_visibility"> [ndk_public as streamConfigurationDuration]</span>
+
+
+              <span class="entry_type_hwlevel">[limited] </span>
+
+
+
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>This lists the minimum frame duration for each
+format/<wbr/>size combination for HEIC output formats.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+              (format,<wbr/> width,<wbr/> height,<wbr/> ns) x n
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_HEIC">HEIC</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>This should correspond to the frame duration when only that
+stream is active,<wbr/> with all processing (typically in android.<wbr/>*.<wbr/>mode)
+set to either OFF or FAST.<wbr/></p>
+<p>When multiple streams are used in a request,<wbr/> the minimum frame
+duration will be max(individual stream min durations).<wbr/></p>
+<p>See <a href="#controls_android.sensor.frameDuration">android.<wbr/>sensor.<wbr/>frame<wbr/>Duration</a> and
+<a href="#static_android.scaler.availableStallDurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stall<wbr/>Durations</a> for more details about
+calculating the max frame rate.<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>Do not set this property directly.<wbr/> It is populated by camera framework and must not be
+set by the HAL layer.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
+                
+          <tr class="entry" id="static_android.heic.availableHeicStallDurations">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>heic.<wbr/>available<wbr/>Heic<wbr/>Stall<wbr/>Durations
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name">int64</span>
+                <span class="entry_type_container">x</span>
+
+                <span class="entry_type_array">
+                  4 x n
+                </span>
+              <span class="entry_type_visibility"> [ndk_public as streamConfigurationDuration]</span>
+
+
+              <span class="entry_type_hwlevel">[limited] </span>
+
+
+
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>This lists the maximum stall duration for each
+output format/<wbr/>size combination for HEIC streams.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+              (format,<wbr/> width,<wbr/> height,<wbr/> ns) x n
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_HEIC">HEIC</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>A stall duration is how much extra time would get added
+to the normal minimum frame duration for a repeating request
+that has streams with non-zero stall.<wbr/></p>
+<p>This functions similarly to
+<a href="#static_android.scaler.availableStallDurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stall<wbr/>Durations</a> for HEIC
+streams.<wbr/></p>
+<p>All HEIC output stream formats may have a nonzero stall
+duration.<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>Do not set this property directly.<wbr/> It is populated by camera framework and must not be
+set by the HAL layer.<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>
 
@@ -31802,6 +32360,17 @@ own requirements.<wbr/></p>
           <li><a href="#dynamic_android.logicalMultiCamera.activePhysicalId">android.logicalMultiCamera.activePhysicalId</a> (dynamic)</li>
         </ul>
       </li> <!-- tag_LOGICALCAMERA -->
+      <li id="tag_HEIC">HEIC - 
+        Entry is required for devices with HEIC (High Efficiency Image Format) support.
+    
+        <ul class="tags_entries">
+          <li><a href="#static_android.heic.info.supported">android.heic.info.supported</a> (static)</li>
+          <li><a href="#static_android.heic.info.maxJpegAppSegmentsCount">android.heic.info.maxJpegAppSegmentsCount</a> (static)</li>
+          <li><a href="#static_android.heic.availableHeicStreamConfigurations">android.heic.availableHeicStreamConfigurations</a> (static)</li>
+          <li><a href="#static_android.heic.availableHeicMinFrameDurations">android.heic.availableHeicMinFrameDurations</a> (static)</li>
+          <li><a href="#static_android.heic.availableHeicStallDurations">android.heic.availableHeicStallDurations</a> (static)</li>
+        </ul>
+      </li> <!-- tag_HEIC -->
       <li id="tag_FUTURE">FUTURE - 
         Entry is  under-specified and is not required for now. This is for book-keeping purpose,
         do not implement or use it, it may be revised for future.
index 8c71b73..d08efea 100644 (file)
@@ -42,6 +42,9 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
     <tag id="LOGICALCAMERA">
         Entry is required for logical multi-camera capability.
     </tag>
+    <tag id="HEIC">
+        Entry is required for devices with HEIC (High Efficiency Image Format) support.
+    </tag>
     <tag id="FUTURE">
         Entry is  under-specified and is not required for now. This is for book-keeping purpose,
         do not implement or use it, it may be revised for future.
@@ -3366,6 +3369,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           Setting a location object in a request will include the GPS coordinates of the location
           into any JPEG images captured based on the request. These coordinates can then be
           viewed by anyone who receives the JPEG image.
+
+          This tag is also used for HEIC image capture.
           </details>
         </entry>
         <entry name="gpsCoordinates" type="double" visibility="ndk_public"
@@ -3377,6 +3382,7 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           <description>GPS coordinates to include in output JPEG
           EXIF.</description>
           <range>(-180 - 180], [-90,90], [-inf, inf]</range>
+          <details>This tag is also used for HEIC image capture.</details>
           <tag id="BC" />
         </entry>
         <entry name="gpsProcessingMethod" type="byte" visibility="ndk_public"
@@ -3384,12 +3390,14 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           <description>32 characters describing GPS algorithm to
           include in EXIF.</description>
           <units>UTF-8 null-terminated string</units>
+          <details>This tag is also used for HEIC image capture.</details>
           <tag id="BC" />
         </entry>
         <entry name="gpsTimestamp" type="int64" visibility="ndk_public" hwlevel="legacy">
           <description>Time GPS fix was made to include in
           EXIF.</description>
           <units>UTC in seconds since January 1, 1970</units>
+          <details>This tag is also used for HEIC image capture.</details>
           <tag id="BC" />
         </entry>
         <entry name="orientation" type="int32" visibility="public" hwlevel="legacy">
@@ -3431,6 +3439,11 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
 
           For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
           also be set to EXTERNAL. The above code is not relevant in such case.
+
+          This tag is also used to describe the orientation of the HEIC image capture, in which
+          case the rotation is reflected by
+          {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
+          rotating the image data itself.
           </details>
           <tag id="BC" />
         </entry>
@@ -3438,13 +3451,15 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           <description>Compression quality of the final JPEG
           image.</description>
           <range>1-100; larger is higher quality</range>
-          <details>85-95 is typical usage range.</details>
+          <details>85-95 is typical usage range. This tag is also used to describe the quality
+          of the HEIC image capture.</details>
           <tag id="BC" />
         </entry>
         <entry name="thumbnailQuality" type="byte" visibility="public" hwlevel="legacy">
           <description>Compression quality of JPEG
           thumbnail.</description>
           <range>1-100; larger is higher quality</range>
+          <details>This tag is also used to describe the quality of the HEIC image capture.</details>
           <tag id="BC" />
         </entry>
         <entry name="thumbnailSize" type="int32" visibility="public"
@@ -3478,6 +3493,11 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
             capture result, so the width and height will be interchanged if 90 or 270 degree
             orientation is requested. LEGACY device will always report unrotated thumbnail
             size.
+
+          The tag is also used as thumbnail size for HEIC image format capture, in which case the
+          the thumbnail rotation is reflected by
+          {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
+          rotating the thumbnail data itself.
           </details>
           <hal_details>
           The HAL must not squeeze or stretch the downscaled primary image to generate thumbnail.
@@ -3512,7 +3532,10 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           * Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
           one corresponding size that has the same aspect ratio in availableThumbnailSizes,
           and vice versa.
-          * All non-`(0, 0)` sizes will have non-zero widths and heights.</details>
+          * All non-`(0, 0)` sizes will have non-zero widths and heights.
+
+          This list is also used as supported thumbnail sizes for HEIC image format capture.
+          </details>
           <tag id="BC" />
         </entry>
         <entry name="maxSize" type="int32" visibility="system">
@@ -10563,5 +10586,203 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
         </clone>
       </dynamic>
     </section>
+    <section name="heic">
+      <static>
+        <namespace name="info">
+          <entry name="supported" type="byte" visibility="system" enum="true"
+                 typedef="boolean" hwlevel="limited" hal_version="3.4">
+            <enum>
+              <value>FALSE</value>
+              <value>TRUE</value>
+            </enum>
+            <description>Whether this camera device can support identical set of stream combinations
+            involving HEIC image format, compared to the
+            {@link android.hardware.camera2.CameraDevice#createCaptureSession table of combinations}
+            involving JPEG image format required for the device's hardware level and capabilities.
+            </description>
+            <details>
+            All the static, control and dynamic metadata tags related to JPEG apply to HEIC formats
+            as well. For example, the same android.jpeg.orientation and android.jpeg.quality are
+            used to control the orientation and quality of the HEIC image. Configuring JPEG and
+            HEIC streams at the same time is not supported.
+
+            If a camera device supports HEIC format (ISO/IEC 23008-12), not only does it
+            support the existing mandatory stream
+            {@link android.hardware.camera2.CameraDevice#createCaptureSession combinations}
+            required for the device's hardware level and capabilities, it also supports swapping
+            each JPEG stream with HEIC stream in all guaranteed combinations.
+
+            For every HEIC stream configured by the application, the camera framework sets up 2
+            internal streams with camera HAL:
+
+            * A YUV_420_888 or IMPLEMENTATION_DEFINED HAL stream as input to HEIC or HEVC encoder.
+            * A BLOB stream with JPEG_APPS_SEGMENTS dataspace to extract application markers
+            including EXIF and thumbnail to be saved in HEIF container.
+
+            A camera device can output HEIC format to the application if and only if:
+
+            * The system contains a HEIC or HEVC encoder with constant quality mode, and
+            * This tag is set to TRUE, meaning that camera HAL supports replacing JPEG streams in
+            all mandatory stream combinations with a [YUV_420_888/IMPLEMENTATION_DEFINED stream +
+            JPEG_APPS_SEGMENT BLOB stream] combo.
+
+            As an example, if the camera device's hardware level is LIMITED, and it supports HEIC,
+            in addition to the required stream combinations, HAL must support below stream
+            combinations as well:
+
+            * IMPLEMENTATION_DEFINED/YUV_420_888 MAXIMUM + JPEG_SEGMENTS_BLOB,
+            * PRIV PREVIEW + IMPLEMENTATION_DEFINED/YUV_420_888 MAXIMUM + JPEG_SEGMENTS_BLOB,
+            * YUV PREVIEW + IMPLEMENTATION_DEFINED/YUV_420_888 MAXIMUM + JPEG_SEGMENTS_BLOB,
+            * PRIV PREVIEW + YUV PREVIEW + IMPLEMENTATION_DEFINED/YUV_420_888 MAXIMUM +
+            JPEG_SEGMENTS_BLOB
+
+            The selection logic between YUV_420_888 and IMPLEMENTATION_DEFINED for HAL internal
+            stream is as follows:
+
+                if (HEIC encoder exists and supports the size) {
+                    use IMPLEMENTATION_DEFINED with GRALLOC_USAGE_HW_IMAGE_ENCODER usage flag;
+                } else {
+                    // HVC encoder exists
+                    if (size is less than framework predefined tile size) {
+                        use IMPLEMENTATINO_DEFINED with GRALLOC_USAGE_HW_VIDEO_ENCODER usage flag;
+                    } else {
+                        use YUV_420_888;
+                    }
+                }
+          </details>
+          <tag id="HEIC" />
+          </entry>
+          <entry name="maxJpegAppSegmentsCount" type="byte" visibility="system"
+                 hwlevel="limited" hal_version="3.4">
+            <description>The maximum number of Jpeg APP segments supported by the camera HAL device.
+            </description>
+            <details>
+            The camera framework will use this value to derive the size of the BLOB buffer with
+            JPEG_APP_SEGMENTS dataspace, with each APP segment occupying at most 64K bytes. If the
+            value of this tag is n, the size of the framework allocated buffer will be:
+
+                n * (2 + 0xFFFF) + sizeof(struct CameraBlob)
+
+            where 2 is number of bytes for APP marker, 0xFFFF is the maximum size per APP segment
+            (including segment size).
+
+            The value of this tag must be at least 1, and APP1 marker (0xFFE1) segment must be the
+            first segment stored in the JPEG_APPS_SEGMENTS BLOB buffer. APP1 segment stores EXIF and
+            thumbnail.
+
+            Since media encoder embeds the orientation in the metadata of the output image, to be
+            consistent between main image and thumbnail, camera HAL must not rotate the thumbnail
+            image data based on android.jpeg.orientation. The framework will write the orientation
+            into EXIF and HEIC container.
+
+            APP1 segment is followed immediately by one or multiple APP2 segments, and APPn
+            segments. After the HAL fills and returns the JPEG_APP_SEGMENTS buffer, the camera
+            framework modifies the APP1 segment by filling in the EXIF tags that are related to
+            main image bitstream and the tags that can be derived from capture result metadata,
+            before saving them into the HEIC container.
+
+            The value of this tag must not be more than 16.
+            </details>
+            <tag id="HEIC" />
+          </entry>
+        </namespace>
+
+        <entry name="availableHeicStreamConfigurations" type="int32" visibility="ndk_public"
+            enum="true" container="array" typedef="streamConfiguration"
+            hwlevel="limited" hal_version="3.4">
+          <array>
+            <size>n</size>
+            <size>4</size>
+          </array>
+          <enum>
+            <value>OUTPUT</value>
+            <value>INPUT</value>
+          </enum>
+          <description>The available HEIC (ISO/IEC 23008-12) stream
+          configurations that this camera device supports
+          (i.e. format, width, height, output/input stream).
+          </description>
+          <details>
+          The configurations are listed as `(format, width, height, input?)` tuples.
+
+          If the camera device supports HEIC image format, it will support identical set of stream
+          combinations involving HEIC image format, compared to the combinations involving JPEG
+          image format as required by the device's hardware level and capabilities.
+
+          All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
+          Configuring JPEG and HEIC streams at the same time is not supported.
+          </details>
+          <ndk_details>
+          All the configuration tuples `(format, width, height, input?)` will contain
+          AIMAGE_FORMAT_HEIC format as OUTPUT only.
+          </ndk_details>
+          <hal_details>
+          These are output stream configurations for use with dataSpace HAL_DATASPACE_HEIF.
+
+          Do not set this property directly. It is populated by camera framework and must not be
+          set by the HAL layer.
+          </hal_details>
+         <tag id="HEIC" />
+        </entry>
+        <entry name="availableHeicMinFrameDurations" type="int64" visibility="ndk_public"
+               container="array" typedef="streamConfigurationDuration" hwlevel="limited"
+               hal_version="3.4">
+          <array>
+            <size>4</size>
+            <size>n</size>
+          </array>
+          <description>This lists the minimum frame duration for each
+          format/size combination for HEIC output formats.
+          </description>
+          <units>(format, width, height, ns) x n</units>
+          <details>
+          This should correspond to the frame duration when only that
+          stream is active, with all processing (typically in android.*.mode)
+          set to either OFF or FAST.
+
+          When multiple streams are used in a request, the minimum frame
+          duration will be max(individual stream min durations).
+
+          See android.sensor.frameDuration and
+          android.scaler.availableStallDurations for more details about
+          calculating the max frame rate.
+          </details>
+          <hal_details>
+          Do not set this property directly. It is populated by camera framework and must not be
+          set by the HAL layer.
+          </hal_details>
+          <tag id="HEIC" />
+        </entry>
+        <entry name="availableHeicStallDurations" type="int64" visibility="ndk_public"
+               container="array" typedef="streamConfigurationDuration" hwlevel="limited"
+               hal_version="3.4">
+          <array>
+            <size>4</size>
+            <size>n</size>
+          </array>
+          <description>This lists the maximum stall duration for each
+          output format/size combination for HEIC streams.
+          </description>
+          <units>(format, width, height, ns) x n</units>
+          <details>
+          A stall duration is how much extra time would get added
+          to the normal minimum frame duration for a repeating request
+          that has streams with non-zero stall.
+
+          This functions similarly to
+          android.scaler.availableStallDurations for HEIC
+          streams.
+
+          All HEIC output stream formats may have a nonzero stall
+          duration.
+          </details>
+          <hal_details>
+          Do not set this property directly. It is populated by camera framework and must not be
+          set by the HAL layer.
+          </hal_details>
+          <tag id="HEIC" />
+        </entry>
+      </static>
+    </section>
   </namespace>
 </metadata>
index 134f5e2..3ba2348 100644 (file)
@@ -63,6 +63,8 @@ typedef enum camera_metadata_section {
     ANDROID_DEPTH,
     ANDROID_LOGICAL_MULTI_CAMERA,
     ANDROID_DISTORTION_CORRECTION,
+    ANDROID_HEIC,
+    ANDROID_HEIC_INFO,
     ANDROID_SECTION_COUNT,
 
     VENDOR_SECTION = 0x8000
@@ -105,6 +107,8 @@ typedef enum camera_metadata_section_start {
     ANDROID_DISTORTION_CORRECTION_START
                                    = ANDROID_DISTORTION_CORRECTION
                                                                 << 16,
+    ANDROID_HEIC_START             = ANDROID_HEIC              << 16,
+    ANDROID_HEIC_INFO_START        = ANDROID_HEIC_INFO         << 16,
     VENDOR_SECTION_START           = VENDOR_SECTION            << 16
 } camera_metadata_section_start_t;
 
@@ -460,6 +464,18 @@ typedef enum camera_metadata_tag {
     ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES,    // byte[]       | public       | HIDL v3.3
     ANDROID_DISTORTION_CORRECTION_END,
 
+    ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = 
+                                                      // enum[]       | ndk_public   | HIDL v3.4
+            ANDROID_HEIC_START,
+    ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS,  // int64[]      | ndk_public   | HIDL v3.4
+    ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS,      // int64[]      | ndk_public   | HIDL v3.4
+    ANDROID_HEIC_END,
+
+    ANDROID_HEIC_INFO_SUPPORTED =                     // enum         | system       | HIDL v3.4
+            ANDROID_HEIC_INFO_START,
+    ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT,    // byte         | system       | HIDL v3.4
+    ANDROID_HEIC_INFO_END,
+
 } camera_metadata_tag_t;
 
 /**
@@ -1056,3 +1072,17 @@ typedef enum camera_metadata_enum_android_distortion_correction_mode {
 } camera_metadata_enum_android_distortion_correction_mode_t;
 
 
+// ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS
+typedef enum camera_metadata_enum_android_heic_available_heic_stream_configurations {
+    ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT        , // HIDL v3.4
+    ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT         , // HIDL v3.4
+} camera_metadata_enum_android_heic_available_heic_stream_configurations_t;
+
+
+// ANDROID_HEIC_INFO_SUPPORTED
+typedef enum camera_metadata_enum_android_heic_info_supported {
+    ANDROID_HEIC_INFO_SUPPORTED_FALSE                               , // HIDL v3.4
+    ANDROID_HEIC_INFO_SUPPORTED_TRUE                                , // HIDL v3.4
+} camera_metadata_enum_android_heic_info_supported_t;
+
+
index f5cf70f..53f0b1a 100644 (file)
@@ -60,6 +60,8 @@ const char *camera_metadata_section_names[ANDROID_SECTION_COUNT] = {
     [ANDROID_LOGICAL_MULTI_CAMERA] = "android.logicalMultiCamera",
     [ANDROID_DISTORTION_CORRECTION]
                                     = "android.distortionCorrection",
+    [ANDROID_HEIC]                 = "android.heic",
+    [ANDROID_HEIC_INFO]            = "android.heic.info",
 };
 
 unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
@@ -120,6 +122,10 @@ unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
     [ANDROID_DISTORTION_CORRECTION]
                                     = { ANDROID_DISTORTION_CORRECTION_START,
                                        ANDROID_DISTORTION_CORRECTION_END },
+    [ANDROID_HEIC]                 = { ANDROID_HEIC_START,
+                                       ANDROID_HEIC_END },
+    [ANDROID_HEIC_INFO]            = { ANDROID_HEIC_INFO_START,
+                                       ANDROID_HEIC_INFO_END },
 };
 
 static tag_info_t android_color_correction[ANDROID_COLOR_CORRECTION_END -
@@ -748,6 +754,26 @@ static tag_info_t android_distortion_correction[ANDROID_DISTORTION_CORRECTION_EN
     { "availableModes",                TYPE_BYTE   },
 };
 
+static tag_info_t android_heic[ANDROID_HEIC_END -
+        ANDROID_HEIC_START] = {
+    [ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS - ANDROID_HEIC_START ] =
+    { "availableHeicStreamConfigurations",
+                                        TYPE_INT32  },
+    [ ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS - ANDROID_HEIC_START ] =
+    { "availableHeicMinFrameDurations",
+                                        TYPE_INT64  },
+    [ ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS - ANDROID_HEIC_START ] =
+    { "availableHeicStallDurations",   TYPE_INT64  },
+};
+
+static tag_info_t android_heic_info[ANDROID_HEIC_INFO_END -
+        ANDROID_HEIC_INFO_START] = {
+    [ ANDROID_HEIC_INFO_SUPPORTED - ANDROID_HEIC_INFO_START ] =
+    { "supported",                     TYPE_BYTE   },
+    [ ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT - ANDROID_HEIC_INFO_START ] =
+    { "maxJpegAppSegmentsCount",       TYPE_BYTE   },
+};
+
 
 tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
     android_color_correction,
@@ -778,6 +804,8 @@ tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
     android_depth,
     android_logical_multi_camera,
     android_distortion_correction,
+    android_heic,
+    android_heic_info,
 };
 
 static int32_t tag_permission_needed[16] = {
@@ -2951,6 +2979,47 @@ int camera_metadata_enum_snprint(uint32_t tag,
             break;
         }
 
+        case ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS: {
+            switch (value) {
+                case ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT:
+                    msg = "OUTPUT";
+                    ret = 0;
+                    break;
+                case ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT:
+                    msg = "INPUT";
+                    ret = 0;
+                    break;
+                default:
+                    msg = "error: enum value out of range";
+            }
+            break;
+        }
+        case ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS: {
+            break;
+        }
+        case ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS: {
+            break;
+        }
+
+        case ANDROID_HEIC_INFO_SUPPORTED: {
+            switch (value) {
+                case ANDROID_HEIC_INFO_SUPPORTED_FALSE:
+                    msg = "FALSE";
+                    ret = 0;
+                    break;
+                case ANDROID_HEIC_INFO_SUPPORTED_TRUE:
+                    msg = "TRUE";
+                    ret = 0;
+                    break;
+                default:
+                    msg = "error: enum value out of range";
+            }
+            break;
+        }
+        case ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT: {
+            break;
+        }
+
     }
 
     strncpy(dst, msg, size - 1);