Skip to content

Commit

Permalink
Add __INTRODUCED_IN to audio/camera/media headers.
Browse files Browse the repository at this point in the history
Bug: android/ndk#706
Test: builds
Change-Id: I519d4fd825d40c3f72515f29a7e5b12c23a1749a
  • Loading branch information
enh-google committed Jun 18, 2018
1 parent aa8b91a commit 85a4153
Show file tree
Hide file tree
Showing 18 changed files with 288 additions and 367 deletions.
21 changes: 8 additions & 13 deletions camera/ndk/include/camera/NdkCameraCaptureSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
* ACameraCaptureSession is an opaque type that manages frame captures of a camera device.
*
Expand Down Expand Up @@ -434,7 +432,7 @@ typedef struct ACameraDevice ACameraDevice;
*
*/
camera_status_t ACameraCaptureSession_getDevice(
ACameraCaptureSession* session, /*out*/ACameraDevice** device);
ACameraCaptureSession* session, /*out*/ACameraDevice** device) __INTRODUCED_IN(24);

/**
* Submit an array of requests to be captured in sequence as a burst in the minimum of time possible.
Expand Down Expand Up @@ -472,7 +470,7 @@ camera_status_t ACameraCaptureSession_capture(
ACameraCaptureSession* session,
/*optional*/ACameraCaptureSession_captureCallbacks* callbacks,
int numRequests, ACaptureRequest** requests,
/*optional*/int* captureSequenceId);
/*optional*/int* captureSequenceId) __INTRODUCED_IN(24);

/**
* Request endlessly repeating capture of a sequence of images by this capture session.
Expand Down Expand Up @@ -526,7 +524,7 @@ camera_status_t ACameraCaptureSession_setRepeatingRequest(
ACameraCaptureSession* session,
/*optional*/ACameraCaptureSession_captureCallbacks* callbacks,
int numRequests, ACaptureRequest** requests,
/*optional*/int* captureSequenceId);
/*optional*/int* captureSequenceId) __INTRODUCED_IN(24);

/**
* Cancel any ongoing repeating capture set by {@link ACameraCaptureSession_setRepeatingRequest}.
Expand All @@ -549,7 +547,8 @@ camera_status_t ACameraCaptureSession_setRepeatingRequest(
* <li>{@link ACAMERA_ERROR_CAMERA_SERVICE} if the camera service encounters fatal error</li>
* <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons</li></ul>
*/
camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession* session);
camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession* session)
__INTRODUCED_IN(24);

/**
* Discard all captures currently pending and in-progress as fast as possible.
Expand Down Expand Up @@ -589,11 +588,8 @@ camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession* sessi
* <li>{@link ACAMERA_ERROR_CAMERA_SERVICE} if the camera service encounters fatal error</li>
* <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons</li></ul>
*/
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session);

#endif /* __ANDROID_API__ >= 24 */

#if __ANDROID_API__ >= 28
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session)
__INTRODUCED_IN(24);

typedef struct ACaptureSessionOutput ACaptureSessionOutput;

Expand Down Expand Up @@ -638,8 +634,7 @@ typedef struct ACaptureSessionOutput ACaptureSessionOutput;
* <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons</li></ul>
*/
camera_status_t ACameraCaptureSession_updateSharedOutput(ACameraCaptureSession* session,
ACaptureSessionOutput* output);
#endif /* __ANDROID_API__ >= 28 */
ACaptureSessionOutput* output) __INTRODUCED_IN(28);

__END_DECLS

Expand Down
40 changes: 18 additions & 22 deletions camera/ndk/include/camera/NdkCameraDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
* ACameraDevice is opaque type that provides access to a camera device.
*
Expand Down Expand Up @@ -176,7 +174,7 @@ typedef ACameraDevice_StateCallbacks ACameraDevice_stateCallbacks;
* <li>{@link ACAMERA_OK} if the method call succeeds.</li>
* <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if device is NULL.</li></ul>
*/
camera_status_t ACameraDevice_close(ACameraDevice* device);
camera_status_t ACameraDevice_close(ACameraDevice* device) __INTRODUCED_IN(24);

