├── .gitattributes
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README_zh.md
├── android
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── libs
│ ├── VERSION.txt
│ ├── ZegoLiveRoom.jar
│ ├── arm64-v8a
│ │ ├── include
│ │ │ ├── audio_capture.h
│ │ │ ├── audio_in_output.h
│ │ │ ├── media_player.h
│ │ │ ├── video_capture.h
│ │ │ ├── video_format.h
│ │ │ └── zego-api-sdk-property.h
│ │ └── libZegoLiveRoom.so
│ ├── armeabi-v7a
│ │ ├── include
│ │ │ ├── audio_capture.h
│ │ │ ├── audio_in_output.h
│ │ │ ├── media_player.h
│ │ │ ├── video_capture.h
│ │ │ ├── video_format.h
│ │ │ └── zego-api-sdk-property.h
│ │ └── libZegoLiveRoom.so
│ ├── x86
│ │ ├── include
│ │ │ ├── audio_capture.h
│ │ │ ├── audio_in_output.h
│ │ │ ├── media_player.h
│ │ │ ├── video_capture.h
│ │ │ ├── video_format.h
│ │ │ └── zego-api-sdk-property.h
│ │ └── libZegoLiveRoom.so
│ └── x86_64
│ │ ├── include
│ │ ├── audio_capture.h
│ │ ├── audio_in_output.h
│ │ ├── media_player.h
│ │ ├── video_capture.h
│ │ ├── video_format.h
│ │ └── zego-api-sdk-property.h
│ │ └── libZegoLiveRoom.so
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ └── zego_log_jni.cpp
│ └── java
│ └── com
│ └── zego
│ └── zegoliveroomplugin
│ ├── ZegoLiveRoomPlugin.java
│ ├── ZegoLogJNI.java
│ ├── ZegoPlatformView.java
│ ├── ZegoPlatformViewFactory.java
│ ├── ZegoViewRenderer.java
│ ├── constants
│ └── ZegoEventType.java
│ ├── module
│ ├── audioplayer
│ │ ├── IZegoAudioPlayerControllerCallback.java
│ │ └── ZegoAudioPlayerController.java
│ └── mediaplayer
│ │ ├── IZegoMediaPlayerControllerCallback.java
│ │ └── ZegoMediaPlayerController.java
│ └── utils
│ └── ZegoFileHelper.java
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── app
│ │ ├── .settings
│ │ │ └── org.eclipse.buildship.core.prefs
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── zego
│ │ │ │ │ ├── ExternalVideoFilter
│ │ │ │ │ ├── VideoFilter
│ │ │ │ │ │ ├── VideoFilterAsyncI420MemDemo.java
│ │ │ │ │ │ ├── VideoFilterHybridDemo.java
│ │ │ │ │ │ ├── VideoFilterMemDemo.java
│ │ │ │ │ │ ├── VideoFilterSurfaceTextureDemo.java
│ │ │ │ │ │ └── VideoFilterSyncGlTexture2dDemo.java
│ │ │ │ │ ├── VideoFilterFactoryDemo.java
│ │ │ │ │ └── ve_gl
│ │ │ │ │ │ ├── EglBase.java
│ │ │ │ │ │ ├── EglBase10.java
│ │ │ │ │ │ ├── EglBase14.java
│ │ │ │ │ │ ├── GlRectDrawer.java
│ │ │ │ │ │ ├── GlShader.java
│ │ │ │ │ │ └── GlUtil.java
│ │ │ │ │ ├── externalvideocapture
│ │ │ │ │ ├── MediaPlayerVideoCapture.java
│ │ │ │ │ └── VideoCaptureFactory.java
│ │ │ │ │ └── flutter
│ │ │ │ │ └── example
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MyApplication.java
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── ios
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ ├── Flutter.podspec
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── ExternalVideoCapture
│ │ ├── ZGExternalVideoCaptureFactory.h
│ │ ├── ZGExternalVideoCaptureFactory.m
│ │ ├── ZGVideoCaptureForMediaPlayer.h
│ │ └── ZGVideoCaptureForMediaPlayer.mm
│ │ ├── ExternalVideoFilter
│ │ ├── VideoFilter
│ │ │ ├── ZGVideoFilterAsyncDemo.h
│ │ │ ├── ZGVideoFilterAsyncDemo.m
│ │ │ ├── ZGVideoFilterSyncDemo.h
│ │ │ └── ZGVideoFilterSyncDemo.m
│ │ ├── ZGPixelBufferUtils.h
│ │ ├── ZGPixelBufferUtils.m
│ │ ├── ZGVideoFilterFactoryDemo.h
│ │ └── ZGVideoFilterFactoryDemo.m
│ │ ├── Info.plist
│ │ └── main.m
├── lib
│ ├── config
│ │ └── zego_config.dart
│ ├── main.dart
│ ├── pages
│ │ ├── init_sdk_page.dart
│ │ ├── login_room_page.dart
│ │ ├── mediaplayer_page.dart
│ │ ├── play_stream_page.dart
│ │ ├── play_stream_platformview_page.dart
│ │ ├── publish_settings_page.dart
│ │ ├── publish_stream_page.dart
│ │ └── publish_stream_platformview_page.dart
│ └── ui
│ │ └── zego_ui_tool.dart
├── pubspec.yaml
├── resources
│ └── images
│ │ ├── 2.0x
│ │ ├── bottom_microphone_off_icon.png
│ │ ├── bottom_microphone_on_icon.png
│ │ ├── bottom_switchcamera_icon.png
│ │ └── settings_tips.png
│ │ ├── 3.0x
│ │ ├── bottom_microphone_off_icon.png
│ │ ├── bottom_microphone_on_icon.png
│ │ ├── bottom_switchcamera_icon.png
│ │ └── settings_tips.png
│ │ ├── bottom_microphone_off_icon.png
│ │ ├── bottom_microphone_on_icon.png
│ │ ├── bottom_switchcamera_icon.png
│ │ └── settings_tips.png
└── test
│ └── widget_test.dart
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── ZegoAudioPlayerController.h
│ ├── ZegoAudioPlayerController.mm
│ ├── ZegoLiveRoomPlugin.h
│ ├── ZegoLiveRoomPlugin.mm
│ ├── ZegoLog.h
│ ├── ZegoLog.m
│ ├── ZegoMediaplayerController.h
│ ├── ZegoMediaplayerController.mm
│ ├── ZegoPlatformView.h
│ ├── ZegoPlatformView.m
│ ├── ZegoPlatformViewFactory.h
│ ├── ZegoPlatformViewFactory.m
│ ├── ZegoRendererController.h
│ ├── ZegoRendererController.mm
│ ├── ZegoViewRenderer.h
│ └── ZegoViewRenderer.mm
└── zegoliveroom_plugin.podspec
├── lib
├── src
│ ├── zego_api_defines.dart
│ ├── zego_api_error_code.dart
│ ├── zego_audioplayer.dart
│ ├── zego_liveroom.dart
│ ├── zego_liveroom_audio.dart
│ ├── zego_liveroom_event_channel.dart
│ ├── zego_liveroom_player.dart
│ ├── zego_liveroom_publisher.dart
│ ├── zego_media_recorder.dart
│ ├── zego_media_side_info.dart
│ ├── zego_mediaplayer.dart
│ └── zego_sound_level.dart
└── zegoliveroom_plugin.dart
├── pubspec.yaml
├── zego_defines.h
├── zegoliveroom_plugin.iml
└── zegoliveroom_plugin_android.iml
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.m linguist-language=Dart
2 | *.mm linguist-language=Dart
3 | *.java linguist-language=Dart
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # pub
2 | .dart_tool/
3 | .packages
4 | build/
5 | pubspec.lock
6 |
7 | # api doc
8 | doc/api/
9 |
10 | # IntelliJ
11 | *.iml
12 | *.ipr
13 | *.iws
14 | .idea/
15 |
16 | .settings
17 | .project
18 | .classpath
19 | .flutter-plugins-dependencies
20 | flutter_export_environment.sh
21 |
22 | # mac
23 | .DS_Store
24 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change log
2 |
3 | ## ⚠️❗️ This project is a **legacy** SDK and and will be deprecated in the future, only used to support the maintenance for existing users, it is recommended to migrate and upgrade to the new SDK as soon as possible
4 |
5 | ## **🚀 Please use the brand new [`ZegoExpressEngine Flutter SDK`](https://pub.dev/packages/zego_express_engine)**
6 |
7 | ## 1.7.0
8 | 1. Support max 4 mediaplayers
9 |
10 | ## 1.5.1
11 |
12 | 1. Add some MediaPlayer API and `setCaptureVolume` API
13 |
14 | ## 1.5.0
15 |
16 | 1. Add feature of MediaPlayer Rendering and publishing
17 |
18 | ## 1.4.0
19 |
20 | 1. Optimization: Limit iOS memory allocation to avoid the problem of untimely memory release in some versions of flutter
21 | 2. Update Native SDK to 1.21.3.18
22 |
23 | ## 1.3.6
24 |
25 | 1. Update Native SDK to 1.21.1.27
26 |
27 | ## 1.3.5
28 |
29 | 1. Update Native SDK to 1.21.1.16
30 |
31 | ## 1.3.4
32 |
33 | 1. Add [`takePublishStreamSnapshot`](https://pub.dev/documentation/zegoliveroom_plugin/latest/zegoliveroom_plugin/ZegoLiveRoomPublisherPlugin/takePublishStreamSnapshot.html) and [`takePlayStreamSnapshot`](https://pub.dev/documentation/zegoliveroom_plugin/latest/zegoliveroom_plugin/ZegoLiveRoomPlayerPlugin/takePlayStreamSnapshot.html) APIs
34 |
35 | ## 1.3.3
36 |
37 | 1. update native sdk.
38 |
39 | 2. add `setPlayVolume` API.
40 |
41 | ## 1.3.2
42 |
43 | 1. update native ios sdk.
44 |
45 | ## 1.3.1
46 |
47 | 1. update native sdk.
48 | 2. fix `onPublishStateUpdate` streamInfo is sometimes null.
49 |
50 | ## 1.3.0
51 |
52 | 1. update native sdk(2020.10.15).
53 | 2. add `switchRoom` API.
54 |
55 | ## 1.2.18
56 |
57 | 1. Update project configuration and README
58 | 2. Fix a crash in Android example demo
59 |
60 | ## 1.2.17
61 |
62 | 1. Fix problem with `setLogConfig` not working
63 |
64 | ## 1.2.16
65 |
66 | 1. fix crash when multi thread read/write the input CVPixelBuffer
67 |
68 | ## 1.2.15
69 |
70 | 1. fix the input CVPixelBuffer lifecycle issue.
71 |
72 | ## 1.2.14
73 |
74 | 1. fix CVPixelBuffer release crash.
75 |
76 | ## 1.2.13
77 |
78 | 1. add `setLogConfig` to set log path and log size
79 | 2. add `onDeviceError` for Notifying device abnormalities
80 | 3. add MediaPlayer module new API(for playing network sources): `setOnlineResourceCache`、`getOnlineResourceCache`、`setBufferThreshold`、`setLoadResourceTimeout`
81 |
82 | ## 1.2.12
83 |
84 | 1. add `MediaPlayer`(only audio module)
85 |
86 | ## 1.2.11
87 |
88 | 1. Update iOS native SDK to version `200424_175024_release-new-0-gb8ff47533_video_mediaplayer_bn3845_12`
89 |
90 | 2. Update Android native SDK to version `200424_175024_release-new-0-gb8ff47533_video_mediaplayer_bn3845_12`
91 |
92 | ## 1.2.10
93 |
94 | - Add `setCamZoomFactor`, `getCamMaxZoomFactor` to adjust the camera zoom factor.
95 |
96 | ## 1.2.9
97 |
98 | 1. Add `sendBigRoomMessage`, `onRecvBigRoomMessage` to send and receive big room messages.
99 |
100 | 2. Add `onUpdateOnlineCount` callback to received online user number updates.
101 |
102 | ## 1.2.8
103 |
104 | 1. Update iOS native SDK to version `200415_195052_release-new-0-g18e243156_video_mediaplayer_bn3792_12`
105 |
106 | 2. Update Android native SDK to version `200410_212545_release-new-0-g18e243156_video_mediaplayer_bn3760_12`
107 |
108 | ## 1.2.7
109 |
110 | 1. Add log for texture render.
111 |
112 | 2. Optimize the code when calling `updatePreviewRenderSize` and `updatePlayRenderSize`
113 |
114 | ## 1.2.6
115 |
116 | 1. Added `setConfig` for setting additional configuration information.
117 |
118 | 2. Update iOS/Android native SDK to version `200316_163753_release-new-0-gb76c836cd_video_mediaplayer_bn3590_12`
119 |
120 | ## 1.2.5
121 |
122 | 1. Update ios/android native sdk to version `200309_200607_release-new-0-g54f488a0c_video_mediaplayer_bn3549_12`
123 |
124 | 2. Fix bug of external filter module on Android.
125 |
126 | ## 1.2.4
127 |
128 | - Add external video filter interface and corresponding sample code.
129 |
130 | ## 1.2.3
131 |
132 | - Add `setSharpenFactor` to set the sharpening factor for beauty.
133 |
134 | ## 1.2.2
135 |
136 | - Add `sendRoomMessage`, `onRecvRoomMessage` to send and receive room messages.
137 |
138 | ## 1.2.1
139 |
140 | - Update android native sdk.
141 |
142 | ## 1.2.0
143 |
144 | 1. Add `seekTo` `getTotalDuration` `getCurrentDuration` in AudioPlayer.
145 |
146 | 2. Add `enableLoopback` `setLoopbackVolume` to listen captured voice.
147 |
148 | ## 1.1.9
149 |
150 | - Update iOS/Android native sdk (2020.2.9 hotfix)
151 |
152 | ## 1.1.8
153 |
154 | - Update iOS/Android native sdk (2020.2.9)
155 |
156 | ## 1.1.7
157 |
158 | - Fix bug of init page in example.
159 |
160 | ## 1.1.6
161 |
162 | 1. This new version is compatible with AndroidX.
163 |
164 | 2. Fix the Android example crash in release mode because of the obfuscation.
165 |
166 | ## 1.1.5
167 |
168 | - Fix iOS: use platform view render failed.
169 |
170 | ## 1.1.4
171 |
172 | - Fix AudioPlayer bug.
173 |
174 | ## 1.1.3
175 |
176 | - Add Audio Precessing API: `VirtualStereo`, `Reverb`, `VoiceChanger`
177 |
178 | ## 1.1.2
179 |
180 | 1. Fix iOS callback doesn’t work when call `initSDK` failed
181 |
182 | 2. iOS native framework uses cocoapods dependency instead
183 |
184 | ## 1.1.1
185 |
186 | 1. Add audio player module
187 |
188 | 2. Update texture's API comment
189 |
190 | ## 1.0.12
191 |
192 | - Update iOS/Android native sdk (12.9)
193 |
194 | ## 1.0.11
195 |
196 | 1. Add onInnerError
197 |
198 | 2. Update iOS/Android native sdk
199 |
200 | ## 1.0.10
201 |
202 | 1. Add relay CDN methods: `setPublishConfig`, `addPublishTarget`, `deletePublishTarget`, and callback: `onRelayCDNStateUpdate`
203 |
204 | 2. Fix bug that xcode11 can't run in debug mode
205 |
206 | 3. Update iOS/Android native sdk
207 |
208 | ## 1.0.9
209 |
210 | - Fix the problem that Android can't receive media sideinfo callback
211 |
212 | ## 1.0.8
213 |
214 | 1. Add setVideoMirrorMode API
215 |
216 | 2. Update iOS/Android native sdk
217 |
218 | ## 1.0.7
219 |
220 | 1. Fix android texture render crash into background
221 |
222 | 2. Fix android startPlayingStream bugs
223 |
224 | 3. Update android native sdk
225 |
226 | ## 1.0.6
227 |
228 | 1. Fix some bug and crash
229 |
230 | 2. Add log system
231 |
232 | ## 1.0.5
233 |
234 | 1. Add peer to peer delay/package lost rate.
235 |
236 | 2. Add remote user's device state notification(on/off)
237 |
238 | 3. Add remote user's first frame notification
239 |
240 | 4. Update native sdk
241 |
242 | 5. promote stability
243 |
244 | ## 1.0.4
245 |
246 | 1. Add sound-level module
247 |
248 | 2. Add error-code module
249 |
250 | 3. Update native sdk
251 |
252 | ## 1.0.3
253 |
254 | - Add Platform View API
255 |
256 | ## 1.0.2
257 |
258 | 1. Update native sdk
259 |
260 | 2. Fix crash
261 |
262 | 3. Refactor api structure
263 |
264 | ## 1.0.1
265 |
266 | - Add format interface
267 |
268 | ## 1.0.0
269 |
270 | - Initial release
271 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 2-Clause License
2 |
3 | Copyright (c) 2019, zegoim
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # zegoliveroom_plugin **(Deprecated)**
2 |
3 | 
4 | [](https://pub.dartlang.org/packages/zegoliveroom_plugin)
5 |
6 | **[English](https://github.com/zegoim/zego-flutter-sdk/blob/master/README.md) | [中文](https://github.com/zegoim/zego-flutter-sdk/blob/master/README_zh.md)**
7 |
8 | Zego's audio and video LiveRoom Flutter SDK **(Deprecated)**, provides live video and real-time audio and video services.
9 |
10 | Learn more about the solution: [https://www.zego.im](https://www.zego.im)
11 |
12 | ## ⚠️❗️ This project is a **deprecated** SDK, only used to support the maintenance for existing users, it is recommended to migrate and upgrade to the new SDK as soon as possible
13 |
14 | ## **🚀 Please use the brand new [`ZegoExpressEngine Flutter SDK`](https://pub.dev/packages/zego_express_engine)**
15 |
16 | - pub: **[https://pub.dev/packages/zego_express_engine](https://pub.dev/packages/zego_express_engine)**
17 |
18 | - Github: **[https://github.com/zegoim/zego-express-flutter-sdk](https://github.com/zegoim/zego-express-flutter-sdk)**
19 |
20 | - Documents: **[https://doc-en.zego.im/en/5560.html](https://doc-en.zego.im/en/5560.html)**
21 |
22 | > 🌞 The new redesigned API is easier to use, updated in sync with the ZEGO native SDK, and has more complete functions!
23 |
--------------------------------------------------------------------------------
/README_zh.md:
--------------------------------------------------------------------------------
1 | # zegoliveroom_plugin **(Deprecated)**
2 |
3 | 
4 | [](https://pub.dartlang.org/packages/zegoliveroom_plugin)
5 |
6 | **[English](https://github.com/zegoim/zego-flutter-sdk/blob/master/README.md) | [中文](https://github.com/zegoim/zego-flutter-sdk/blob/master/README_zh.md)**
7 |
8 | 即构科技(Zego)音视频 LiveRoom Flutter SDK **(已废弃)** ,提供视频直播以及实时音视频服务。
9 |
10 | 了解更多解决方案:[https://www.zego.im](https://www.zego.im)
11 |
12 | ## ⚠️❗️ 此项目为 **旧版** SDK,仅用于支持老用户维护使用,建议尽快迁移升级到新版 SDK
13 |
14 | ## **🚀 请使用新版 [`ZegoExpressEngine Flutter SDK`](https://pub.dev/packages/zego_express_engine)**
15 |
16 | - pub: **[https://pub.dev/packages/zego_express_engine](https://pub.dev/packages/zego_express_engine)**
17 |
18 | - Github: **[https://github.com/zegoim/zego-express-flutter-sdk](https://github.com/zegoim/zego-express-flutter-sdk)**
19 |
20 | - 官方文档: **[https://doc-zh.zego.im/zh/5424.html](https://doc-zh.zego.im/zh/5424.html)**
21 |
22 | > 🌞 经过重新设计的全新 API 更易于接入使用,与 ZEGO 原生 SDK 同步更新,功能更加齐全!
23 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /bin
9 | /captures
10 | .externalNativeBuild
11 | .classpath
12 | .settings
13 | .project
14 | .cxx
15 |
--------------------------------------------------------------------------------
/android/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | cmake_minimum_required(VERSION 3.4.1)
3 |
4 | add_library( # Sets the name of the library.
5 | ZegoLog
6 |
7 | # Sets the library as a shared library.
8 | SHARED
9 |
10 | # Provides a relative path to your source file(s).
11 | src/main/cpp/zego_log_jni.cpp)
12 |
13 | add_library(
14 | ZegoLiveRoom
15 | SHARED
16 | IMPORTED
17 | )
18 |
19 | set_target_properties(ZegoLiveRoom
20 | PROPERTIES IMPORTED_LOCATION
21 | ${CMAKE_CURRENT_LIST_DIR}/libs/${ANDROID_ABI}/libZegoLiveRoom.so
22 | )
23 |
24 | target_link_libraries( # Specifies the target library.
25 |
26 | ZegoLog
27 | ZegoLiveRoom
28 | )
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.zego.zegoliveroomplugin'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | repositories {
6 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
7 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
8 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
9 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
10 | google()
11 | jcenter()
12 |
13 | }
14 |
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:4.2.1'
17 | }
18 | }
19 |
20 | rootProject.allprojects {
21 | repositories {
22 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
23 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
24 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
25 | maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
26 | google()
27 | jcenter()
28 |
29 | }
30 | }
31 |
32 | apply plugin: 'com.android.library'
33 |
34 | android {
35 | compileSdkVersion 28
36 |
37 | defaultConfig {
38 | minSdkVersion 16
39 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
40 | externalNativeBuild {
41 | cmake {
42 | cppFlags "-std=c++11"
43 | }
44 | }
45 | ndk {
46 | //设置支持的SO库架构
47 | abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86'
48 | }
49 | }
50 |
51 | lintOptions {
52 | disable 'InvalidPackage'
53 | }
54 |
55 | compileOptions {
56 | targetCompatibility JavaVersion.VERSION_1_8
57 | sourceCompatibility JavaVersion.VERSION_1_8
58 | }
59 | /*sourceSets {
60 | main {
61 | jniLibs.srcDirs = ['libs']
62 | }
63 | }*/
64 |
65 | externalNativeBuild {
66 | cmake {
67 | path "CMakeLists.txt"
68 | }
69 | }
70 | }
71 |
72 | dependencies {
73 | api fileTree(dir: 'libs', include: ['*.jar'])
74 | }
75 |
76 | allprojects {
77 | gradle.projectsEvaluated {
78 | tasks.withType(JavaCompile) {
79 | options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Nov 15 12:41:02 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/android/libs/VERSION.txt:
--------------------------------------------------------------------------------
1 | 6.16.2.25372
2 | ZegoLiveRoom
3 | COMMON_BUILD_VIDEO=true
--------------------------------------------------------------------------------
/android/libs/ZegoLiveRoom.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/libs/ZegoLiveRoom.jar
--------------------------------------------------------------------------------
/android/libs/arm64-v8a/include/audio_capture.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOAudioCapture_h
2 | #define ZEGOAudioCapture_h
3 |
4 | namespace AVE {
5 | enum AudioBufferType {
6 | BufferTypeAudioApp = 0,
7 | BufferTypeAudioMic,
8 | };
9 |
10 | struct AudioCaptureFormat {
11 | AudioCaptureFormat() : sample_rate(0), num_channels(0), bit_depth(0), is_big_endian(false) {
12 | }
13 |
14 | int sample_rate;
15 | int num_channels;
16 | int bit_depth;
17 | bool is_big_endian;
18 | };
19 |
20 | class SupportsAudioCapture {
21 | public:
22 |
23 | };
24 |
25 | class AudioCaptureCallback {
26 | public:
27 | virtual void OnCapturedAudioData(const char *pData, int data_len,
28 | const AudioCaptureFormat& format,
29 | AudioBufferType buffer_type,
30 | double timestamp_ms) = 0;
31 | virtual void SetMicVolume(int volume) = 0;
32 | virtual void SetAppVolume(int volume) = 0;
33 | };
34 | }
35 | #endif /* ZEGOAudioCapture_h */
36 |
--------------------------------------------------------------------------------
/android/libs/arm64-v8a/include/video_format.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOVideoFormat_h
2 | #define ZEGOVideoFormat_h
3 |
4 | namespace AVE
5 | {
6 | enum VideoPixelFormat
7 | {
8 | PIXEL_FORMAT_UNKNOWN = 0,
9 | PIXEL_FORMAT_I420 = 1,
10 | PIXEL_FORMAT_NV12 = 2,
11 | PIXEL_FORMAT_NV21 = 3,
12 | PIXEL_FORMAT_BGRA32 = 4,
13 | PIXEL_FORMAT_RGBA32 = 5,
14 | PIXEL_FORMAT_ARGB32 = 6,
15 | PIXEL_FORMAT_ABGR32 = 7,
16 | PIXEL_FORMAT_I422 = 8,
17 | PIXEL_FORMAT_AVC_AVCC = 9,
18 | PIXEL_FORMAT_AVC_ANNEXB = 10,
19 | PIXEL_FORMAT_YUY2 = 11,
20 | PIXEL_FORMAT_UYVY = 12,
21 | };
22 |
23 | struct VideoDataFormat
24 | {
25 | VideoDataFormat()
26 | {
27 | width = 0;
28 | height = 0;
29 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
30 | rotation = 0;
31 | pixel_format = PIXEL_FORMAT_UNKNOWN;
32 | }
33 |
34 | VideoDataFormat(int width, int height, VideoPixelFormat pixel_format)
35 | {
36 | this->width = width;
37 | this->height = height;
38 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
39 | rotation = 0;
40 | this->pixel_format = pixel_format;
41 | }
42 |
43 | bool operator==(const VideoDataFormat& other)
44 | {
45 | return (width == other.width && height == other.height &&
46 | strides[0] == other.strides[0] && strides[1] == other.strides[1] &&
47 | strides[2] == other.strides[2] && strides[3] == other.strides[3] &&
48 | rotation == other.rotation && pixel_format == other.pixel_format);
49 | }
50 |
51 | bool operator!=(const VideoDataFormat& other)
52 | {
53 | return !(*this == other);
54 | }
55 |
56 | int width;
57 | int height;
58 | int strides[4];
59 | int rotation;
60 | VideoPixelFormat pixel_format;
61 | };
62 | }
63 | #endif /* ZEGOVideoFormat_h */
64 |
--------------------------------------------------------------------------------
/android/libs/arm64-v8a/include/zego-api-sdk-property.h:
--------------------------------------------------------------------------------
1 | #ifndef zego_api_sdk_property_h
2 | #define zego_api_sdk_property_h
3 |
4 | /// SDK version
5 | #define ZEGO_SDK_VERSION "6.16.2.25372-stable-221115-214357-49d0aee6dd"
6 | #define ZEGO_SDK_SEMANTIC_VERSION "6.16.2.25372"
7 | #define ZEGO_SDK_PROJECT "ZegoLiveRoom"
8 |
9 | /// Git repository commit revision
10 | #define ZEGO_SDK_EXPRESS_COMMIT_REVISION "5ac6360ac3"
11 | #define ZEGO_SDK_LIVEROOM_COMMIT_REVISION "49d0aee6dd"
12 | #define ZEGO_SDK_CONNECTION_COMMIT_REVISION "7901c1c178"
13 |
14 | #endif // zego_api_sdk_property_h
15 |
--------------------------------------------------------------------------------
/android/libs/arm64-v8a/libZegoLiveRoom.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/libs/arm64-v8a/libZegoLiveRoom.so
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/include/audio_capture.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOAudioCapture_h
2 | #define ZEGOAudioCapture_h
3 |
4 | namespace AVE {
5 | enum AudioBufferType {
6 | BufferTypeAudioApp = 0,
7 | BufferTypeAudioMic,
8 | };
9 |
10 | struct AudioCaptureFormat {
11 | AudioCaptureFormat() : sample_rate(0), num_channels(0), bit_depth(0), is_big_endian(false) {
12 | }
13 |
14 | int sample_rate;
15 | int num_channels;
16 | int bit_depth;
17 | bool is_big_endian;
18 | };
19 |
20 | class SupportsAudioCapture {
21 | public:
22 |
23 | };
24 |
25 | class AudioCaptureCallback {
26 | public:
27 | virtual void OnCapturedAudioData(const char *pData, int data_len,
28 | const AudioCaptureFormat& format,
29 | AudioBufferType buffer_type,
30 | double timestamp_ms) = 0;
31 | virtual void SetMicVolume(int volume) = 0;
32 | virtual void SetAppVolume(int volume) = 0;
33 | };
34 | }
35 | #endif /* ZEGOAudioCapture_h */
36 |
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/include/video_format.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOVideoFormat_h
2 | #define ZEGOVideoFormat_h
3 |
4 | namespace AVE
5 | {
6 | enum VideoPixelFormat
7 | {
8 | PIXEL_FORMAT_UNKNOWN = 0,
9 | PIXEL_FORMAT_I420 = 1,
10 | PIXEL_FORMAT_NV12 = 2,
11 | PIXEL_FORMAT_NV21 = 3,
12 | PIXEL_FORMAT_BGRA32 = 4,
13 | PIXEL_FORMAT_RGBA32 = 5,
14 | PIXEL_FORMAT_ARGB32 = 6,
15 | PIXEL_FORMAT_ABGR32 = 7,
16 | PIXEL_FORMAT_I422 = 8,
17 | PIXEL_FORMAT_AVC_AVCC = 9,
18 | PIXEL_FORMAT_AVC_ANNEXB = 10,
19 | PIXEL_FORMAT_YUY2 = 11,
20 | PIXEL_FORMAT_UYVY = 12,
21 | };
22 |
23 | struct VideoDataFormat
24 | {
25 | VideoDataFormat()
26 | {
27 | width = 0;
28 | height = 0;
29 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
30 | rotation = 0;
31 | pixel_format = PIXEL_FORMAT_UNKNOWN;
32 | }
33 |
34 | VideoDataFormat(int width, int height, VideoPixelFormat pixel_format)
35 | {
36 | this->width = width;
37 | this->height = height;
38 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
39 | rotation = 0;
40 | this->pixel_format = pixel_format;
41 | }
42 |
43 | bool operator==(const VideoDataFormat& other)
44 | {
45 | return (width == other.width && height == other.height &&
46 | strides[0] == other.strides[0] && strides[1] == other.strides[1] &&
47 | strides[2] == other.strides[2] && strides[3] == other.strides[3] &&
48 | rotation == other.rotation && pixel_format == other.pixel_format);
49 | }
50 |
51 | bool operator!=(const VideoDataFormat& other)
52 | {
53 | return !(*this == other);
54 | }
55 |
56 | int width;
57 | int height;
58 | int strides[4];
59 | int rotation;
60 | VideoPixelFormat pixel_format;
61 | };
62 | }
63 | #endif /* ZEGOVideoFormat_h */
64 |
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/include/zego-api-sdk-property.h:
--------------------------------------------------------------------------------
1 | #ifndef zego_api_sdk_property_h
2 | #define zego_api_sdk_property_h
3 |
4 | /// SDK version
5 | #define ZEGO_SDK_VERSION "6.16.2.25372-stable-221115-214357-49d0aee6dd"
6 | #define ZEGO_SDK_SEMANTIC_VERSION "6.16.2.25372"
7 | #define ZEGO_SDK_PROJECT "ZegoLiveRoom"
8 |
9 | /// Git repository commit revision
10 | #define ZEGO_SDK_EXPRESS_COMMIT_REVISION "5ac6360ac3"
11 | #define ZEGO_SDK_LIVEROOM_COMMIT_REVISION "49d0aee6dd"
12 | #define ZEGO_SDK_CONNECTION_COMMIT_REVISION "7901c1c178"
13 |
14 | #endif // zego_api_sdk_property_h
15 |
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/libZegoLiveRoom.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/libs/armeabi-v7a/libZegoLiveRoom.so
--------------------------------------------------------------------------------
/android/libs/x86/include/audio_capture.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOAudioCapture_h
2 | #define ZEGOAudioCapture_h
3 |
4 | namespace AVE {
5 | enum AudioBufferType {
6 | BufferTypeAudioApp = 0,
7 | BufferTypeAudioMic,
8 | };
9 |
10 | struct AudioCaptureFormat {
11 | AudioCaptureFormat() : sample_rate(0), num_channels(0), bit_depth(0), is_big_endian(false) {
12 | }
13 |
14 | int sample_rate;
15 | int num_channels;
16 | int bit_depth;
17 | bool is_big_endian;
18 | };
19 |
20 | class SupportsAudioCapture {
21 | public:
22 |
23 | };
24 |
25 | class AudioCaptureCallback {
26 | public:
27 | virtual void OnCapturedAudioData(const char *pData, int data_len,
28 | const AudioCaptureFormat& format,
29 | AudioBufferType buffer_type,
30 | double timestamp_ms) = 0;
31 | virtual void SetMicVolume(int volume) = 0;
32 | virtual void SetAppVolume(int volume) = 0;
33 | };
34 | }
35 | #endif /* ZEGOAudioCapture_h */
36 |
--------------------------------------------------------------------------------
/android/libs/x86/include/video_format.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOVideoFormat_h
2 | #define ZEGOVideoFormat_h
3 |
4 | namespace AVE
5 | {
6 | enum VideoPixelFormat
7 | {
8 | PIXEL_FORMAT_UNKNOWN = 0,
9 | PIXEL_FORMAT_I420 = 1,
10 | PIXEL_FORMAT_NV12 = 2,
11 | PIXEL_FORMAT_NV21 = 3,
12 | PIXEL_FORMAT_BGRA32 = 4,
13 | PIXEL_FORMAT_RGBA32 = 5,
14 | PIXEL_FORMAT_ARGB32 = 6,
15 | PIXEL_FORMAT_ABGR32 = 7,
16 | PIXEL_FORMAT_I422 = 8,
17 | PIXEL_FORMAT_AVC_AVCC = 9,
18 | PIXEL_FORMAT_AVC_ANNEXB = 10,
19 | PIXEL_FORMAT_YUY2 = 11,
20 | PIXEL_FORMAT_UYVY = 12,
21 | };
22 |
23 | struct VideoDataFormat
24 | {
25 | VideoDataFormat()
26 | {
27 | width = 0;
28 | height = 0;
29 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
30 | rotation = 0;
31 | pixel_format = PIXEL_FORMAT_UNKNOWN;
32 | }
33 |
34 | VideoDataFormat(int width, int height, VideoPixelFormat pixel_format)
35 | {
36 | this->width = width;
37 | this->height = height;
38 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
39 | rotation = 0;
40 | this->pixel_format = pixel_format;
41 | }
42 |
43 | bool operator==(const VideoDataFormat& other)
44 | {
45 | return (width == other.width && height == other.height &&
46 | strides[0] == other.strides[0] && strides[1] == other.strides[1] &&
47 | strides[2] == other.strides[2] && strides[3] == other.strides[3] &&
48 | rotation == other.rotation && pixel_format == other.pixel_format);
49 | }
50 |
51 | bool operator!=(const VideoDataFormat& other)
52 | {
53 | return !(*this == other);
54 | }
55 |
56 | int width;
57 | int height;
58 | int strides[4];
59 | int rotation;
60 | VideoPixelFormat pixel_format;
61 | };
62 | }
63 | #endif /* ZEGOVideoFormat_h */
64 |
--------------------------------------------------------------------------------
/android/libs/x86/include/zego-api-sdk-property.h:
--------------------------------------------------------------------------------
1 | #ifndef zego_api_sdk_property_h
2 | #define zego_api_sdk_property_h
3 |
4 | /// SDK version
5 | #define ZEGO_SDK_VERSION "6.16.2.25372-stable-221115-214357-49d0aee6dd"
6 | #define ZEGO_SDK_SEMANTIC_VERSION "6.16.2.25372"
7 | #define ZEGO_SDK_PROJECT "ZegoLiveRoom"
8 |
9 | /// Git repository commit revision
10 | #define ZEGO_SDK_EXPRESS_COMMIT_REVISION "5ac6360ac3"
11 | #define ZEGO_SDK_LIVEROOM_COMMIT_REVISION "49d0aee6dd"
12 | #define ZEGO_SDK_CONNECTION_COMMIT_REVISION "7901c1c178"
13 |
14 | #endif // zego_api_sdk_property_h
15 |
--------------------------------------------------------------------------------
/android/libs/x86/libZegoLiveRoom.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/libs/x86/libZegoLiveRoom.so
--------------------------------------------------------------------------------
/android/libs/x86_64/include/audio_capture.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOAudioCapture_h
2 | #define ZEGOAudioCapture_h
3 |
4 | namespace AVE {
5 | enum AudioBufferType {
6 | BufferTypeAudioApp = 0,
7 | BufferTypeAudioMic,
8 | };
9 |
10 | struct AudioCaptureFormat {
11 | AudioCaptureFormat() : sample_rate(0), num_channels(0), bit_depth(0), is_big_endian(false) {
12 | }
13 |
14 | int sample_rate;
15 | int num_channels;
16 | int bit_depth;
17 | bool is_big_endian;
18 | };
19 |
20 | class SupportsAudioCapture {
21 | public:
22 |
23 | };
24 |
25 | class AudioCaptureCallback {
26 | public:
27 | virtual void OnCapturedAudioData(const char *pData, int data_len,
28 | const AudioCaptureFormat& format,
29 | AudioBufferType buffer_type,
30 | double timestamp_ms) = 0;
31 | virtual void SetMicVolume(int volume) = 0;
32 | virtual void SetAppVolume(int volume) = 0;
33 | };
34 | }
35 | #endif /* ZEGOAudioCapture_h */
36 |
--------------------------------------------------------------------------------
/android/libs/x86_64/include/video_format.h:
--------------------------------------------------------------------------------
1 | #ifndef ZEGOVideoFormat_h
2 | #define ZEGOVideoFormat_h
3 |
4 | namespace AVE
5 | {
6 | enum VideoPixelFormat
7 | {
8 | PIXEL_FORMAT_UNKNOWN = 0,
9 | PIXEL_FORMAT_I420 = 1,
10 | PIXEL_FORMAT_NV12 = 2,
11 | PIXEL_FORMAT_NV21 = 3,
12 | PIXEL_FORMAT_BGRA32 = 4,
13 | PIXEL_FORMAT_RGBA32 = 5,
14 | PIXEL_FORMAT_ARGB32 = 6,
15 | PIXEL_FORMAT_ABGR32 = 7,
16 | PIXEL_FORMAT_I422 = 8,
17 | PIXEL_FORMAT_AVC_AVCC = 9,
18 | PIXEL_FORMAT_AVC_ANNEXB = 10,
19 | PIXEL_FORMAT_YUY2 = 11,
20 | PIXEL_FORMAT_UYVY = 12,
21 | };
22 |
23 | struct VideoDataFormat
24 | {
25 | VideoDataFormat()
26 | {
27 | width = 0;
28 | height = 0;
29 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
30 | rotation = 0;
31 | pixel_format = PIXEL_FORMAT_UNKNOWN;
32 | }
33 |
34 | VideoDataFormat(int width, int height, VideoPixelFormat pixel_format)
35 | {
36 | this->width = width;
37 | this->height = height;
38 | strides[0] = strides[1] = strides[2] = strides[3] = 0;
39 | rotation = 0;
40 | this->pixel_format = pixel_format;
41 | }
42 |
43 | bool operator==(const VideoDataFormat& other)
44 | {
45 | return (width == other.width && height == other.height &&
46 | strides[0] == other.strides[0] && strides[1] == other.strides[1] &&
47 | strides[2] == other.strides[2] && strides[3] == other.strides[3] &&
48 | rotation == other.rotation && pixel_format == other.pixel_format);
49 | }
50 |
51 | bool operator!=(const VideoDataFormat& other)
52 | {
53 | return !(*this == other);
54 | }
55 |
56 | int width;
57 | int height;
58 | int strides[4];
59 | int rotation;
60 | VideoPixelFormat pixel_format;
61 | };
62 | }
63 | #endif /* ZEGOVideoFormat_h */
64 |
--------------------------------------------------------------------------------
/android/libs/x86_64/include/zego-api-sdk-property.h:
--------------------------------------------------------------------------------
1 | #ifndef zego_api_sdk_property_h
2 | #define zego_api_sdk_property_h
3 |
4 | /// SDK version
5 | #define ZEGO_SDK_VERSION "6.16.2.25372-stable-221115-214357-49d0aee6dd"
6 | #define ZEGO_SDK_SEMANTIC_VERSION "6.16.2.25372"
7 | #define ZEGO_SDK_PROJECT "ZegoLiveRoom"
8 |
9 | /// Git repository commit revision
10 | #define ZEGO_SDK_EXPRESS_COMMIT_REVISION "5ac6360ac3"
11 | #define ZEGO_SDK_LIVEROOM_COMMIT_REVISION "49d0aee6dd"
12 | #define ZEGO_SDK_CONNECTION_COMMIT_REVISION "7901c1c178"
13 |
14 | #endif // zego_api_sdk_property_h
15 |
--------------------------------------------------------------------------------
/android/libs/x86_64/libZegoLiveRoom.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zegoim/zego-flutter-sdk/ffea55734a2dfb4be808ba858adf151a848449cf/android/libs/x86_64/libZegoLiveRoom.so
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'zegoliveroom_plugin'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/cpp/zego_log_jni.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include "../../../../zego_defines.h"
4 |
5 | std::string jstring2string(JNIEnv* env, jstring jstr)
6 | {
7 | jclass strClass = env->FindClass("java/lang/String");
8 | jstring encoding = env->NewStringUTF("UTF-8");
9 | jmethodID methodId = env->GetMethodID(strClass, "getBytes", "(Ljava/lang/String;)[B");
10 | jbyteArray byteArr = (jbyteArray)env->CallObjectMethod(jstr, methodId, encoding); // String .getByte("UTF-8");
11 | jsize arrLength = env->GetArrayLength(byteArr); //获取长度
12 | jbyte* bytePtr = env->GetByteArrayElements(byteArr, JNI_FALSE); // jbyteArray 转为 jbyte*
13 |
14 | std::string str{(char *)bytePtr, (size_t)arrLength};
15 |
16 | env->ReleaseByteArrayElements(byteArr, bytePtr, 0); //释放掉
17 | env->DeleteLocalRef(byteArr);
18 | env->DeleteLocalRef(encoding);
19 | env->DeleteLocalRef(strClass);
20 |
21 | return str;
22 | }
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | JNIEXPORT void JNICALL Java_com_zego_zegoliveroomplugin_ZegoLogJNI_logNotice(JNIEnv *env, jclass, jstring content) {
29 |
30 | std::string strContent = jstring2string(env, content);
31 | return ZegoExternalLogWithNotice(strContent.c_str());
32 | }
33 |
34 | #ifdef __cplusplus
35 | }
36 | #endif
37 |
38 |
--------------------------------------------------------------------------------
/android/src/main/java/com/zego/zegoliveroomplugin/ZegoLogJNI.java:
--------------------------------------------------------------------------------
1 | package com.zego.zegoliveroomplugin;
2 |
3 | final public class ZegoLogJNI {
4 | static {
5 | System.loadLibrary("ZegoLog");
6 | }
7 |
8 | public static native void logNotice(String content);
9 | }
10 |
--------------------------------------------------------------------------------
/android/src/main/java/com/zego/zegoliveroomplugin/ZegoPlatformView.java:
--------------------------------------------------------------------------------
1 | package com.zego.zegoliveroomplugin;
2 |
3 | import android.content.Context;
4 | import android.view.Surface;
5 | import android.view.SurfaceHolder;
6 | import android.view.SurfaceView;
7 | import android.view.View;
8 |
9 | import io.flutter.plugin.platform.PlatformView;
10 |
11 | public class ZegoPlatformView implements PlatformView, SurfaceHolder.Callback {
12 |
13 | private SurfaceView mSurfaceView;
14 | private int mViewID;
15 |
16 | public ZegoPlatformView(Context context, int viewID) {
17 | this.mViewID = viewID;
18 | this.mSurfaceView = new SurfaceView(context);
19 | this.mSurfaceView.getHolder().addCallback(this);
20 |
21 | ZegoLogJNI.logNotice("[ZegoPlatformView] new, viewID: " + viewID + ", context: " + context);
22 |
23 | }
24 |
25 | public SurfaceView getSurfaceView() {
26 | return mSurfaceView;
27 | }
28 |
29 | @Override
30 | public View getView() {
31 | return mSurfaceView;
32 | }
33 |
34 | @Override
35 | public void dispose() {
36 | ZegoLogJNI.logNotice("[ZegoPlatformView] dispose, viewID: " + mViewID);
37 | if(mSurfaceView != null) {
38 | mSurfaceView.getHolder().removeCallback(this);
39 | Surface surface = mSurfaceView.getHolder().getSurface();
40 | if(surface != null)
41 | surface.release();
42 |
43 | mSurfaceView = null;
44 | }
45 | }
46 |
47 | @Override
48 | public void surfaceCreated(SurfaceHolder holder) {
49 | ZegoLogJNI.logNotice("[ZegoPlatformView] onSurfaceCreated, viewID: " + mViewID);
50 | }
51 |
52 | @Override
53 | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
54 | ZegoLogJNI.logNotice("[ZegoPlatformView] onSurfaceChanged, viewID: " + mViewID + ", size: (" + width + ", " + height + ")" + ", format: " + format);
55 | }
56 |
57 | @Override
58 | public void surfaceDestroyed(SurfaceHolder holder) {
59 | ZegoLogJNI.logNotice("[ZegoPlatformView] onSurfaceDestroyed");
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/android/src/main/java/com/zego/zegoliveroomplugin/ZegoPlatformViewFactory.java:
--------------------------------------------------------------------------------
1 | package com.zego.zegoliveroomplugin;
2 |
3 | import android.content.Context;
4 |
5 | import java.util.HashMap;
6 |
7 | import io.flutter.plugin.common.MessageCodec;
8 | import io.flutter.plugin.common.StandardMessageCodec;
9 | import io.flutter.plugin.platform.PlatformView;
10 | import io.flutter.plugin.platform.PlatformViewFactory;
11 |
12 | public class ZegoPlatformViewFactory extends PlatformViewFactory{
13 |
14 | private static ZegoPlatformViewFactory sInstance;
15 |
16 | private HashMap mViews;
17 |
18 | public static ZegoPlatformViewFactory shareInstance() {
19 | if(sInstance == null) {
20 | sInstance = new ZegoPlatformViewFactory(StandardMessageCodec.INSTANCE);
21 | ZegoLogJNI.logNotice("[ZegoPlatformViewFactory] instance init");
22 | }
23 |
24 | return sInstance;
25 | }
26 |
27 | private ZegoPlatformViewFactory(MessageCodec