• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 OHOS_AVSESSION_CONTROLLER_H
17 #define OHOS_AVSESSION_CONTROLLER_H
18 
19 #include <bitset>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "avcontrol_command.h"
25 #include "avsession_info.h"
26 #include "key_event.h"
27 #include "want_agent.h"
28 
29 namespace OHOS::AVSession {
30 class AVSessionController {
31 public:
32     virtual int32_t GetAVPlaybackState(AVPlaybackState& state) = 0;
33 
34     virtual int32_t GetAVMetaData(AVMetaData& data) = 0;
35 
36     virtual int32_t SendAVKeyEvent(const MMI::KeyEvent& keyEvent) = 0;
37 
38     virtual int32_t GetLaunchAbility(AbilityRuntime::WantAgent::WantAgent& ability) = 0;
39 
40     virtual int32_t GetValidCommands(std::vector<int32_t>& cmds) = 0;
41 
42     virtual int32_t IsSessionActive(bool& isActive) = 0;
43 
44     virtual int32_t SendControlCommand(const AVControlCommand& cmd) = 0;
45 
46     virtual int32_t RegisterCallback(const std::shared_ptr<AVControllerCallback>& callback) = 0;
47 
48     virtual int32_t SetMetaFilter(const AVMetaData::MetaMaskType& filter) = 0;
49 
50     virtual int32_t SetPlaybackFilter(const AVPlaybackState::PlaybackStateMaskType& filter) = 0;
51 
52     virtual int32_t Destroy() = 0;
53 
54     virtual std::string GetSessionId() = 0;
55 
56     virtual int64_t GetRealPlaybackPosition() = 0;
57 
58     virtual bool IsDestroy() = 0;
59 
60     virtual ~AVSessionController() = default;
61 };
62 } // namespace OHOS::AVSession
63 
64 #endif // OHOS_AVSESSION_CONTROLLER_H