• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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  */
15 
16 #ifndef OHOS_ISESSION_LISTENER_H
17 #define OHOS_ISESSION_LISTENER_H
18 
19 #include "iremote_broker.h"
20 #include "avsession_info.h"
21 
22 namespace OHOS::AVSession {
23 class ISessionListener : public IRemoteBroker {
24 public:
25     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.avsession.ISessionListener");
26 
27     enum {
28         LISTENER_CMD_ON_CREATE,
29         LISTENER_CMD_ON_RELEASE,
30         LISTENER_CMD_TOP_CHANGED,
31         LISTENER_CMD_AUDIO_CHECKED,
32         LISTENER_CMD_DEVICE_AVAILABLE,
33         LISTENER_CMD_DEVICE_OFFLINE,
34         LISTENER_CMD_MAX
35     };
36 
37     virtual void OnSessionCreate(const AVSessionDescriptor& descriptor) = 0;
38 
39     virtual void OnSessionRelease(const AVSessionDescriptor& descriptor) = 0;
40 
41     virtual void OnTopSessionChange(const AVSessionDescriptor& descriptor) = 0;
42 
43     virtual void OnAudioSessionChecked(const int32_t uid) = 0;
44 
45     virtual void OnDeviceAvailable(const OutputDeviceInfo& castOutputDeviceInfo) = 0;
46 
47     virtual void OnDeviceOffline(const std::string& deviceId) = 0;
48 };
49 }
50 #endif // OHOS_ISESSION_LISTENER_H
51