/* * Copyright (c) 2023 Huawei Device Co., Ltd. * 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 ohos.hdi.display.composer.v1_1; import ohos.hdi.display.composer.v1_0.IDisplayComposer; import ohos.hdi.display.composer.v1_0.DisplayComposerType; import ohos.hdi.display.composer.v1_1.DisplayComposerType; import ohos.hdi.display.composer.v1_1.IModeCallback; import ohos.hdi.display.composer.v1_1.ISeamlessChangeCallback; import ohos.hdi.display.composer.v1_0.IRefreshCallback; interface IDisplayComposer extends ohos.hdi.display.composer.v1_0.IDisplayComposer { /** * @brief Registers the callback to be invoked when it's ready to change framerate. * * @param cb Indicates the instance used to notify graphics service that it's ready to change framerate. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ RegSeamlessChangeCallback([in] ISeamlessChangeCallback cb); /** * @brief Obtains the display modes supported by a display device. * * @param devId Indicates the ID of the display device. * @param modes Indicates the vector of the information about all modes supported by the display device, * including all supported resolutions, refresh rates and groupId. Each mode has an ID, which will be used when * the mode is set or obtained. For details, see {@link DisplayModeInfoExt}. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ GetDisplaySupportedModesExt([in] unsigned int devId, [out] struct DisplayModeInfoExt[] modes); /** * @brief Sets the display mode of a display device. * * @param devId Indicates the ID of the display device. * @param modeId Indicates the ID of the display mode. The device is switched to the display mode specified by * this parameter in this interface. * @param cb Indicates the callback to be invoked when mode is change. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ SetDisplayModeAsync([in] unsigned int devId, [in] unsigned int modeId, [in] IModeCallback cb); /** * @brief Get the current vblank period. * @param devId Indicates the ID of the display device. * @param period Indicates the vblank period(ns). * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ GetDisplayVBlankPeriod([in] unsigned int devId, [out] unsigned long period); /** * @brief Sets parameter for the given layer, the parameter change must have fully taken effect after this call. * * @param devId Indicates the ID of the display device. * @param layerId Indicates the ID of the layer to be operated on. * @param key Indicates a particular key. * @param value Indicates the value corresponding to the key. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ SetLayerPerFrameParameter([in] unsigned int devId, [in] unsigned int layerId, [in] String key, [in] byte[] value); /** * @brief returns the list of supported parameter keys * * @param keys Indicates the supported parameter keys. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ GetSupportedLayerPerFrameParameterKey([out] String[] keys); /** * @brief Sets parameter for the given layer, the parameter change must have fully taken effect after this call. * * @param devId Indicates the ID of the display device. * @param width Indicates the pixel width of the display device * @param height Indicates the pixel height of the display device * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ SetDisplayOverlayResolution([in] unsigned int devId, [in] unsigned int width, [in] unsigned int height); /** * @brief Registers the callback to be invoked when a refresh event occurs. * * @param cb Indicates the instance used to notify the graphics service of a refresh event occurred. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ RegRefreshCallback([in] IRefreshCallback cb); /** * @brief Obtains the color gamuts of a display device. * * @param devId Indicates the ID of the display device. * @param gamuts Indicates the vector of the information about all color gamuts supported by the display device. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ GetDisplaySupportedColorGamuts([in] unsigned int devId, [out] struct ColorGamut[] gamuts); /** * @brief Obtains the capabilities of a display device. * * @param devId Indicates the ID of the display device. * @param info Indicates the pointer to the capabilities supported by the hdr device. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 4.1 * @version 1.1 */ GetHDRCapabilityInfos([in] unsigned int devId, [out] struct HDRCapability info); }