OSDN Git Service

Camera: Add MONOCHROME camera capability
authorShuzhen Wang <shuzhenwang@google.com>
Wed, 21 Mar 2018 02:04:06 +0000 (19:04 -0700)
committerShuzhen Wang <shuzhenwang@google.com>
Wed, 28 Mar 2018 18:32:15 +0000 (11:32 -0700)
Add MONOCHROME camera capability which outputs greyscale instead of
color image.

Test: run metadata-generate
Bug: 74597035
Bug: 64691172
Change-Id: If15a444500983e448fde7d03f2a96b0c59b045db

camera/docs/docs.html
camera/docs/metadata_definitions.xml
camera/include/system/camera_metadata_tags.h
camera/src/camera_metadata_tag_info.c

index 81469ae..5c5d655 100644 (file)
@@ -17123,6 +17123,12 @@ mandatory stream combinations required for their device levels.<wbr/></p>
 not slow down the frame rate of the capture,<wbr/> as long as the minimum frame duration
 of the physical and logical streams are the same.<wbr/></p></span>
                   </li>
+                  <li>
+                    <span class="entry_type_enum_name">MONOCHROME (v3.3)</span>
+                    <span class="entry_type_enum_optional">[optional]</span>
+                    <span class="entry_type_enum_notes"><p>The camera device is a monochrome camera that doesn't contain a color filter array,<wbr/>
+and the pixel values on U and Y planes are all 128.<wbr/></p></span>
+                  </li>
                 </ul>
 
             </td> <!-- entry_type -->
@@ -17210,6 +17216,28 @@ DEPTH).<wbr/></p>
 <p>For a camera device with LOGICAL_<wbr/>MULTI_<wbr/>CAMERA capability,<wbr/> it should operate in the
 same way as a physical camera device based on its hardware level and capabilities.<wbr/>
 It's recommended that its feature set is superset of that of individual physical cameras.<wbr/></p>
+<p>For MONOCHROME,<wbr/> the camera device must also advertise BACKWARD_<wbr/>COMPATIBLE capability,<wbr/> and
+it is exclusive of both RAW and MANUAL_<wbr/>POST_<wbr/>PROCESSING capabilities:</p>
+<ul>
+<li>
+<p>To maintain backward compatibility,<wbr/> the camera device must support all
+BACKWARD_<wbr/>COMPATIBLE required keys.<wbr/> The <a href="#static_android.control.awbAvailableModes">android.<wbr/>control.<wbr/>awb<wbr/>Available<wbr/>Modes</a> key only contains
+AUTO,<wbr/> and <a href="#dynamic_android.control.awbState">android.<wbr/>control.<wbr/>awb<wbr/>State</a> are either CONVERGED or LOCKED depending on
+<a href="#controls_android.control.awbLock">android.<wbr/>control.<wbr/>awb<wbr/>Lock</a>.<wbr/></p>
+</li>
+<li>
+<p>A monochrome device doesn't need to advertise DNG related optional metadata tags.<wbr/></p>
+</li>
+<li>
+<p><a href="#controls_android.colorCorrection.mode">android.<wbr/>color<wbr/>Correction.<wbr/>mode</a>,<wbr/> <a href="#controls_android.colorCorrection.transform">android.<wbr/>color<wbr/>Correction.<wbr/>transform</a>,<wbr/> and
+<a href="#controls_android.colorCorrection.gains">android.<wbr/>color<wbr/>Correction.<wbr/>gains</a> are not applicable.<wbr/> So the camera device cannot
+be a FULL device.<wbr/> However,<wbr/> the HAL can still advertise other individual capabilites.<wbr/></p>
+</li>
+<li>
+<p>If the device supports tonemap control,<wbr/> only <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> is used.<wbr/>
+CurveGreen and curveBlue are no-ops.<wbr/></p>
+</li>
+</ul>
             </td>
           </tr>
 
