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

Commit b25b003a authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'OMX Treble'

* changes:
  Remove the return Status from IGraphicBufferSource's functions.
  Change GraphicBuffer to AnwBuffer and update its fields.
  Add an enum value to Status.
parents 7f6bfcc6 38585c25
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -27,28 +27,28 @@ typedef vec<uint8_t> Bytes;

/**
 * Ref: frameworks/native/include/ui/GraphicBuffer.h
 * Ref: system/core/include/system/window.h
 * Ref: system/core/include/system/window.h: ANativeWindowBuffer
 */

/**
 * This struct contains attributes for a gralloc buffer that can be put into a
 * union.
 */
struct GraphicBufferAttributes {
struct AnwBufferAttributes {
    uint32_t width;
    uint32_t height;
    uint32_t stride;
    PixelFormat format;
    uint32_t usage; // TODO: convert to an enum
    uint32_t generationNumber;
    uint64_t layerCount;
};

/**
 * A GraphicBuffer is simply GraphicBufferAttributes plus a native handle.
 * An AnwBuffer is simply AnwBufferAttributes plus a native handle.
 */
struct GraphicBuffer {
struct AnwBuffer {
    handle nativeHandle;
    GraphicBufferAttributes attr;
    AnwBufferAttributes attr;
};

/**
+9 −18
Original line number Diff line number Diff line
@@ -29,32 +29,23 @@ import IOmxNode;
 */
interface IGraphicBufferSource {

    configure(IOmxNode omxNode, Dataspace dataspace)
        generates (Status status);
    configure(IOmxNode omxNode, Dataspace dataspace);

    setSuspend(bool suspend)
        generates (Status status);
    setSuspend(bool suspend);

    setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs)
        generates (Status status);
    setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs);

    setMaxFps(float maxFps)
        generates (Status status);
    setMaxFps(float maxFps);

    setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs)
        generates (Status status);
    setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs);

    setStartTimeUs(int64_t startTimeUs)
        generates (Status status);
    setStartTimeUs(int64_t startTimeUs);

    setColorAspects(ColorAspects aspects)
        generates (Status status);
    setColorAspects(ColorAspects aspects);

    setTimeOffsetUs(int64_t timeOffsetUs)
        generates (Status status);
    setTimeOffsetUs(int64_t timeOffsetUs);

    signalEndOfInputStream()
        generates (Status status);
    signalEndOfInputStream();

};
+2 −2
Original line number Diff line number Diff line
@@ -46,14 +46,14 @@ interface IOmxNode {
     * Invoke a command on the node.
     *
     * @param[in] cmd indicates the type of the command.
     * @param[in] info holds information about the command.
     * @param[in] param is a parameter for the command.
     * @param[out] status will be the status of the call.
     *
     * @see OMX_SendCommand() in the OpenMax IL standard.
     */
    sendCommand(
            uint32_t cmd,
            Bytes info // TODO: describe structure better or point at standard
            int32_t param
        ) generates (
            Status status
        );
+2 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ enum Status : int32_t {

    NAME_NOT_FOUND          = -2,
    NO_MEMORY               = -12,
    BAD_VALUE               = -22,
    ERROR_UNSUPPORTED       = -1010,
    UNKNOWN_ERROR           = -2147483648,
};
@@ -149,7 +150,7 @@ struct CodecBuffer {
        SharedMemoryAttributes sharedMem;

        // if bufferType == ANW_BUFFER
        GraphicBufferAttributes anwBuffer;
        AnwBufferAttributes anwBuffer;

        // if bufferType == NATIVE_HANDLE
        // No additional attributes.