From: Pawin Vongmasa Date: Thu, 1 Dec 2016 02:44:34 +0000 (-0800) Subject: Make Status an enum and move it from media to media.omx. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=26497205484ba80b41dd9df51ca190d785e92cb9;p=android-x86%2Fhardware-interfaces.git Make Status an enum and move it from media to media.omx. Bug: 31399200 Test: None. Change-Id: I28a891030f24b3d9aa2938ae61bf02b060feee05 --- diff --git a/media/1.0/types.hal b/media/1.0/types.hal index 25931f8c..98dfe147 100644 --- a/media/1.0/types.hal +++ b/media/1.0/types.hal @@ -23,7 +23,6 @@ import android.hardware.graphics.common@1.0::PixelFormat; */ typedef handle FileDescriptor; // This must have no more than one fd. typedef FileDescriptor Fence; -typedef int32_t Status; // TODO: convert to an enum typedef vec Bytes; /** diff --git a/media/omx/1.0/types.hal b/media/omx/1.0/types.hal index 418deb34..6a73346c 100644 --- a/media/omx/1.0/types.hal +++ b/media/omx/1.0/types.hal @@ -22,6 +22,23 @@ import android.hardware.media@1.0::types; typedef uint32_t BufferId; /** + * Ref: system/core/include/utils/Errors.h + * Ref: bionic/libc/kernel/uapi/asm-generic/errno-base.h + * Ref: bionic/libc/kernel/uapi/asm-generic/errno.h + * Ref: frameworks/av/include/media/stagefright/MediaError.h + * Ref: frameworks/av/media/libstagefright/omx/OMXUtils.cpp: StatusFromOMXError + */ +enum Status : int32_t { + OK = 0, + NO_ERROR = 0, + + NAME_NOT_FOUND = -2, + NO_MEMORY = -12, + ERROR_UNSUPPORTED = -1010, + UNKNOWN_ERROR = -2147483648, +}; + +/** * Ref: frameworks/av/include/media/IOMX.h: omx_message * * Data structure for an OMX message. This is essentially a union of different