OSDN Git Service

Make Status an enum and move it from media to media.omx.
authorPawin Vongmasa <pawin@google.com>
Thu, 1 Dec 2016 02:44:34 +0000 (18:44 -0800)
committerPawin Vongmasa <pawin@google.com>
Thu, 1 Dec 2016 04:00:57 +0000 (20:00 -0800)
Bug: 31399200

Test: None.
Change-Id: I28a891030f24b3d9aa2938ae61bf02b060feee05

media/1.0/types.hal
media/omx/1.0/types.hal

index 25931f8..98dfe14 100644 (file)
@@ -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<uint8_t> Bytes;
 
 /**
index 418deb3..6a73346 100644 (file)
@@ -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