/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.media.omx@1.0;

import android.hardware.media@1.0::types;

/**
 * Ref: frameworks/av/media/libmedia/aidl/android/IOMXBufferSource.aidl
 *
 * IOmxBufferSource is an interface for a listener for certain events from an
 * IOmxNode instance. Use IOmxNode::setInputSurface() to attach an
 * IOmxBufferSource instance to an IOmxNode instance.
 *
 * @see OMX_STATETYPE in the OpenMax IL standard.
 */
interface IOmxBufferSource {

    /**
     * onOmxExecuting() is invoked when the node state changes to
     * OMX_StateExecuting state.
     */
    oneway onOmxExecuting();

    /**
     * onOmxIdle() is invoked when the node transitions from OMX_StateExecuting
     * to OMX_StateIdle.
     */
    oneway onOmxIdle();

    /**
     * onOmxLoaded() is invoked when the node transitions from OMX_StateIdle or
     * OMX_StateExecuting to OMX_StateLoaded.
     */
    oneway onOmxLoaded();

    /**
     * onInputBufferAdded() is invoked after a new input buffer is added to the
     * node. This may happen within IOmxNode::allocateSecureBuffer() or
     * IOmxNode::useBuffer().
     *
     * @param[in] buffer is the id of the added buffer.
     */
    oneway onInputBufferAdded(BufferId buffer);

    /**
     * onInputBufferEmptied() is invoked after an input buffer is emptied. This
     * may happen within IOmxNode::emptyBuffer().
     *
     * @param[in] buffer is the id of the emptied buffer.
     * @param[in] fence is the fence associated with the buffer.
     */
    oneway onInputBufferEmptied(BufferId buffer, Fence fence);
};

