* Allocates a buffer that backs an AHardwareBuffer using the passed
* AHardwareBuffer_Desc.
*
- * Returns NO_ERROR on success, or an error number of the allocation fails for
- * any reason.
+ * \return 0 on success, or an error number of the allocation fails for
+ * any reason. The returned buffer has a reference count of 1.
*/
int AHardwareBuffer_allocate(const AHardwareBuffer_Desc* desc,
- AHardwareBuffer** outBuffer);
+ AHardwareBuffer** outBuffer) __INTRODUCED_IN(26);
/**
* Acquire a reference on the given AHardwareBuffer object. This prevents the
* object from being deleted until the last reference is removed.
* AHardwareBuffer_Desc struct.
*/
void AHardwareBuffer_describe(const AHardwareBuffer* buffer,
- AHardwareBuffer_Desc* outDesc);
+ AHardwareBuffer_Desc* outDesc) __INTRODUCED_IN(26);
-/*
+/**
* Lock the AHardwareBuffer for reading or writing, depending on the usage flags
* passed. This call may block if the hardware needs to finish rendering or if
* CPU caches need to be synchronized, or possibly for other implementation-
* number of the lock fails for any reason.
*/
int AHardwareBuffer_lock(AHardwareBuffer* buffer, uint64_t usage,
- int32_t fence, const ARect* rect, void** outVirtualAddress);
+ int32_t fence, const ARect* rect, void** outVirtualAddress) __INTRODUCED_IN(26);
-/*
+/**
* Unlock the AHardwareBuffer; must be called after all changes to the buffer
* are completed by the caller. If fence is not NULL then it will be set to a
* file descriptor that is signaled when all pending work on the buffer is
* completed. The caller is responsible for closing the fence when it is no
* longer needed.
*
- * Returns NO_ERROR on success, BAD_VALUE if the buffer is NULL, or an error
- * number of the lock fails for any reason.
+ * \return 0 on success, -EINVAL if \a buffer is NULL, or an error
+ * number if the unlock fails for any reason.
*/
- int AHardwareBuffer_unlock(AHardwareBuffer* buffer, int32_t* fence);
+ int AHardwareBuffer_unlock(AHardwareBuffer* buffer, int32_t* fence) __INTRODUCED_IN(26);
-/*
+/**
* Send the AHardwareBuffer to an AF_UNIX socket.
*
- * Returns NO_ERROR on success, BAD_VALUE if the buffer is NULL, or an error
- * number of the lock fails for any reason.
+ * \return 0 on success, -EINVAL if \a buffer is NULL, or an error
+ * number if the operation fails for any reason.
*/
- int AHardwareBuffer_sendHandleToUnixSocket(const AHardwareBuffer* buffer, int socketFd);
+ int AHardwareBuffer_sendHandleToUnixSocket(const AHardwareBuffer* buffer, int socketFd) __INTRODUCED_IN(26);
-/*
+/**
* Receive the AHardwareBuffer from an AF_UNIX socket.
*
- * Returns NO_ERROR on success, BAD_VALUE if the buffer is NULL, or an error
- * number of the lock fails for any reason.
+ * \return 0 on success, -EINVAL if \a outBuffer is NULL, or an error
+ * number if the operation fails for any reason.
*/
- int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** outBuffer);
+ int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** outBuffer) __INTRODUCED_IN(26);
__END_DECLS