/*
 * Copyright (C) 2021 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.camera.provider@2.7;

import @2.6::ICameraProvider;
import android.hardware.camera.common@1.0::Status;

/**
 * Camera provider HAL
 *
 * Adds support for the isConcurrentStreamCombinationSupported() with
 * ICameraDevice@3.7::StreamConfiguration.
 */
interface ICameraProvider extends @2.6::ICameraProvider {
    /**
     * isConcurrentStreamCombinationSupported_2_7:
     *
     * Identical to @2.6::isConcurrentStreamCombinationSupported except that
     * this function takes a vector of @3.7::StreamConfiguration.
     *
     * @param configs a vector of camera ids and their corresponding stream
     *                configurations that need to be queried for support.
     *
     * @return status Status code for the operation, one of:
     *     OK:
     *          On successful stream combination query.
     *     METHOD_NOT_SUPPORTED:
     *          The camera provider does not support stream combination query.
     *     INTERNAL_ERROR:
     *          The stream combination query cannot complete due to internal
     *          error.
     * @return true in case the stream combination is supported, false otherwise.
     *
     */
    isConcurrentStreamCombinationSupported_2_7(vec<CameraIdAndStreamCombination> configs)
        generates (Status status, bool queryStatus);
};
