Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ae90b1c authored by Ryan Prichard's avatar Ryan Prichard
Browse files

Restore __ANDROID_API__ guards for camera/media headers

Partial revert of "Add __INTRODUCED_IN to audio/camera/media headers.",
commit 85a41536.

Restore the API guards where they used to exist. I *could* add
__ANDROID_API__ around only the function declarations, which is what the
versioner would do, but the function declarations are mixed up with the
types and constants, so I'd need to add a bunch of __ANDROID_API__ checks
or reorganize the headers.

NdkMediaFormat.h and AAudio.h still have __INTRODUCED_IN symbols that
aren't guarded by __ANDROID_API__. Maybe those files should be reorganized
so they don't alternate between APIs so much.

Test: builds
Bug: http://b/111668906
Change-Id: I757a6097f7840ea50e2fc92db7defef493097672
Exempt-From-Owner-Approval: cherrypick
(cherry picked from commit 0c9470ce)
parent 6f1e11ec
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
 * ACameraCaptureSession is an opaque type that manages frame captures of a camera device.
 *
@@ -591,6 +593,10 @@ camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession* sessi
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session)
        __INTRODUCED_IN(24);

#endif /* __ANDROID_API__ >= 24 */

#if __ANDROID_API__ >= 28

typedef struct ACaptureSessionOutput ACaptureSessionOutput;

/**
@@ -635,6 +641,7 @@ typedef struct ACaptureSessionOutput ACaptureSessionOutput;
 */
camera_status_t ACameraCaptureSession_updateSharedOutput(ACameraCaptureSession* session,
        ACaptureSessionOutput* output) __INTRODUCED_IN(28);
#endif /* __ANDROID_API__ >= 28 */

__END_DECLS

+8 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
 * ACameraDevice is opaque type that provides access to a camera device.
 *
@@ -666,6 +668,10 @@ camera_status_t ACameraDevice_createCaptureSession(
        const ACameraCaptureSession_stateCallbacks* callbacks,
        /*out*/ACameraCaptureSession** session) __INTRODUCED_IN(24);

#endif /* __ANDROID_API__ >= 24 */

#if __ANDROID_API__ >= 28

/**
 * Create a shared ACaptureSessionOutput object.
 *
@@ -757,6 +763,8 @@ camera_status_t ACameraDevice_createCaptureSessionWithSessionParameters(
        const ACameraCaptureSession_stateCallbacks* callbacks,
        /*out*/ACameraCaptureSession** session) __INTRODUCED_IN(28);

#endif /* __ANDROID_API__ >= 28 */

__END_DECLS

#endif /* _NDK_CAMERA_DEVICE_H */
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

typedef enum {
    ACAMERA_OK = 0,

@@ -130,6 +132,8 @@ typedef enum {
    ACAMERA_ERROR_PERMISSION_DENIED     = ACAMERA_ERROR_BASE - 13,
} camera_status_t;

#endif /* __ANDROID_API__ >= 24 */

__END_DECLS

#endif /* _NDK_CAMERA_ERROR_H */
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
 * ACameraManager is opaque type that provides access to camera service.
 *
@@ -274,6 +276,8 @@ camera_status_t ACameraManager_openCamera(
        ACameraDevice_StateCallbacks* callback,
        /*out*/ACameraDevice** device) __INTRODUCED_IN(24);

#endif /* __ANDROID_API__ >= 24 */

__END_DECLS

#endif /* _NDK_CAMERA_MANAGER_H */
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
 * ACameraMetadata is opaque type that provides access to read-only camera metadata like camera
 * characteristics (via {@link ACameraManager_getCameraCharacteristics}) or capture results (via
@@ -229,6 +231,8 @@ ACameraMetadata* ACameraMetadata_copy(const ACameraMetadata* src) __INTRODUCED_I
 */
void ACameraMetadata_free(ACameraMetadata* metadata) __INTRODUCED_IN(24);

#endif /* __ANDROID_API__ >= 24 */

__END_DECLS

#endif /* _NDK_CAMERA_METADATA_H */
Loading