Migrate libcamera2ndk to ndk_library.
Test: make checkbuild tests
Bug: http://b/30465923
Change-Id: Iab800fd20beeef64250abc7d1c966d12fa8bfbb5
diff --git a/include/camera/ndk/NdkCameraCaptureSession.h b/include/camera/ndk/NdkCameraCaptureSession.h
index 7b314e9..d96f538 100644
--- a/include/camera/ndk/NdkCameraCaptureSession.h
+++ b/include/camera/ndk/NdkCameraCaptureSession.h
@@ -32,6 +32,8 @@
* Do not reference types that are not part of the NDK.
* Do not #include files that aren't part of the NDK.
*/
+#include <sys/cdefs.h>
+
#include <android/native_window.h>
#include "NdkCameraError.h"
#include "NdkCameraMetadata.h"
@@ -39,9 +41,9 @@
#ifndef _NDK_CAMERA_CAPTURE_SESSION_H
#define _NDK_CAMERA_CAPTURE_SESSION_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
/**
* ACameraCaptureSession is an opaque type that manages frame captures of a camera device.
@@ -587,11 +589,10 @@
*/
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session);
+#endif /* __ANDROID_API__ >= 24 */
-#ifdef __cplusplus
-} // extern "C"
-#endif
+__END_DECLS
-#endif // _NDK_CAMERA_CAPTURE_SESSION_H
+#endif /* _NDK_CAMERA_CAPTURE_SESSION_H */
/** @} */
diff --git a/include/camera/ndk/NdkCameraDevice.h b/include/camera/ndk/NdkCameraDevice.h
index 9011cb6..9b7f6f4 100644
--- a/include/camera/ndk/NdkCameraDevice.h
+++ b/include/camera/ndk/NdkCameraDevice.h
@@ -32,6 +32,7 @@
* Do not reference types that are not part of the NDK.
* Do not #include files that aren't part of the NDK.
*/
+#include <sys/cdefs.h>
#include <android/native_window.h>
#include "NdkCameraError.h"
@@ -41,9 +42,9 @@
#ifndef _NDK_CAMERA_DEVICE_H
#define _NDK_CAMERA_DEVICE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
/**
* ACameraDevice is opaque type that provides access to a camera device.
@@ -658,11 +659,11 @@
const ACameraCaptureSession_stateCallbacks* callbacks,
/*out*/ACameraCaptureSession** session);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#endif /* __ANDROID_API__ >= 24 */
-#endif // _NDK_CAMERA_DEVICE_H
+__END_DECLS
+
+#endif /* _NDK_CAMERA_DEVICE_H */
/** @} */
diff --git a/include/camera/ndk/NdkCameraError.h b/include/camera/ndk/NdkCameraError.h
index 36251fc..6b58155 100644
--- a/include/camera/ndk/NdkCameraError.h
+++ b/include/camera/ndk/NdkCameraError.h
@@ -36,9 +36,11 @@
#ifndef _NDK_CAMERA_ERROR_H
#define _NDK_CAMERA_ERROR_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
typedef enum {
ACAMERA_OK = 0,
@@ -130,11 +132,10 @@
ACAMERA_ERROR_PERMISSION_DENIED = ACAMERA_ERROR_BASE - 13,
} camera_status_t;
+#endif /* __ANDROID_API__ >= 24 */
-#ifdef __cplusplus
-} // extern "C"
-#endif
+__END_DECLS
-#endif // _NDK_CAMERA_ERROR_H
+#endif /* _NDK_CAMERA_ERROR_H */
/** @} */
diff --git a/include/camera/ndk/NdkCameraManager.h b/include/camera/ndk/NdkCameraManager.h
index 9188e94..5b5c98b 100644
--- a/include/camera/ndk/NdkCameraManager.h
+++ b/include/camera/ndk/NdkCameraManager.h
@@ -36,13 +36,15 @@
#ifndef _NDK_CAMERA_MANAGER_H
#define _NDK_CAMERA_MANAGER_H
+#include <sys/cdefs.h>
+
#include "NdkCameraError.h"
#include "NdkCameraMetadata.h"
#include "NdkCameraDevice.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
/**
* ACameraManager is opaque type that provides access to camera service.
@@ -271,10 +273,10 @@
ACameraDevice_StateCallbacks* callback,
/*out*/ACameraDevice** device);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#endif /* __ANDROID_API__ >= 24 */
-#endif //_NDK_CAMERA_MANAGER_H
+__END_DECLS
+
+#endif /* _NDK_CAMERA_MANAGER_H */
/** @} */
diff --git a/include/camera/ndk/NdkCameraMetadata.h b/include/camera/ndk/NdkCameraMetadata.h
index d929854..f2aec98 100644
--- a/include/camera/ndk/NdkCameraMetadata.h
+++ b/include/camera/ndk/NdkCameraMetadata.h
@@ -36,12 +36,14 @@
#ifndef _NDK_CAMERA_METADATA_H
#define _NDK_CAMERA_METADATA_H
+#include <sys/cdefs.h>
+
#include "NdkCameraError.h"
#include "NdkCameraMetadataTags.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
/**
* ACameraMetadata is opaque type that provides access to read-only camera metadata like camera
@@ -226,10 +228,10 @@
*/
void ACameraMetadata_free(ACameraMetadata* metadata);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#endif /* __ANDROID_API__ >= 24 */
-#endif //_NDK_CAMERA_METADATA_H
+__END_DECLS
+
+#endif /* _NDK_CAMERA_METADATA_H */
/** @} */
diff --git a/include/camera/ndk/NdkCameraMetadataTags.h b/include/camera/ndk/NdkCameraMetadataTags.h
index e7f6989..0fec983 100644
--- a/include/camera/ndk/NdkCameraMetadataTags.h
+++ b/include/camera/ndk/NdkCameraMetadataTags.h
@@ -36,6 +36,12 @@
#ifndef _NDK_CAMERA_METADATA_TAGS_H
#define _NDK_CAMERA_METADATA_TAGS_H
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
+
typedef enum acamera_metadata_section {
ACAMERA_COLOR_CORRECTION,
ACAMERA_CONTROL,
@@ -6901,8 +6907,10 @@
} acamera_metadata_enum_android_depth_depth_is_exclusive_t;
+#endif /* __ANDROID_API__ >= 24 */
+__END_DECLS
-#endif //_NDK_CAMERA_METADATA_TAGS_H
+#endif /* _NDK_CAMERA_METADATA_TAGS_H */
/** @} */
diff --git a/include/camera/ndk/NdkCaptureRequest.h b/include/camera/ndk/NdkCaptureRequest.h
index cd97f4d..c62ba2c 100644
--- a/include/camera/ndk/NdkCaptureRequest.h
+++ b/include/camera/ndk/NdkCaptureRequest.h
@@ -32,6 +32,9 @@
* Do not reference types that are not part of the NDK.
* Do not #include files that aren't part of the NDK.
*/
+
+#include <sys/cdefs.h>
+
#include <android/native_window.h>
#include "NdkCameraError.h"
#include "NdkCameraMetadata.h"
@@ -39,9 +42,9 @@
#ifndef _NDK_CAPTURE_REQUEST_H
#define _NDK_CAPTURE_REQUEST_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
+#if __ANDROID_API__ >= 24
// Container for output targets
typedef struct ACameraOutputTargets ACameraOutputTargets;
@@ -300,10 +303,10 @@
*/
void ACaptureRequest_free(ACaptureRequest* request);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#endif /* __ANDROID_API__ >= 24 */
-#endif // _NDK_CAPTURE_REQUEST_H
+__END_DECLS
+
+#endif /* _NDK_CAPTURE_REQUEST_H */
/** @} */