/*
 * Copyright 2020 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.automotive.sv@1.0;

import ISurroundViewStream;

/**
 * Common interface for surround view session extended by surround view 2d and 3d
 * session.
 */
interface ISurroundViewSession {
    /**
     * Requests to start receiving surround view frames.
     *
     * For surround view 3d, setViews() must be set before calling startStream().
     *
     * @param stream     Stream to receiving callbacks for the session.
     * @return svResult  Returns OK if successful, returns VIEW_NOT_SET if setViews() is not
     *                   called for surround view 3d, appropriate error results otherwise.
     */
    startStream(ISurroundViewStream stream) generates (SvResult svResult);

    /**
     * Requests to stop stream.
     *
     * Frames may continue to arrive after call returns. Each must be returned until
     * the closure of the stream is signaled by the ISurroundViewStream.
     */
    stopStream();

    /**
     * Signal from client that a frame, which was delivered by the stream, has been consumed.
     *
     * @param  svFramesDesc Descriptor to signal done with frame.
     */
    oneway doneWithFrames(SvFramesDesc svFramesDesc);
};
