• 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_REMOTE_SESSION_SYNCER_H
17 #define OHOS_REMOTE_SESSION_SYNCER_H
18 
19 #include "avsession_info.h"
20 #include "avmeta_data.h"
21 #include "avplayback_state.h"
22 #include "avcontrol_command.h"
23 
24 namespace OHOS::AVSession {
25 class RemoteSessionSyncer {
26 public:
27     using ObjectDataNotifier = std::function<void(const SessionDataCategory category, const std::string& deviceId)>;
28     using ObjectDisconnectNotifier = std::function<void(const std::string& deviceId)>;
29 
30     virtual int32_t Init() = 0;
31 
32     virtual int32_t PutAVMetaData(const AVMetaData& metaData) = 0;
33 
34     virtual int32_t GetAVMetaData(AVMetaData& metaData) = 0;
35 
36     virtual int32_t PutAVPlaybackState(const AVPlaybackState& state) = 0;
37 
38     virtual int32_t GetAVPlaybackState(AVPlaybackState& state) = 0;
39 
40     virtual int32_t PutControlCommand(const AVControlCommand& command) = 0;
41 
42     virtual int32_t GetControlCommand(AVControlCommand& command) = 0;
43 
44     virtual int32_t RegisterDataNotifier(const ObjectDataNotifier& notifier) = 0;
45 
46     virtual int32_t RegisterDisconnectNotifier(const ObjectDisconnectNotifier& notifier) = 0;
47 
48     virtual void Destroy() = 0;
49 
50     virtual ~RemoteSessionSyncer() = default;
51 };
52 } // namespace OHOS::AVSession
53 #endif // OHOS_REMOTE_SESSION_SYNCER_H