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

Commit 19bd4526 authored by Gerry Fan's avatar Gerry Fan Committed by Android (Google) Code Review
Browse files

Merge "Fix link errors when generating ndk reference docs" into sc-dev

parents 3696711e b38e2c89
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -50,7 +50,10 @@ __BEGIN_DECLS
 */
typedef struct AImage AImage;

// Formats not listed here will not be supported by AImageReader
/**
 * AImage supported formats: AImageReader only guarantees the support for the formats
 * listed here.
 */
enum AIMAGE_FORMATS {
    /**
     * 32 bits RGBA format, 8 bits for each of the four channels.
@@ -813,7 +816,7 @@ void AImage_deleteAsync(AImage* image, int releaseFenceFd) __INTRODUCED_IN(26);
 * Available since API level 26.
 *
 * @param image the {@link AImage} of interest.
 * @param outBuffer The memory area pointed to by buffer will contain the acquired AHardwareBuffer
 * @param buffer The memory area pointed to by buffer will contain the acquired AHardwareBuffer
 *         handle.
 * @return <ul>
 *         <li>{@link AMEDIA_OK} if the method call succeeds.</li>
+10 −6
Original line number Diff line number Diff line
@@ -328,10 +328,10 @@ media_status_t AImageReader_setImageListener(
 * still acquire images from this {@link AImageReader} and access {@link AHardwareBuffer} via
 * {@link AImage_getHardwareBuffer()}. The {@link AHardwareBuffer} gained this way can then
 * be passed back to hardware (such as GPU or hardware encoder if supported) for future processing.
 * For example, you can obtain an {@link EGLClientBuffer} from the {@link AHardwareBuffer} by using
 * {@link eglGetNativeClientBufferANDROID} extension and pass that {@link EGLClientBuffer} to {@link
 * eglCreateImageKHR} to create an {@link EGLImage} resource type, which may then be bound to a
 * texture via {@link glEGLImageTargetTexture2DOES} on supported devices. This can be useful for
 * For example, you can obtain an EGLClientBuffer from the {@link AHardwareBuffer} by using
 * eglGetNativeClientBufferANDROID extension and pass that EGLClientBuffer to
 * eglCreateImageKHR to create an EGLImage resource type, which may then be bound to a
 * texture via glEGLImageTargetTexture2DOES on supported devices. This can be useful for
 * transporting textures that may be shared cross-process.</p>
 * <p>In general, when software access to image data is not necessary, an {@link AImageReader}
 * created with {@link AIMAGE_FORMAT_PRIVATE} format is more efficient, compared with {@link
@@ -339,7 +339,7 @@ media_status_t AImageReader_setImageListener(
 *
 * <p>Note that not all format and usage flag combination is supported by the {@link AImageReader},
 * especially if \c format is {@link AIMAGE_FORMAT_PRIVATE}, \c usage must not include either
 * {@link AHARDWAREBUFFER_USAGE_READ_RARELY} or {@link AHARDWAREBUFFER_USAGE_READ_OFTEN}</p>
 * {@link AHARDWAREBUFFER_USAGE_CPU_READ_RARELY} or {@link AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN}</p>
 *
 * @param width The default width in pixels of the Images that this reader will produce.
 * @param height The default height in pixels of the Images that this reader will produce.
@@ -358,7 +358,7 @@ media_status_t AImageReader_setImageListener(
 *   <th>Compatible usage flags</th>
 * </tr>
 * <tr>
 *   <td>non-{@link AIMAGE_FORMAT_PRIVATE PRIVATE} formats defined in {@link AImage.h}
 *   <td>non-{@link AIMAGE_FORMAT_PRIVATE} formats defined in {@link NdkImage.h}
 * </td>
 *   <td>{@link AHARDWAREBUFFER_USAGE_CPU_READ_RARELY} or
 *   {@link AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN}</td>
@@ -441,6 +441,10 @@ typedef void (*AImageReader_BufferRemovedCallback)(void* context,
        AImageReader* reader,
        AHardwareBuffer* buffer);

/**
 * A listener to the AHardwareBuffer removal event, use
 * {@link AImageReader_setBufferRemovedListener} to register the listener object to AImageReader.
 */
typedef struct AImageReader_BufferRemovedListener {
    /// Optional application context passed as the first parameter of the callback.
    void*                      context;
+34 −0
Original line number Diff line number Diff line
@@ -40,7 +40,11 @@

__BEGIN_DECLS

/**
 * Media error message types returned from NDK media functions.
 */
typedef enum {
    /** The requested media operation completed successfully. */
    AMEDIA_OK = 0,

    /**
@@ -55,14 +59,34 @@ typedef enum {
    AMEDIACODEC_ERROR_RECLAIMED             = 1101,

    AMEDIA_ERROR_BASE                  = -10000,

    /** The called media function failed with an unknown error. */
    AMEDIA_ERROR_UNKNOWN               = AMEDIA_ERROR_BASE,

    /** The input media data is corrupt or incomplete. */
    AMEDIA_ERROR_MALFORMED             = AMEDIA_ERROR_BASE - 1,

    /** The required operation or media formats are not supported. */
    AMEDIA_ERROR_UNSUPPORTED           = AMEDIA_ERROR_BASE - 2,

    /** An invalid (or already closed) object is used in the function call. */
    AMEDIA_ERROR_INVALID_OBJECT        = AMEDIA_ERROR_BASE - 3,

    /** At least one of the invalid parameters is used. */
    AMEDIA_ERROR_INVALID_PARAMETER     = AMEDIA_ERROR_BASE - 4,

    /** The media object is not in the right state for the required operation. */
    AMEDIA_ERROR_INVALID_OPERATION     = AMEDIA_ERROR_BASE - 5,

    /** Media stream ends while processing the requested operation. */
    AMEDIA_ERROR_END_OF_STREAM         = AMEDIA_ERROR_BASE - 6,

    /** An Error occurred when the Media object is carrying IO operation. */
    AMEDIA_ERROR_IO                    = AMEDIA_ERROR_BASE - 7,

    /** The required operation would have to be blocked (on I/O or others),
     *   but blocking is not enabled.
     */
    AMEDIA_ERROR_WOULD_BLOCK           = AMEDIA_ERROR_BASE - 8,

    AMEDIA_DRM_ERROR_BASE              = -20000,
@@ -77,10 +101,20 @@ typedef enum {
    AMEDIA_DRM_LICENSE_EXPIRED         = AMEDIA_DRM_ERROR_BASE - 9,

    AMEDIA_IMGREADER_ERROR_BASE          = -30000,

    /** There are no more image buffers to read/write image data. */
    AMEDIA_IMGREADER_NO_BUFFER_AVAILABLE = AMEDIA_IMGREADER_ERROR_BASE - 1,

    /** The AImage object has used up the allowed maximum image buffers. */
    AMEDIA_IMGREADER_MAX_IMAGES_ACQUIRED = AMEDIA_IMGREADER_ERROR_BASE - 2,

    /** The required image buffer could not be locked to read. */
    AMEDIA_IMGREADER_CANNOT_LOCK_IMAGE   = AMEDIA_IMGREADER_ERROR_BASE - 3,

    /** The media data or buffer could not be unlocked. */
    AMEDIA_IMGREADER_CANNOT_UNLOCK_IMAGE = AMEDIA_IMGREADER_ERROR_BASE - 4,

    /** The media/buffer needs to be locked to perform the required operation. */
    AMEDIA_IMGREADER_IMAGE_NOT_LOCKED    = AMEDIA_IMGREADER_ERROR_BASE - 5,

} media_status_t;