• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development 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 OHOS_SHARING_EVENT_CHANNEL_H
17 #define OHOS_SHARING_EVENT_CHANNEL_H
18 
19 #include "event_comm.h"
20 
21 namespace OHOS {
22 namespace Sharing {
23 
24 struct ProsumerStatusMsg {
25     using Ptr = std::shared_ptr<ProsumerStatusMsg>;
26 
27     uint32_t status;
28     uint32_t agentId = INVALID_ID;
29     uint32_t prosumerId = INVALID_ID;
30     uint64_t surfaceId = INVALID_ID;
31     MediaType mediaType;
32     EventMsg::Ptr eventMsg = nullptr;
33     SharingErrorCode errorCode = ERR_OK;
34 };
35 
36 struct ChannelEventMsg : public EventMsg {
37     using Ptr = std::shared_ptr<ChannelEventMsg>;
38 
39     std::string className;
40     uint32_t agentId = INVALID_ID;
41     uint32_t prosumerId = INVALID_ID;
42     MediaType mediaType;
43 };
44 
45 struct ChannelAppendSurfaceEventMsg : public ChannelEventMsg {
46     using Ptr = std::shared_ptr<ChannelAppendSurfaceEventMsg>;
47 
48     sptr<Surface> surface = nullptr;
49     SceneType sceneType;
50 };
51 
52 struct ChannelRemoveSurfaceEventMsg : public ChannelEventMsg {
53     using Ptr = std::shared_ptr<ChannelRemoveSurfaceEventMsg>;
54 
55     uint64_t surfaceId = 0;
56 };
57 
58 struct ChannelSetSceneTypeEventMsg : public ChannelEventMsg {
59     using Ptr = std::shared_ptr<ChannelSetSceneTypeEventMsg>;
60 
61     uint64_t surfaceId = 0;
62     SceneType sceneType;
63 };
64 
65 struct ChannelSetVolumeEventMsg : public ChannelEventMsg {
66     using Ptr = std::shared_ptr<ChannelSetVolumeEventMsg>;
67 
68     float volume;
69 };
70 
71 struct ChannelSetKeyRedirectEventMsg : public ChannelEventMsg {
72     using Ptr = std::shared_ptr<ChannelSetKeyRedirectEventMsg>;
73 
74     bool keyRedirect;
75     uint64_t surfaceId = 0;
76 };
77 
78 } // namespace Sharing
79 } // namespace OHOS
80 #endif