• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "dvsync_param.h"
17 
18 namespace OHOS::Rosen {
19 
IsDVSyncEnable() const20 bool DVSyncParam::IsDVSyncEnable() const
21 {
22     return isRsDVSyncEnabled_;
23 }
IsUiDVSyncEnable() const24 bool DVSyncParam::IsUiDVSyncEnable() const
25 {
26     return isUiDVSyncEnabled_;
27 }
28 
IsNativeDVSyncEnable() const29 bool DVSyncParam::IsNativeDVSyncEnable() const
30 {
31     return isNativeDVSyncEnabled_;
32 }
33 
IsAdaptiveDVSyncEnable() const34 bool DVSyncParam::IsAdaptiveDVSyncEnable() const
35 {
36     return isAdaptiveDVSyncEnabled_;
37 }
38 
GetRsBufferCount() const39 uint32_t DVSyncParam::GetRsBufferCount() const
40 {
41     return rsBufferCount_;
42 }
43 
GetUiBufferCount() const44 uint32_t DVSyncParam::GetUiBufferCount() const
45 {
46     return uiBufferCount_;
47 }
48 
GetNativeBufferCount() const49 uint32_t DVSyncParam::GetNativeBufferCount() const
50 {
51     return nativeBufferCount_;
52 }
53 
GetWebBufferCount() const54 uint32_t DVSyncParam::GetWebBufferCount() const
55 {
56     return webBufferCount_;
57 }
58 
GetAdaptiveConfig() const59 std::unordered_map<std::string, std::string> DVSyncParam::GetAdaptiveConfig() const
60 {
61     return adaptiveConfig_;
62 }
63 
SetDVSyncEnable(bool isEnable)64 void DVSyncParam::SetDVSyncEnable(bool isEnable)
65 {
66     isRsDVSyncEnabled_ = isEnable;
67 }
68 
SetUiDVSyncEnable(bool isEnable)69 void DVSyncParam::SetUiDVSyncEnable(bool isEnable)
70 {
71     isUiDVSyncEnabled_ = isEnable;
72 }
73 
SetNativeDVSyncEnable(bool isEnable)74 void DVSyncParam::SetNativeDVSyncEnable(bool isEnable)
75 {
76     isNativeDVSyncEnabled_ = isEnable;
77 }
78 
SetAdaptiveDVSyncEnable(bool isEnable)79 void DVSyncParam::SetAdaptiveDVSyncEnable(bool isEnable)
80 {
81     isAdaptiveDVSyncEnabled_ = isEnable;
82 }
83 
SetRsBufferCount(int32_t cnt)84 void DVSyncParam::SetRsBufferCount(int32_t cnt)
85 {
86     rsBufferCount_ = static_cast<uint32_t>(cnt);
87 }
88 
SetUiBufferCount(int32_t cnt)89 void DVSyncParam::SetUiBufferCount(int32_t cnt)
90 {
91     uiBufferCount_ = static_cast<uint32_t>(cnt);
92 }
93 
SetNativeBufferCount(int32_t cnt)94 void DVSyncParam::SetNativeBufferCount(int32_t cnt)
95 {
96     nativeBufferCount_ = static_cast<uint32_t>(cnt);
97 }
98 
SetWebBufferCount(int32_t cnt)99 void DVSyncParam::SetWebBufferCount(int32_t cnt)
100 {
101     webBufferCount_ = static_cast<uint32_t>(cnt);
102 }
103 
SetAdaptiveConfig(const std::string & name,const std::string & val)104 void DVSyncParam::SetAdaptiveConfig(const std::string &name, const std::string &val)
105 {
106     adaptiveConfig_[name] = val;
107 }
108 } // namespace OHOS::Rosen