OSDN Git Service

Camera: update NDK docs
authorYin-Chia Yeh <yinchiayeh@google.com>
Fri, 4 Aug 2017 01:07:45 +0000 (18:07 -0700)
committerYin-Chia Yeh <yinchiayeh@google.com>
Fri, 4 Aug 2017 02:02:38 +0000 (19:02 -0700)
Add type information to the doc paragraph.

Bug: 64304111
Test: build (doc only change)
Change-Id: Ifc3b8068d308ad2571ad66ddf5850b1cdc4163d6

camera/docs/metadata_helpers.py
camera/docs/ndk_camera_metadata_tags.mako

index a501524..22d636f 100644 (file)
@@ -904,6 +904,7 @@ def ndkdoc(metadata, indent = 4):
   """
   def ndkdoc_formatter(text):
     # render with markdown => HTML
+    # Turn off the table plugin since doxygen doesn't recognize generated <thead> <tbody> tags
     ndktext = md(text, NDKDOC_IMAGE_SRC_METADATA, False)
 
     # Convert metadata entry "android.x.y.z" to form
index 8232e50..f2ba1b0 100644 (file)
 
 #ifndef _NDK_CAMERA_METADATA_TAGS_H
 #define _NDK_CAMERA_METADATA_TAGS_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
 <%!
+  from metadata_helpers import csym
   def annotated_type(entry):
     type = entry.type
     if entry.container == 'array':
        type += '[' + '*'.join(entry.container_sizes) + ']'
     if entry.enum:
-       type += ' (enum)'
+       type += ' (acamera_metadata_enum_%s_t)'%(csym(entry.name).lower())
 
     return type
 %>\
@@ -85,9 +92,13 @@ typedef enum acamera_metadata_tag {
           % else:
             % if entry.description or entry.details:
     /**
+              % if entry.description:
 ${entry.description | ndkdoc(metadata)}\
+              % endif
      *
-     * <p>This tag may appear in:</p>
+     * <p>Type: ${annotated_type(entry)}</p>
+     *
+     * <p>This tag may appear in:
      * <ul>
               % if metadata.is_entry_this_kind(entry, 'static'):
      *   <li>ACameraMetadata from ACameraManager_getCameraCharacteristics</li>
@@ -98,9 +109,11 @@ ${entry.description | ndkdoc(metadata)}\
               % if metadata.is_entry_this_kind(entry, 'controls'):
      *   <li>ACaptureRequest</li>
               % endif
-     * </ul>
+     * </ul></p>
      *
+              % if entry.details:
 ${entry.details | ndkdoc(metadata)}\
+              % endif
      */
             % endif
     ${ndk(entry.name) + " = " | csym,ljust(60)}// ${annotated_type(entry)}
@@ -179,7 +192,10 @@ ${val.notes | ndkdoc(metadata)}\
   % endfor
 
 % endfor
+#endif /* __ANDROID_API__ >= 24 */
+
+__END_DECLS
 
-#endif //_NDK_CAMERA_METADATA_TAGS_H
+#endif /* _NDK_CAMERA_METADATA_TAGS_H */
 
 /** @} */