• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 AUDIO_EFFECT_HDI_PARAM_H
17 #define AUDIO_EFFECT_HDI_PARAM_H
18 
19 #include <mutex>
20 #include "v1_0/ieffect_model.h"
21 #include "audio_effect.h"
22 
23 namespace OHOS {
24 namespace AudioStandard {
25 class AudioEffectHdiParam {
26 public:
27     AudioEffectHdiParam();
28     ~AudioEffectHdiParam();
29     void InitHdi();
30     int32_t UpdateHdiState(int8_t *effectHdiInput);
31     int32_t UpdateHdiState(int8_t *effectHdiInput, DeviceType deviceType);
32 private:
33     static const uint32_t GET_HDI_BUFFER_LEN = 10;
34     void CreateHdiControl();
35     int8_t input_[SEND_HDI_COMMAND_LEN];
36     int8_t output_[GET_HDI_BUFFER_LEN];
37     uint32_t replyLen_;
38     std::string libName_;
39     std::string effectId_;
40     IEffectModel *hdiModel_;
41     std::map<DeviceType, IEffectControl *> DeviceTypeToHdiControlMap_;
42     int32_t SetHdiCommand(IEffectControl *hdiControl, int8_t *effectHdiInput);
43 };
44 }  // namespace AudioStandard
45 }  // namespace OHOS
46 #endif // AUDIO_EFFECT_HDI_PARAM_H