OSDN Git Service

Camera: add NDK metadata tag document
authorYin-Chia Yeh <yinchiayeh@google.com>
Wed, 6 Apr 2016 22:59:39 +0000 (15:59 -0700)
committerYin-Chia Yeh <yinchiayeh@google.com>
Wed, 13 Apr 2016 21:31:55 +0000 (14:31 -0700)
Bug: 27102995
Change-Id: Ieffc5825259614ffd5b46af013a043300d5214b1

camera/docs/metadata_model.py
camera/docs/ndk_camera_metadata_tags.mako

index 84edeb7..e059e33 100644 (file)
@@ -351,6 +351,21 @@ class Metadata(Node):
       self._entry_map[p.kind].pop(p.name)
       self._entries_ordered.remove(p)
 
+  def is_entry_this_kind(self, entry, kind):
+    """
+    Check if input entry if of input kind
+
+    Args:
+      entry: an Entry object
+      kind: a string. Possible values are "static", "dynamic", "controls"
+
+    Returns:
+      A boolean indicating whether input entry is of input kind.
+    """
+    if kind not in ("static", "dynamic", "controls"):
+      assert(False), "Unknown kind value " + kind
+
+    return entry.name in self._entry_map[kind]
 
   # After all entries/clones are inserted,
   # invoke this to generate the parent/child node graph all these objects
index f60f0cb..83f9cb5 100644 (file)
@@ -74,6 +74,26 @@ typedef enum acamera_metadata_tag {
           % if entry.deprecated:
     ${ndk(entry.name) + " = " | csym,ljust(60)}// Deprecated! DO NOT USE
           % else:
+            % if entry.description or entry.details:
+    /**
+${entry.description | ndkdoc(metadata)}\
+     *
+     * <p>This tag may appear in:</p>
+     * <ul>
+              % if metadata.is_entry_this_kind(entry, 'static'):
+     *   <li>ACameraMetadata from ACameraManager_getCameraCharacteristics</li>
+              % endif
+              % if metadata.is_entry_this_kind(entry, 'dynamic'):
+     *   <li>ACameraMetadata from ACameraCaptureSession_captureCallback_result callbacks</li>
+              % endif
+              % if metadata.is_entry_this_kind(entry, 'controls'):
+     *   <li>ACaptureRequest</li>
+              % endif
+     * </ul>
+     *
+${entry.details | ndkdoc(metadata)}\
+     */
+            % endif
     ${ndk(entry.name) + " = " | csym,ljust(60)}// ${annotated_type(entry)}
           % endif
           % if idx == 0:
@@ -122,7 +142,7 @@ typedef enum acamera_metadata_enum_${csym(ndk(entry.name)).lower()} {
           % endif
         % endif
         % if (val.notes or val.deprecated):
-    /*
+    /**
           % if val.notes:
 ${val.notes | ndkdoc(metadata)}\
           % endif