/**
* Return the camera id associated with this camera device.
Expand All @@ -187,7 +185,7 @@ camera_status_t ACameraDevice_close(ACameraDevice* device);
* delete/free by the application. Also the returned string must not be used after the device
* has been closed.
*/
const char* ACameraDevice_getId(const ACameraDevice* device);
const char* ACameraDevice_getId(const ACameraDevice* device) __INTRODUCED_IN(24);

typedef enum {
/**
Expand Down Expand Up @@ -290,7 +288,7 @@ typedef enum {
*/
camera_status_t ACameraDevice_createCaptureRequest(
const ACameraDevice* device, ACameraDevice_request_template templateId,
/*out*/ACaptureRequest** request);
/*out*/ACaptureRequest** request) __INTRODUCED_IN(24);


typedef struct ACaptureSessionOutputContainer ACaptureSessionOutputContainer;
Expand All @@ -313,7 +311,7 @@ typedef struct ACaptureSessionOutput ACaptureSessionOutput;
* <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container is NULL.</li></ul>
*/
camera_status_t ACaptureSessionOutputContainer_create(
/*out*/ACaptureSessionOutputContainer** container);
/*out*/ACaptureSessionOutputContainer** container) __INTRODUCED_IN(24);

/**
* Free a capture session output container.
Expand All @@ -322,7 +320,8 @@ camera_status_t ACaptureSessionOutputContainer_create(
*
* @see ACaptureSessionOutputContainer_create
*/
void ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer* container);
void ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer* container)
__INTRODUCED_IN(24);

/**
* Create a ACaptureSessionOutput object.
Expand All @@ -344,7 +343,7 @@ void ACaptureSessionOutputContainer_free(ACaptureSessionOutputContain
* @see ACaptureSessionOutputContainer_add
*/
camera_status_t ACaptureSessionOutput_create(
ANativeWindow* anw, /*out*/ACaptureSessionOutput** output);
ANativeWindow* anw, /*out*/ACaptureSessionOutput** output) __INTRODUCED_IN(24);

/**
* Free a ACaptureSessionOutput object.
Expand All @@ -353,7 +352,7 @@ camera_status_t ACaptureSessionOutput_create(
*
* @see ACaptureSessionOutput_create
*/
void ACaptureSessionOutput_free(ACaptureSessionOutput* output);
void ACaptureSessionOutput_free(ACaptureSessionOutput* output) __INTRODUCED_IN(24);

/**
* Add an {@link ACaptureSessionOutput} object to {@link ACaptureSessionOutputContainer}.
Expand All @@ -366,7 +365,8 @@ void ACaptureSessionOutput_free(ACaptureSessionOutput* output);
* <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container or output is NULL.</li></ul>
*/
camera_status_t ACaptureSessionOutputContainer_add(
ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output)
__INTRODUCED_IN(24);

/**
* Remove an {@link ACaptureSessionOutput} object from {@link ACaptureSessionOutputContainer}.
Expand All @@ -382,7 +382,8 @@ camera_status_t ACaptureSessionOutputContainer_add(
* <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container or output is NULL.</li></ul>
*/
camera_status_t ACaptureSessionOutputContainer_remove(
ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output)
__INTRODUCED_IN(24);

/**
* Create a new camera capture session by providing the target output set of {@link ANativeWindow}
Expand Down Expand Up @@ -663,11 +664,7 @@ camera_status_t ACameraDevice_createCaptureSession(
ACameraDevice* device,
const ACaptureSessionOutputContainer* outputs,
const ACameraCaptureSession_stateCallbacks* callbacks,
/*out*/ACameraCaptureSession** session);

#endif /* __ANDROID_API__ >= 24 */

#if __ANDROID_API__ >= 28
/*out*/ACameraCaptureSession** session) __INTRODUCED_IN(24);

/**
* Create a shared ACaptureSessionOutput object.
Expand All @@ -691,7 +688,7 @@ camera_status_t ACameraDevice_createCaptureSession(
* @see ACaptureSessionOutputContainer_add
*/
camera_status_t ACaptureSessionSharedOutput_create(
ANativeWindow* anw, /*out*/ACaptureSessionOutput** output);
ANativeWindow* anw, /*out*/ACaptureSessionOutput** output) __INTRODUCED_IN(28);

