ZegoLiveRoom
AVDefines.h
Go to the documentation of this file.
1//
2// AVDefine.h
3// zegoliveroom
4//
5
6#ifndef AVDefine_h
7#define AVDefine_h
8
9#include "zego-api-defines.h"
10
11#if defined(__APPLE__)
12#include <TargetConditionals.h>
13#endif
14
15#ifndef ZegoAVCallback_h
16namespace ZEGO
17{
18 namespace AV
19 {
21 {
22 public:
35 virtual void OnAudioRecordCallback(const unsigned char *pData, int data_len, int sample_rate, int num_channels, int bit_depth, unsigned int type) {}
36
42 virtual void OnAudioRecordCallback(const unsigned char *pData, int data_len, int sample_rate, int num_channels, int bit_depth) {}
43 };
44
46 {
47 public:
54 virtual void OnAVKitEvent(int event, EventInfo* pInfo) = 0;
55
62 virtual void OnStreamEvent(ZegoStreamEventType event, const char *streamID, ZegoStreamEventExtraInfo* extraInfo) {};
63 };
64
66 {
67 public:
68#if defined(_WIN32) || TARGET_OS_OSX || defined(LINUX)
76 virtual void OnAudioDeviceStateChanged(AudioDeviceType deviceType, DeviceInfo *deviceInfo, DeviceState state) = 0;
77
84 virtual void OnVideoDeviceStateChanged(DeviceInfo *deviceInfo, DeviceState state) {}
85
95 virtual void OnAudioVolumeChanged(AudioDeviceType deviceType, const char *deviceId, VolumeType volumeType, unsigned int volume, bool bMuted) {}
96
103 virtual void OnAudioDefaultDeviceStateChanged(AudioDeviceType deviceType, const char* deviceId) {}
104#endif
112 virtual void OnDeviceError(const char* deviceName, int errorCode) {}
113
122 virtual void OnDeviceError(const char* deviceName, int errorCode, const char* deviceID) {}
123
124#if defined(_WIN32)
130 virtual void OnRetryDevice(const char* deviceName,const char* deviceID) {}
131#endif
132 };
133
134#if TARGET_OS_IPHONE || defined(ANDROID) || defined(_OS_OHOS_)
135 class IZegoAudioRouteCallback
136 {
137 public:
138 virtual ~IZegoAudioRouteCallback(){}
139
142 virtual void OnAudioRouteChange(ZegoAudioRoute audioRoute) = 0;
143 };
144#endif
145
147 {
148 public:
150
153 virtual void OnNetTypeChange(ZEGONetType netType) = 0;
154 };
155
156
161 {
162 public:
163
170 virtual void OnSendRealtimeSequentialData(int seq, int errorCode) {}
171
180 virtual void OnRecvRealtimeSequentialData(const unsigned char* userData, int dataLen, const char* streamID) = 0;
181 };
182
187 {
188 public:
189
196
203 };
204
209 public:
213 virtual void OnRequestDumpData() = 0;
214
218 virtual void OnRequestUploadDumpData(const char *dump_dir, bool take_photo) = 0;
219
225 virtual void OnStartDumpData(int error) = 0;
226
230 virtual void OnStopDumpData(int error, const char* dump_dir) = 0;
231
237 virtual void OnUploadDumpData(int error) = 0;
238 };
239
241 public:
250 virtual void OnPcmAudioData(const unsigned char *data, int len, int sampaleRate,
251 int channel) = 0;
252 };
253
254 }//namespace AV
255}//namespace ZEGO
256
257#endif // ZegoAVCallback_h
258
259#endif /* AVDefine_h */
Definition: AVDefines.h:21
virtual void OnAudioRecordCallback(const unsigned char *pData, int data_len, int sample_rate, int num_channels, int bit_depth, unsigned int type)
Definition: AVDefines.h:35
virtual void OnAudioRecordCallback(const unsigned char *pData, int data_len, int sample_rate, int num_channels, int bit_depth)
Definition: AVDefines.h:42
Definition: AVDefines.h:240
virtual void OnPcmAudioData(const unsigned char *data, int len, int sampaleRate, int channel)=0
音频前处理前的 PCM 格式音频数据
Definition: AVDefines.h:187
virtual void OnCapturedAudioVADStateUpdate(AudioVADType state)=0
virtual void OnAudioPrepVADStateUpdate(AudioVADType state)=0
Definition: AVDefines.h:66
virtual void OnDeviceError(const char *deviceName, int errorCode)
Definition: AVDefines.h:112
virtual void OnDeviceError(const char *deviceName, int errorCode, const char *deviceID)
Definition: AVDefines.h:122
Definition: AVDefines.h:208
virtual void OnRequestDumpData()=0
virtual void OnStartDumpData(int error)=0
virtual void OnStopDumpData(int error, const char *dump_dir)=0
virtual void OnRequestUploadDumpData(const char *dump_dir, bool take_photo)=0
virtual void OnUploadDumpData(int error)=0
Definition: AVDefines.h:46
virtual void OnAVKitEvent(int event, EventInfo *pInfo)=0
virtual void OnStreamEvent(ZegoStreamEventType event, const char *streamID, ZegoStreamEventExtraInfo *extraInfo)
Definition: AVDefines.h:62
Definition: AVDefines.h:147
virtual void OnNetTypeChange(ZEGONetType netType)=0
网络类型发生变化的回调
virtual ~IZegoNetTypeCallback()
Definition: AVDefines.h:149
virtual void OnSendRealtimeSequentialData(int seq, int errorCode)
Definition: AVDefines.h:170
virtual void OnRecvRealtimeSequentialData(const unsigned char *userData, int dataLen, const char *streamID)=0
ZegoStreamEventType
Definition: zego-api-defines.h:638
DeviceState
Definition: zego-api-defines.h:145
ZEGONetType
Definition: zego-api-defines.h:257
ZegoAudioRoute
Definition: zego-api-defines.h:1211
VolumeType
Definition: zego-api-defines.h:157
AudioDeviceType
Definition: zego-api-defines.h:111
AudioVADType
Definition: zego-api-defines.h:1359
Definition: AVDefines.h:17
Definition: zego-api-defines.h:122
Definition: zego-api-defines.h:594
Definition: zego-api-defines.h:678