1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_cipackage ohos.hdi.display.composer.v1_1; 17c5e268c6Sopenharmony_ci 18c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_0.IDisplayComposer; 19c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_0.DisplayComposerType; 20c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_1.DisplayComposerType; 21c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_1.IModeCallback; 22c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_1.ISeamlessChangeCallback; 23c5e268c6Sopenharmony_ciimport ohos.hdi.display.composer.v1_0.IRefreshCallback; 24c5e268c6Sopenharmony_ci 25c5e268c6Sopenharmony_ciinterface IDisplayComposer extends ohos.hdi.display.composer.v1_0.IDisplayComposer { 26c5e268c6Sopenharmony_ci /** 27c5e268c6Sopenharmony_ci * @brief Registers the callback to be invoked when it's ready to change framerate. 28c5e268c6Sopenharmony_ci * 29c5e268c6Sopenharmony_ci * @param cb Indicates the instance used to notify graphics service that it's ready to change framerate. 30c5e268c6Sopenharmony_ci * 31c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 32c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 33c5e268c6Sopenharmony_ci * @since 4.1 34c5e268c6Sopenharmony_ci * @version 1.1 35c5e268c6Sopenharmony_ci */ 36c5e268c6Sopenharmony_ci RegSeamlessChangeCallback([in] ISeamlessChangeCallback cb); 37c5e268c6Sopenharmony_ci 38c5e268c6Sopenharmony_ci /** 39c5e268c6Sopenharmony_ci * @brief Obtains the display modes supported by a display device. 40c5e268c6Sopenharmony_ci * 41c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 42c5e268c6Sopenharmony_ci * @param modes Indicates the vector of the information about all modes supported by the display device, 43c5e268c6Sopenharmony_ci * including all supported resolutions, refresh rates and groupId. Each mode has an ID, which will be used when 44c5e268c6Sopenharmony_ci * the mode is set or obtained. For details, see {@link DisplayModeInfoExt}. 45c5e268c6Sopenharmony_ci * 46c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 47c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 48c5e268c6Sopenharmony_ci * @since 4.1 49c5e268c6Sopenharmony_ci * @version 1.1 50c5e268c6Sopenharmony_ci */ 51c5e268c6Sopenharmony_ci GetDisplaySupportedModesExt([in] unsigned int devId, [out] struct DisplayModeInfoExt[] modes); 52c5e268c6Sopenharmony_ci 53c5e268c6Sopenharmony_ci /** 54c5e268c6Sopenharmony_ci * @brief Sets the display mode of a display device. 55c5e268c6Sopenharmony_ci * 56c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 57c5e268c6Sopenharmony_ci * @param modeId Indicates the ID of the display mode. The device is switched to the display mode specified by 58c5e268c6Sopenharmony_ci * this parameter in this interface. 59c5e268c6Sopenharmony_ci * @param cb Indicates the callback to be invoked when mode is change. 60c5e268c6Sopenharmony_ci * 61c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 62c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 63c5e268c6Sopenharmony_ci * @since 4.1 64c5e268c6Sopenharmony_ci * @version 1.1 65c5e268c6Sopenharmony_ci */ 66c5e268c6Sopenharmony_ci SetDisplayModeAsync([in] unsigned int devId, [in] unsigned int modeId, [in] IModeCallback cb); 67c5e268c6Sopenharmony_ci 68c5e268c6Sopenharmony_ci /** 69c5e268c6Sopenharmony_ci * @brief Get the current vblank period. 70c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 71c5e268c6Sopenharmony_ci * @param period Indicates the vblank period(ns). 72c5e268c6Sopenharmony_ci * 73c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 74c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 75c5e268c6Sopenharmony_ci * @since 4.1 76c5e268c6Sopenharmony_ci * @version 1.1 77c5e268c6Sopenharmony_ci */ 78c5e268c6Sopenharmony_ci GetDisplayVBlankPeriod([in] unsigned int devId, [out] unsigned long period); 79c5e268c6Sopenharmony_ci 80c5e268c6Sopenharmony_ci /** 81c5e268c6Sopenharmony_ci * @brief Sets parameter for the given layer, the parameter change must have fully taken effect after this call. 82c5e268c6Sopenharmony_ci * 83c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 84c5e268c6Sopenharmony_ci * @param layerId Indicates the ID of the layer to be operated on. 85c5e268c6Sopenharmony_ci * @param key Indicates a particular key. 86c5e268c6Sopenharmony_ci * @param value Indicates the value corresponding to the key. 87c5e268c6Sopenharmony_ci * 88c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 89c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 90c5e268c6Sopenharmony_ci * @since 4.1 91c5e268c6Sopenharmony_ci * @version 1.1 92c5e268c6Sopenharmony_ci */ 93c5e268c6Sopenharmony_ci SetLayerPerFrameParameter([in] unsigned int devId, [in] unsigned int layerId, [in] String key, [in] byte[] value); 94c5e268c6Sopenharmony_ci 95c5e268c6Sopenharmony_ci /** 96c5e268c6Sopenharmony_ci * @brief returns the list of supported parameter keys 97c5e268c6Sopenharmony_ci * 98c5e268c6Sopenharmony_ci * @param keys Indicates the supported parameter keys. 99c5e268c6Sopenharmony_ci * 100c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 101c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 102c5e268c6Sopenharmony_ci * @since 4.1 103c5e268c6Sopenharmony_ci * @version 1.1 104c5e268c6Sopenharmony_ci */ 105c5e268c6Sopenharmony_ci GetSupportedLayerPerFrameParameterKey([out] String[] keys); 106c5e268c6Sopenharmony_ci 107c5e268c6Sopenharmony_ci /** 108c5e268c6Sopenharmony_ci * @brief Sets parameter for the given layer, the parameter change must have fully taken effect after this call. 109c5e268c6Sopenharmony_ci * 110c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 111c5e268c6Sopenharmony_ci * @param width Indicates the pixel width of the display device 112c5e268c6Sopenharmony_ci * @param height Indicates the pixel height of the display device 113c5e268c6Sopenharmony_ci * 114c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 115c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 116c5e268c6Sopenharmony_ci * @since 4.1 117c5e268c6Sopenharmony_ci * @version 1.1 118c5e268c6Sopenharmony_ci */ 119c5e268c6Sopenharmony_ci SetDisplayOverlayResolution([in] unsigned int devId, [in] unsigned int width, [in] unsigned int height); 120c5e268c6Sopenharmony_ci 121c5e268c6Sopenharmony_ci /** 122c5e268c6Sopenharmony_ci * @brief Registers the callback to be invoked when a refresh event occurs. 123c5e268c6Sopenharmony_ci * 124c5e268c6Sopenharmony_ci * @param cb Indicates the instance used to notify the graphics service of a refresh event occurred. 125c5e268c6Sopenharmony_ci * 126c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 127c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 128c5e268c6Sopenharmony_ci * @since 4.1 129c5e268c6Sopenharmony_ci * @version 1.1 130c5e268c6Sopenharmony_ci */ 131c5e268c6Sopenharmony_ci RegRefreshCallback([in] IRefreshCallback cb); 132c5e268c6Sopenharmony_ci 133c5e268c6Sopenharmony_ci /** 134c5e268c6Sopenharmony_ci * @brief Obtains the color gamuts of a display device. 135c5e268c6Sopenharmony_ci * 136c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 137c5e268c6Sopenharmony_ci * @param gamuts Indicates the vector of the information about all color gamuts supported by the display device. 138c5e268c6Sopenharmony_ci * 139c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 140c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 141c5e268c6Sopenharmony_ci * @since 4.1 142c5e268c6Sopenharmony_ci * @version 1.1 143c5e268c6Sopenharmony_ci */ 144c5e268c6Sopenharmony_ci GetDisplaySupportedColorGamuts([in] unsigned int devId, [out] struct ColorGamut[] gamuts); 145c5e268c6Sopenharmony_ci 146c5e268c6Sopenharmony_ci /** 147c5e268c6Sopenharmony_ci * @brief Obtains the capabilities of a display device. 148c5e268c6Sopenharmony_ci * 149c5e268c6Sopenharmony_ci * @param devId Indicates the ID of the display device. 150c5e268c6Sopenharmony_ci * @param info Indicates the pointer to the capabilities supported by the hdr device. 151c5e268c6Sopenharmony_ci * 152c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined 153c5e268c6Sopenharmony_ci * in {@link DispErrCode} otherwise. 154c5e268c6Sopenharmony_ci * @since 4.1 155c5e268c6Sopenharmony_ci * @version 1.1 156c5e268c6Sopenharmony_ci */ 157c5e268c6Sopenharmony_ci GetHDRCapabilityInfos([in] unsigned int devId, [out] struct HDRCapability info); 158c5e268c6Sopenharmony_ci} 159