/**
* Add a native window to shared ACaptureSessionOutput.
Expand All @@ -708,7 +705,8 @@ camera_status_t ACaptureSessionSharedOutput_create(
* window associated with ACaptureSessionOutput; or anw is already present inside
* ACaptureSessionOutput.</li></ul>
*/
camera_status_t ACaptureSessionSharedOutput_add(ACaptureSessionOutput *output, ANativeWindow *anw);
camera_status_t ACaptureSessionSharedOutput_add(ACaptureSessionOutput *output,
ANativeWindow *anw) __INTRODUCED_IN(28);

/**
* Remove a native window from shared ACaptureSessionOutput.
Expand All @@ -724,7 +722,7 @@ camera_status_t ACaptureSessionSharedOutput_add(ACaptureSessionOutput *output, A
* ACaptureSessionOutput.</li></ul>
*/
camera_status_t ACaptureSessionSharedOutput_remove(ACaptureSessionOutput *output,
ANativeWindow* anw);
ANativeWindow* anw) __INTRODUCED_IN(28);

/**
* Create a new camera capture session similar to {@link ACameraDevice_createCaptureSession}. This
Expand Down Expand Up @@ -757,9 +755,7 @@ camera_status_t ACameraDevice_createCaptureSessionWithSessionParameters(
const ACaptureSessionOutputContainer* outputs,
const ACaptureRequest* sessionParameters,
const ACameraCaptureSession_stateCallbacks* callbacks,
/*out*/ACameraCaptureSession** session);

#endif /* __ANDROID_API__ >= 28 */
/*out*/ACameraCaptureSession** session) __INTRODUCED_IN(28);

__END_DECLS

Expand Down
4 changes: 0 additions & 4 deletions camera/ndk/include/camera/NdkCameraError.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

typedef enum {
ACAMERA_OK = 0,

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

#endif /* __ANDROID_API__ >= 24 */

__END_DECLS

#endif /* _NDK_CAMERA_ERROR_H */
Expand Down
25 changes: 12 additions & 13 deletions camera/ndk/include/camera/NdkCameraManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

/**
* ACameraManager is opaque type that provides access to camera service.
*
Expand All @@ -65,14 +63,14 @@ typedef struct ACameraManager ACameraManager;
* @return a {@link ACameraManager} instance.
*
*/
ACameraManager* ACameraManager_create();
ACameraManager* ACameraManager_create() __INTRODUCED_IN(24);

/**
* <p>Delete the {@link ACameraManager} instance and free its resources. </p>
*
* @param manager the {@link ACameraManager} instance to be deleted.
*/
void ACameraManager_delete(ACameraManager* manager);
void ACameraManager_delete(ACameraManager* manager) __INTRODUCED_IN(24);

/// Struct to hold list of camera devices
typedef struct ACameraIdList {
Expand Down Expand Up @@ -102,14 +100,14 @@ typedef struct ACameraIdList {
* <li>{@link ACAMERA_ERROR_NOT_ENOUGH_MEMORY} if allocating memory fails.</li></ul>
*/
camera_status_t ACameraManager_getCameraIdList(ACameraManager* manager,
/*out*/ACameraIdList** cameraIdList);
/*out*/ACameraIdList** cameraIdList) __INTRODUCED_IN(24);

/**
* Delete a list of camera devices allocated via {@link ACameraManager_getCameraIdList}.
*
* @param cameraIdList the {@link ACameraIdList} to be deleted.
*/
void ACameraManager_deleteCameraIdList(ACameraIdList* cameraIdList);
void ACameraManager_deleteCameraIdList(ACameraIdList* cameraIdList) __INTRODUCED_IN(24);

/**
* Definition of camera availability callbacks.
Expand All @@ -120,7 +118,8 @@ void ACameraManager_deleteCameraIdList(ACameraIdList* cameraIdList);
* argument is owned by camera framework and will become invalid immediately after
* this callback returns.
*/
typedef void (*ACameraManager_AvailabilityCallback)(void* context, const char* cameraId);
typedef void (*ACameraManager_AvailabilityCallback)(void* context,
const char* cameraId) __INTRODUCED_IN(24);

/**
* A listener for camera devices becoming available or unavailable to open.
Expand Down Expand Up @@ -168,7 +167,8 @@ typedef struct ACameraManager_AvailabilityListener {
* {ACameraManager_AvailabilityCallbacks#onCameraUnavailable} is NULL.</li></ul>
*/
camera_status_t ACameraManager_registerAvailabilityCallback(
ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
ACameraManager* manager,
const ACameraManager_AvailabilityCallbacks* callback) __INTRODUCED_IN(24);

/**
* Unregister camera availability callbacks.
Expand All @@ -185,7 +185,8 @@ camera_status_t ACameraManager_registerAvailabilityCallback(
* {ACameraManager_AvailabilityCallbacks#onCameraUnavailable} is NULL.</li></ul>
*/
camera_status_t ACameraManager_unregisterAvailabilityCallback(
ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
ACameraManager* manager,
const ACameraManager_AvailabilityCallbacks* callback) __INTRODUCED_IN(24);

/**
* Query the capabilities of a camera device. These capabilities are
Expand All @@ -211,7 +212,7 @@ camera_status_t ACameraManager_unregisterAvailabilityCallback(
*/
camera_status_t ACameraManager_getCameraCharacteristics(
ACameraManager* manager, const char* cameraId,
/*out*/ACameraMetadata** characteristics);
/*out*/ACameraMetadata** characteristics) __INTRODUCED_IN(24);

/**
* Open a connection to a camera with the given ID. The opened camera device will be
Expand Down Expand Up @@ -271,9 +272,7 @@ camera_status_t ACameraManager_getCameraCharacteristics(
camera_status_t ACameraManager_openCamera(
ACameraManager* manager, const char* cameraId,
ACameraDevice_StateCallbacks* callback,
/*out*/ACameraDevice** device);

