• 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 #ifndef HIGH_POWER_WAKEUP_ENGINE_H
16 #define HIGH_POWER_WAKEUP_ENGINE_H
17 
18 #include <string>
19 #include "engine_base.h"
20 #include "task_executor.h"
21 #include "engine_util.h"
22 #include "i_intell_voice_engine.h"
23 #include "high_power_adapter_listener.h"
24 
25 namespace OHOS {
26 namespace IntellVoiceEngine {
27 
28 class HighPowerWakeupEngine : public EngineBase, private EngineUtil {
29 public:
30     HighPowerWakeupEngine();
31     ~HighPowerWakeupEngine();
32     bool Init(const std::string &param, bool reEnroll = false) override;
33     void SetCallback(sptr<IRemoteObject> object) override;
Attach(const IntellVoiceEngineInfo & info)34     int32_t Attach(const IntellVoiceEngineInfo &info) override { return 0; };
35     int32_t Detach(void) override;
Start(bool isLast)36     int32_t Start(bool isLast) override { return 0; };
SetParameter(const std::string & keyValueList)37     int32_t SetParameter(const std::string &keyValueList) override { return 0; };
38     std::string GetParameter(const std::string &key) override;
Stop()39     int32_t Stop() override { return 0; };
GetWakeupPcm(std::vector<uint8_t> & data)40     int32_t GetWakeupPcm(std::vector<uint8_t> &data) override { return 0; };
StartCapturer(int32_t channels)41     int32_t StartCapturer(int32_t channels) override { return 0; };
Read(std::vector<uint8_t> & data)42     int32_t Read(std::vector<uint8_t> &data) override { return 0; };
StopCapturer()43     int32_t StopCapturer() override { return 0; };
NotifyHeadsetWakeEvent()44     int32_t NotifyHeadsetWakeEvent() override { return 0; };
NotifyHeadsetHostEvent(HeadsetHostEventType event)45     int32_t NotifyHeadsetHostEvent(HeadsetHostEventType event) override { return 0; };
46 
47 private:
48     bool SetCallbackInner();
49 
50 private:
51     std::mutex mutex_;
52     sptr<OHOS::HDI::IntelligentVoice::Engine::V1_0::IIntellVoiceEngineCallback> callback_ = nullptr;
53     std::shared_ptr<HighPowerAdapterListener> adapterListener_ = nullptr;
54 };
55 }
56 }
57 #endif