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 #ifndef I_HPAE_OUTPUT_CLUSTER_H 17 #define I_HPAE_OUTPUT_CLUSTER_H 18 #include "hpae_node.h" 19 #include "sink/i_audio_render_sink.h" 20 21 namespace OHOS { 22 namespace AudioStandard { 23 namespace HPAE { 24 constexpr uint32_t TIME_OUT_STOP_THD_DEFAULT_FRAME = 150; 25 constexpr uint32_t FRAME_LEN_MS_DEFAULT_MS = 20; 26 class IHpaeOutputCluster : public InputNode<HpaePcmBuffer *> { 27 public: 28 virtual ~IHpaeOutputCluster() = default; 29 virtual int32_t GetConverterNodeCount() = 0; 30 virtual int32_t GetPreOutNum() = 0; 31 virtual int32_t GetInstance(const std::string &deviceClass, const std::string &deviceNetId) = 0; 32 virtual int32_t Init(IAudioSinkAttr &attr) = 0; 33 virtual int32_t DeInit() = 0; 34 virtual int32_t Flush(void) = 0; 35 virtual int32_t Pause(void) = 0; 36 virtual int32_t ResetRender(void) = 0; 37 virtual int32_t Resume(void) = 0; 38 virtual int32_t Start(void) = 0; 39 virtual int32_t Stop(void) = 0; 40 virtual int32_t SetTimeoutStopThd(uint32_t timeoutThdMs) = 0; 41 virtual const char *GetFrameData(void) = 0; 42 virtual StreamManagerState GetState(void) = 0; 43 virtual bool IsProcessClusterConnected(HpaeProcessorType sceneType) = 0; 44 virtual int32_t UpdateAppsUid(const std::vector<int32_t> &appsUid) = 0; SetPriPaPower(void)45 virtual int32_t SetPriPaPower(void) { return 0; }; SetSyncId(int32_t syncId)46 virtual int32_t SetSyncId(int32_t syncId) { return 0; }; GetLatency()47 virtual uint32_t GetLatency() { return 0; }; 48 }; 49 } // namespace HPAE 50 } // namespace AudioStandard 51 } // namespace OHOS 52 #endif // I_HPAE_OUTPUT_CLUSTER_H