#endif /* __ANDROID_API__ >= 24 */
/*out*/ACameraDevice** device) __INTRODUCED_IN(24);

__END_DECLS

Expand Down
14 changes: 6 additions & 8 deletions camera/ndk/include/camera/NdkCameraMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

__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
Expand Down Expand Up @@ -191,7 +189,8 @@ typedef struct ACameraMetadata_const_entry {
* of input tag value.</li></ul>
*/
camera_status_t ACameraMetadata_getConstEntry(
const ACameraMetadata* metadata, uint32_t tag, /*out*/ACameraMetadata_const_entry* entry);
const ACameraMetadata* metadata,
uint32_t tag, /*out*/ACameraMetadata_const_entry* entry) __INTRODUCED_IN(24);

/**
* List all the entry tags in input {@link ACameraMetadata}.
Expand All @@ -208,7 +207,8 @@ camera_status_t ACameraMetadata_getConstEntry(
* <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons.</li></ul>
*/
camera_status_t ACameraMetadata_getAllTags(
const ACameraMetadata* metadata, /*out*/int32_t* numEntries, /*out*/const uint32_t** tags);
const ACameraMetadata* metadata,
/*out*/int32_t* numEntries, /*out*/const uint32_t** tags) __INTRODUCED_IN(24);

/**
* Create a copy of input {@link ACameraMetadata}.
Expand All @@ -220,16 +220,14 @@ camera_status_t ACameraMetadata_getAllTags(
*
* @return a valid ACameraMetadata pointer or NULL if the input metadata cannot be copied.
*/
ACameraMetadata* ACameraMetadata_copy(const ACameraMetadata* src);
ACameraMetadata* ACameraMetadata_copy(const ACameraMetadata* src) __INTRODUCED_IN(24);

/**
* Free a {@link ACameraMetadata} structure.
*
* @param metadata the {@link ACameraMetadata} to be freed.
*/
void ACameraMetadata_free(ACameraMetadata* metadata);

#endif /* __ANDROID_API__ >= 24 */
void ACameraMetadata_free(ACameraMetadata* metadata) __INTRODUCED_IN(24);

__END_DECLS

Expand Down
5 changes: 0 additions & 5 deletions camera/ndk/include/camera/NdkCameraMetadataTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

typedef enum acamera_metadata_section {
ACAMERA_COLOR_CORRECTION,
ACAMERA_CONTROL,
Expand Down Expand Up @@ -7779,9 +7777,6 @@ typedef enum acamera_metadata_enum_acamera_distortion_correction_mode {

} acamera_metadata_enum_android_distortion_correction_mode_t;


#endif /* __ANDROID_API__ >= 24 */

__END_DECLS

#endif /* _NDK_CAMERA_METADATA_TAGS_H */
Expand Down
Loading

0 comments on commit 85a4153

Please sign in to comment.