• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023-2023 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  * Description: supply cast mirror player interface.
15  * Author: zhangjingnan
16  * Create: 2023-05-27
17  */
18 
19 #ifndef I_CAST_MIRROR_PLAYER_IMPL_H
20 #define I_CAST_MIRROR_PLAYER_IMPL_H
21 
22 #include <string>
23 
24 #include "iremote_broker.h"
25 #include "oh_remote_control_event.h"
26 #include "surface_utils.h"
27 
28 namespace OHOS {
29 namespace CastEngine {
30 class IMirrorPlayerImpl : public IRemoteBroker {
31 public:
32     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.CastEngine.IMirrorPlayerImpl");
33 
34     IMirrorPlayerImpl() = default;
35     IMirrorPlayerImpl(const IMirrorPlayerImpl &) = delete;
36     IMirrorPlayerImpl &operator=(const IMirrorPlayerImpl &) = delete;
37     IMirrorPlayerImpl(IMirrorPlayerImpl &&) = delete;
38     IMirrorPlayerImpl &operator=(IMirrorPlayerImpl &&) = delete;
39     ~IMirrorPlayerImpl() override = default;
40 
41     virtual int32_t Play(const std::string &deviceId) = 0;
42     virtual int32_t Pause(const std::string &deviceId) = 0;
43     virtual int32_t SetSurface(sptr<IBufferProducer> producer) = 0;
44     virtual int32_t SetAppInfo(const AppInfo &appInfo) = 0;
45     virtual int32_t DeliverInputEvent(const OHRemoteControlEvent &event) = 0;
46     virtual int32_t InjectEvent(const OHRemoteControlEvent &event) = 0;
47     virtual int32_t Release() = 0;
48     virtual int32_t GetDisplayId(std::string &displayId) = 0;
49     virtual int32_t ResizeVirtualScreen(uint32_t width, uint32_t height) = 0;
50 
51 protected:
52     enum {
53         PLAY = 1,
54         PAUSE,
55         SET_SURFACE,
56         DELIVER_INPUT_EVENT,
57         INJECT_EVENT,
58         RELEASE,
59         SET_APP_INFO,
60         GET_DISPLAYID,
61         RESIZE_VIRTUAL_SCREEN,
62     };
63 };
64 } // namespace CastEngine
65 } // namespace OHOS
66 #endif