/*
 * Copyright (C) 2018 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.bufferpool@2.0;

/**
 * A connection to a buffer pool which handles requests from a buffer pool
 * client. The connection must be made in order to receive buffers from
 * other buffer pool clients.
 */
interface IConnection {

    /**
     * Retrieves a buffer using bufferId. The method must be called from
     * receiving side of buffer during transferring only when the specified
     * buffer is neither cached nor used. This fails if the specified
     * transaction is not valid.
     *
     * @param transactionId Unique transaction id for buffer transferring.
     * @param bufferId Id of the buffer to be fetched.
     * @return status The status of the call.
     *     OK               - A buffer was fetched successfully.
     *     NO_MEMORY        - Memory allocation failure occurred.
     *     NOT_FOUND        - A buffer was not found due to invalidation.
     *     CRITICAL_ERROR   - Other errors.
     * @return buffer The actual buffer which is specified with bufferId.
     */
    fetch(uint64_t transactionId, uint32_t bufferId) generates
        (ResultStatus status, Buffer buffer);
};
