• 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 
16 #ifndef HPAE_DEFINE_H
17 #define HPAE_DEFINE_H
18 #include "hpae_msg_channel.h"
19 #include "i_stream.h"
20 
21 namespace OHOS {
22 namespace AudioStandard {
23 namespace HPAE {
24 constexpr uint32_t MILLISECOND_PER_SECOND = 1000;
25 
26 struct HpaeSessionInfo {
27     HpaeStreamInfo streamInfo;
28     HpaeSessionState state = HPAE_SESSION_NEW;
29     std::weak_ptr<IStreamStatusCallback> statusCallback;
30     int32_t offloadType = OFFLOAD_DEFAULT;
31     bool offloadEnable = false;
32     float speed = 1.0f;
33     uint64_t startTime; // create time
34 };
35 
36 
37 constexpr int32_t SCENE_TYPE_NUM = 9;
38 
39 struct HpaeRenderSessionInfo {
40     HpaeProcessorType sceneType = HPAE_SCENE_DEFAULT;
41     HpaeSessionState state = HPAE_SESSION_NEW;
42     bool isMoveAble = true;
43     bool bypass = false;
44 };
45 
46 struct HpaeSinkInputInfo {
47     HpaeRenderSessionInfo rendererSessionInfo;
48     HpaeNodeInfo nodeInfo;
49 };
50 
51 struct HpaeCapturerSessionInfo {
52     HpaeProcessorType sceneType = HPAE_SCENE_DEFAULT;
53     HpaeSessionState state = HPAE_SESSION_NEW;
54     bool isMoveAble = true;
55 };
56 
57 struct HpaeSourceOutputInfo {
58     HpaeCapturerSessionInfo capturerSessionInfo;
59     HpaeNodeInfo nodeInfo;
60 };
61 
62 enum HpaeBufferType {
63     HPAE_BUFFER_TYPE_DEFAULT = 0,
64     HPAE_BUFFER_TYPE_COBUFFER
65 };
66 }  // namespace HPAE
67 }  // namespace AudioStandard
68 }  // namespace OHOS
69 
70 #endif // HPAE_DEFINE_H