1 /*
2  * Copyright (c) 2020-2021 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 "camera_ability_impl.h"
17 #include "media_log.h"
18 
19 using namespace std;
20 namespace OHOS {
21 namespace Media {
GetSupportedFormats() const22 list<int32_t> CameraAbilityImpl::GetSupportedFormats() const
23 {
24     list<int32_t> test;
25     return test;
26 }
27 
GetSupportedSizes(int format) const28 list<CameraPicSize> CameraAbilityImpl::GetSupportedSizes(int format) const
29 {
30     auto target = SizeMap_.find(PARAM_KEY_SIZE);
31     return target->second;
32 }
33 
GetSupportParameterRange(uint32_t key) const34 list<CameraPicSize> CameraAbilityImpl::GetSupportParameterRange(uint32_t key) const
35 {
36     switch (key) {
37         case PARAM_KEY_SIZE: {
38             auto target = SizeMap_.find(PARAM_KEY_SIZE);
39             return target->second;
40         }
41         default: {
42             list<CameraPicSize> emptyList;
43             return emptyList;
44         }
45     }
46 }
47 
SetSupportParameterRange(uint32_t key,const list<CameraPicSize> & rangeList)48 void CameraAbilityImpl::SetSupportParameterRange(uint32_t key, const list<CameraPicSize> &rangeList)
49 {
50     switch (key) {
51         case PARAM_KEY_SIZE:
52             supportProperties_.emplace(key);
53             SizeMap_[key] = rangeList;
54             break;
55         default:
56             break;
57     }
58 }
59 
IsParameterSupport(uint32_t key) const60 bool CameraAbilityImpl::IsParameterSupport(uint32_t key) const
61 {
62     if (key != PARAM_KEY_SIZE) {
63         return false;
64     }
65     return true;
66 }
67 } // namespace Media
68 } // namespace OHOS