/* * Copyright 2024 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. */ #pragma once #include #include namespace android { class IGraphicBufferProducer; class Surface; namespace view { class Surface; } #define WB_CAMERA3_AND_PROCESSORS_WITH_DEPENDENCIES \ (COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CAMERA3_AND_PROCESSORS) && \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ) && \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS)) #define WB_LIBCAMERASERVICE_WITH_DEPENDENCIES \ (WB_CAMERA3_AND_PROCESSORS_WITH_DEPENDENCIES && \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_LIBCAMERASERVICE)) #if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES typedef android::Surface SurfaceType; typedef android::view::Surface ParcelableSurfaceType; #else typedef android::IGraphicBufferProducer SurfaceType; typedef android::sp ParcelableSurfaceType; #endif namespace flagtools { sp surfaceToSurfaceType(const sp& surface); ParcelableSurfaceType toParcelableSurfaceType(const view::Surface& surface); sp surfaceTypeToIGBP(const sp& surface); bool isSurfaceTypeValid(const sp& surface); ParcelableSurfaceType convertSurfaceTypeToParcelable(sp surface); sp convertParcelableSurfaceTypeToSurface(const ParcelableSurfaceType& surface); } // namespace flagtools } // namespace android