@@ -26664,6 +26692,8 @@ points.<wbr/></p>
 of points can be less than max (that is,<wbr/> the request doesn't have to
 always provide a curve with number of points equivalent to
 <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>For devices with MONOCHROME capability,<wbr/> only red channel is used.<wbr/> Green and blue channels
+are ignored.<wbr/></p>
 <p>A few examples,<wbr/> and their corresponding graphical mappings; these
 only specify the red channel and the precision is limited to 4
 digits,<wbr/> for conciseness.<wbr/></p>
@@ -26769,6 +26799,8 @@ points.<wbr/></p>
 of points can be less than max (that is,<wbr/> the request doesn't have to
 always provide a curve with number of points equivalent to
 <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>For devices with MONOCHROME capability,<wbr/> only red channel is used.<wbr/> Green and blue channels
+are ignored.<wbr/></p>
 <p>A few examples,<wbr/> and their corresponding graphical mappings; these
 only specify the red channel and the precision is limited to 4
 digits,<wbr/> for conciseness.<wbr/></p>
@@ -27416,6 +27448,8 @@ points.<wbr/></p>
 of points can be less than max (that is,<wbr/> the request doesn't have to
 always provide a curve with number of points equivalent to
 <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>For devices with MONOCHROME capability,<wbr/> only red channel is used.<wbr/> Green and blue channels
+are ignored.<wbr/></p>
 <p>A few examples,<wbr/> and their corresponding graphical mappings; these
 only specify the red channel and the precision is limited to 4
 digits,<wbr/> for conciseness.<wbr/></p>
@@ -27521,6 +27555,8 @@ points.<wbr/></p>
 of points can be less than max (that is,<wbr/> the request doesn't have to
 always provide a curve with number of points equivalent to
 <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>For devices with MONOCHROME capability,<wbr/> only red channel is used.<wbr/> Green and blue channels
+are ignored.<wbr/></p>
 <p>A few examples,<wbr/> and their corresponding graphical mappings; these
 only specify the red channel and the precision is limited to 4
 digits,<wbr/> for conciseness.<wbr/></p>
index 48cb694..3f8023f 100644 (file)
@@ -5245,6 +5245,12 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
               of the physical and logical streams are the same.
               </notes>
             </value>
+            <value optional="true" hal_version="3.3" >MONOCHROME
+              <notes>
+              The camera device is a monochrome camera that doesn't contain a color filter array,
+              and the pixel values on U and Y planes are all 128.
+              </notes>
+            </value>
 
           </enum>
           <description>List of capabilities that this camera device
@@ -5315,6 +5321,23 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           For a camera device with LOGICAL_MULTI_CAMERA capability, it should operate in the
           same way as a physical camera device based on its hardware level and capabilities.
           It's recommended that its feature set is superset of that of individual physical cameras.
+
+          For MONOCHROME, the camera device must also advertise BACKWARD_COMPATIBLE capability, and
+          it is exclusive of both RAW and MANUAL_POST_PROCESSING capabilities:
+
+          * To maintain backward compatibility, the camera device must support all
+          BACKWARD_COMPATIBLE required keys. The android.control.awbAvailableModes key only contains
+          AUTO, and android.control.awbState are either CONVERGED or LOCKED depending on
+          android.control.awbLock.
+
+          * A monochrome device doesn't need to advertise DNG related optional metadata tags.
+
+          * android.colorCorrection.mode, android.colorCorrection.transform, and
+          android.colorCorrection.gains are not applicable. So the camera device cannot
+          be a FULL device. However, the HAL can still advertise other individual capabilites.
+
+          * If the device supports tonemap control, only android.tonemap.curveRed is used.
+          CurveGreen and curveBlue are no-ops.
           </hal_details>
         </entry>
         <entry name="availableRequestKeys" type="int32" visibility="ndk_public"
@@ -8578,6 +8601,9 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           always provide a curve with number of points equivalent to
           android.tonemap.maxCurvePoints).
 
+          For devices with MONOCHROME capability, only red channel is used. Green and blue channels
+          are ignored.
+
           A few examples, and their corresponding graphical mappings; these
           only specify the red channel and the precision is limited to 4
           digits, for conciseness.
@@ -8648,6 +8674,9 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
           always provide a curve with number of points equivalent to
           android.tonemap.maxCurvePoints).
 
+          For devices with MONOCHROME capability, only red channel is used. Green and blue channels
+          are ignored.
+
           A few examples, and their corresponding graphical mappings; these
           only specify the red channel and the precision is limited to 4
           digits, for conciseness.
index d8cd02e..adf18b8 100644 (file)
@@ -778,6 +778,7 @@ typedef enum camera_metadata_enum_android_request_available_capabilities {
                                                                      , // HIDL v3.2
     ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING          , // HIDL v3.3
     ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA     , // HIDL v3.3
+    ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME               , // HIDL v3.3
 } camera_metadata_enum_android_request_available_capabilities_t;
 
 
index 0d7b679..75ad1f4 100644 (file)
@@ -1926,6 +1926,10 @@ int camera_metadata_enum_snprint(uint32_t tag,
                     msg = "LOGICAL_MULTI_CAMERA";
                     ret = 0;
                     break;
+                case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME:
+                    msg = "MONOCHROME";
+                    ret = 0;
+                    break;
                 default:
                     msg = "error: enum value out of range";
             }