• 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 HPAE_STREAM_MANAGER_H
16 #define HPAE_STREAM_MANAGER_H
17 #include <stdint.h>
18 #include "audio_stream_info.h"
19 #include "hpae_define.h"
20 #include "i_stream.h"
21 namespace OHOS {
22 namespace AudioStandard {
23 namespace HPAE {
24 class HpaeStreamManager : public CallbackSender,
25                           public INodeCallback,
26                           public std::enable_shared_from_this<HpaeStreamManager> {
27 public:
~HpaeStreamManager()28     virtual ~HpaeStreamManager()
29     {}
30     virtual int32_t CreateStream(const HpaeStreamInfo &streamInfo) = 0;
31     virtual int32_t DestroyStream(uint32_t sessionId) = 0;
32     virtual int32_t Start(uint32_t sessionId) = 0;
33     virtual int32_t Pause(uint32_t sessionId) = 0;
34     virtual int32_t Flush(uint32_t sessionId) = 0;
35     virtual int32_t Drain(uint32_t sessionId) = 0;
36     virtual int32_t Stop(uint32_t sessionId) = 0;
37     virtual int32_t Release(uint32_t sessionId) = 0;
38     virtual int32_t MoveStream(uint32_t sessionId, const std::string &sinkName) = 0;
39     virtual int32_t MoveAllStream(const std::string &name, const std::vector<uint32_t>& sessionIds,
40         MoveSessionType moveType = MOVE_ALL) = 0;
41     virtual int32_t SetMute(bool isMute) = 0;
42     virtual void Process() = 0;
43     virtual void HandleMsg() = 0;
44     virtual int32_t Init(bool isReload = false) = 0;
45     virtual int32_t DeInit(bool isMoveDefault = false) = 0;
46     virtual bool IsInit() = 0;
47     virtual bool IsRunning() = 0;
48     virtual bool IsMsgProcessing() = 0;
49     virtual bool DeactivateThread() = 0;
50     virtual std::string GetThreadName() = 0;
51 };
52 }  // namespace HPAE
53 }  // namespace AudioStandard
54 }  // namespace OHOS
55 #endif