• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #ifndef CM_PARAM_H
17 #define CM_PARAM_H
18 
19 #include "cm_type.h"
20 
21 #define CM_PARAM_SET_MAX_SIZE (4 * 1024 * 1024)
22 #define CM_DEFAULT_PARAM_SET_SIZE 512
23 #define CM_DEFAULT_PARAM_CNT ((uint32_t)((CM_DEFAULT_PARAM_SET_SIZE - sizeof(struct CmParamSet)) / \
24     sizeof(struct CmParam)))
25 #define CM_TAG_TYPE_MASK (0xF << 28)
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 enum CmTagType GetTagType(enum CmTag tag);
32 
33 int32_t CmInitParamSet(struct CmParamSet **paramSet);
34 
35 int32_t CmBuildParamSet(struct CmParamSet **paramSet);
36 
37 void CmFreeParamSet(struct CmParamSet **paramSet);
38 
39 int32_t CmGetParam(const struct CmParamSet *paramSet, uint32_t tag, struct CmParam **param);
40 
41 int32_t CmGetParamSet(const struct CmParamSet *inParamSet, uint32_t inParamSetSize, struct CmParamSet **outParamSet);
42 
43 int32_t CmAddParams(struct CmParamSet *paramSet, const struct CmParam *params, uint32_t paramCnt);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif
49