统一video插件
This commit is contained in:
parent
485f1f19c8
commit
12c54045e3
12
README.md
12
README.md
@ -6,7 +6,7 @@ Flutter 智能锁接入 SDK。SDK 封装了星云账户、蓝牙扫描和配对
|
|||||||
|
|
||||||
## 交付内容
|
## 交付内容
|
||||||
|
|
||||||
实际交付根目录包含下列五个同级目录。`flutter_sdk` 通过相对路径依赖前三个底层包;`video_decode_plugin` 是示例工程的视频渲染可选组件:
|
`flutter_sdk` 通过固定 Git 提交依赖 `starlock_ble`、`starcloud` 和 `starchart`;`video_decode_plugin` 是示例工程的视频渲染可选组件:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
vendor/
|
vendor/
|
||||||
@ -33,7 +33,7 @@ vendor/
|
|||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
将 `flutter_sdk`、`starlock_ble`、`starcloud`、`starchart` 放入宿主 App 的 `vendor/`。需要使用示例同款 FFmpeg 视频渲染时,再一并放入 `video_decode_plugin`。
|
宿主项目需要具有读取 `minbingbing` 名下私有 Gitea 仓库的权限。`flutter_sdk` 的底层 SDK 依赖会在 `pub get` 时按固定提交自动拉取,不需要放入同级 `vendor/` 目录。
|
||||||
|
|
||||||
宿主 `pubspec.yaml` 的最小依赖只需要声明 `flutter_sdk`:
|
宿主 `pubspec.yaml` 的最小依赖只需要声明 `flutter_sdk`:
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ dependencies:
|
|||||||
path: vendor/flutter_sdk
|
path: vendor/flutter_sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
`flutter_sdk` 的 `pubspec.yaml` 已通过 `path: ../starlock_ble`、`../starcloud`、`../starchart` 引用同级底层包,因此宿主执行一次依赖安装即可递归解析全部核心包:
|
`flutter_sdk` 的 `pubspec.yaml` 已通过固定 Git 提交引用底层包,因此宿主执行一次依赖安装即可递归解析全部核心包:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
fvm flutter pub get
|
fvm flutter pub get
|
||||||
@ -56,7 +56,9 @@ fvm flutter pub get
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
video_decode_plugin:
|
video_decode_plugin:
|
||||||
path: vendor/video_decode_plugin
|
git:
|
||||||
|
url: https://code.skychip.top/sky/video_decode_plugin.git
|
||||||
|
ref: 26ce13204e017f421c6b236c0342a40c0cd120ac
|
||||||
```
|
```
|
||||||
|
|
||||||
然后仍只需要在宿主 App 根目录再执行一次 `fvm flutter pub get`。**不需要**为正常集成专门进入 `video_decode_plugin`、`starlock_ble`、`starcloud` 或 `starchart` 逐个执行 `pub get`;只有开发/测试这些包自身或运行它们的独立 example 时才需要。
|
然后仍只需要在宿主 App 根目录再执行一次 `fvm flutter pub get`。**不需要**为正常集成专门进入 `video_decode_plugin`、`starlock_ble`、`starcloud` 或 `starchart` 逐个执行 `pub get`;只有开发/测试这些包自身或运行它们的独立 example 时才需要。
|
||||||
@ -280,7 +282,7 @@ final status = await StarCloudClient.instance.wifi.getGatewayStatus(
|
|||||||
|
|
||||||
### 6. 视频对讲
|
### 6. 视频对讲
|
||||||
|
|
||||||
视频对讲服务只负责注册、呼叫和事件分发;H264 解码渲染、G711 编解码、麦克风采集与权限处理由宿主 App 集成。示例工程使用本地 `video_decode_plugin` 的 FFmpeg 后端进行 H264 解码渲染。
|
视频对讲服务只负责注册、呼叫和事件分发;H264 解码渲染、G711 编解码、麦克风采集与权限处理由宿主 App 集成。示例工程使用 `video_decode_plugin` 的 FFmpeg 后端进行 H264 解码渲染。
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
await StarCloudClient.instance.talk.init(
|
await StarCloudClient.instance.talk.init(
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
- Flutter 3.19.6(项目通过 FVM 管理)
|
- Flutter 3.19.6(项目通过 FVM 管理)
|
||||||
- Android 真机或 iOS 真机
|
- Android 真机或 iOS 真机
|
||||||
- 已按根目录 [README](../README.md) 配置蓝牙、定位、网络、麦克风和相机权限
|
- 已按根目录 [README](../README.md) 配置蓝牙、定位、网络、麦克风和相机权限
|
||||||
- 需要 `flutter_sdk`、`starlock_ble`、`starcloud`、`starchart` 及 `video_decode_plugin` 位于当前相对路径所指向的位置
|
- 需要具有读取相关私有 Gitea 仓库的权限;底层 SDK 与 `video_decode_plugin` 会按 `pubspec.yaml` 固定的 Git 提交拉取
|
||||||
|
|
||||||
安装依赖并运行:
|
安装依赖并运行:
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ fvm flutter pub get
|
|||||||
fvm flutter run
|
fvm flutter run
|
||||||
```
|
```
|
||||||
|
|
||||||
不需要先进入 `../../video_decode_plugin` 执行 `fvm flutter pub get`:本示例的 `pubspec.yaml` 已以 `path: ../../video_decode_plugin` 声明该插件,执行本目录的 `fvm flutter pub get` 会递归解析其依赖。只有修改插件源码或运行插件自身示例时,才进入插件目录单独执行该命令。
|
不需要先进入 `video_decode_plugin` 执行 `fvm flutter pub get`:执行本目录的 `fvm flutter pub get` 会按固定 Git 提交递归解析其依赖。只有修改插件源码或运行插件自身示例时,才进入插件目录单独执行该命令。
|
||||||
|
|
||||||
若只做代码检查:
|
若只做代码检查:
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ https://cloud.skychip.top/sdk
|
|||||||
[DIAG] decoder active engine=ffmpeg
|
[DIAG] decoder active engine=ffmpeg
|
||||||
```
|
```
|
||||||
|
|
||||||
若日志显示 `mediacodec`,说明运行的不是当前 FFmpeg 配置;请检查本地 `video_decode_plugin` 路径、重新构建 APK,并确认未使用旧产物。
|
若日志显示 `mediacodec`,说明运行的不是当前 FFmpeg 配置;请确认已解析 `video_decode_plugin` 的指定 Git 提交、重新构建 APK,并确认未使用旧产物。
|
||||||
|
|
||||||
## 示例配置位置
|
## 示例配置位置
|
||||||
|
|
||||||
|
|||||||
@ -212,7 +212,7 @@ class _VideoTalkTabState extends State<VideoTalkTab> {
|
|||||||
Future<bool> _doInitDecoder() async {
|
Future<bool> _doInitDecoder() async {
|
||||||
if (_decoderReady) return true;
|
if (_decoderReady) return true;
|
||||||
try {
|
try {
|
||||||
// 参考项目 Android 端的 video_decode_plugin 默认使用 FFmpeg;这里显式
|
// video_decode_plugin 的 Android 端默认使用 FFmpeg;这里显式
|
||||||
// 保持同一后端,避免插件默认值变化时两端走出不同的解码流程。
|
// 保持同一后端,避免插件默认值变化时两端走出不同的解码流程。
|
||||||
final engineState = await VideoDecodePlugin.setDecodeEngine(
|
final engineState = await VideoDecodePlugin.setDecodeEngine(
|
||||||
VideoDecodePlugin.engineFfmpeg,
|
VideoDecodePlugin.engineFfmpeg,
|
||||||
|
|||||||
@ -607,23 +607,29 @@ packages:
|
|||||||
starchart:
|
starchart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
path: "../../starchart"
|
path: "."
|
||||||
relative: true
|
ref: "003705cf35ffc8039e749077197879e50ecc4248"
|
||||||
source: path
|
resolved-ref: "003705cf35ffc8039e749077197879e50ecc4248"
|
||||||
|
url: "https://code.skychip.top/minbingbing/starchart.git"
|
||||||
|
source: git
|
||||||
version: "0.1.0"
|
version: "0.1.0"
|
||||||
starcloud:
|
starcloud:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../starcloud"
|
path: "."
|
||||||
relative: true
|
ref: "500c733e571bb9354812722ef7d16daf703d28b3"
|
||||||
source: path
|
resolved-ref: "500c733e571bb9354812722ef7d16daf703d28b3"
|
||||||
|
url: "https://code.skychip.top/minbingbing/starcloud.git"
|
||||||
|
source: git
|
||||||
version: "0.1.2"
|
version: "0.1.2"
|
||||||
starlock_ble:
|
starlock_ble:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../starlock_ble"
|
path: "."
|
||||||
relative: true
|
ref: "045a1ee931ddc8fa92a481358202023a19144187"
|
||||||
source: path
|
resolved-ref: "045a1ee931ddc8fa92a481358202023a19144187"
|
||||||
|
url: "https://code.skychip.top/minbingbing/starlock_ble.git"
|
||||||
|
source: git
|
||||||
version: "0.1.0"
|
version: "0.1.0"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
@ -700,9 +706,11 @@ packages:
|
|||||||
video_decode_plugin:
|
video_decode_plugin:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../video_decode_plugin"
|
path: "."
|
||||||
relative: true
|
ref: "26ce13204e017f421c6b236c0342a40c0cd120ac"
|
||||||
source: path
|
resolved-ref: "26ce13204e017f421c6b236c0342a40c0cd120ac"
|
||||||
|
url: "https://code.skychip.top/sky/video_decode_plugin.git"
|
||||||
|
source: git
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
@ -721,7 +729,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.1"
|
version: "0.5.1"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: "direct overridden"
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
|
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
|
||||||
|
|||||||
@ -15,9 +15,13 @@ dependencies:
|
|||||||
flutter_sdk:
|
flutter_sdk:
|
||||||
path: ..
|
path: ..
|
||||||
starlock_ble:
|
starlock_ble:
|
||||||
path: ../../starlock_ble
|
git:
|
||||||
|
url: https://code.skychip.top/minbingbing/starlock_ble.git
|
||||||
|
ref: 045a1ee931ddc8fa92a481358202023a19144187
|
||||||
starcloud:
|
starcloud:
|
||||||
path: ../../starcloud
|
git:
|
||||||
|
url: https://code.skychip.top/minbingbing/starcloud.git
|
||||||
|
ref: 500c733e571bb9354812722ef7d16daf703d28b3
|
||||||
crypto: ^3.0.3
|
crypto: ^3.0.3
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
|
|
||||||
@ -34,7 +38,12 @@ dependencies:
|
|||||||
permission_handler: ^11.3.1
|
permission_handler: ^11.3.1
|
||||||
# 视频对讲:H264 裸流解码渲染(本地插件,含 ffmpeg-kit)
|
# 视频对讲:H264 裸流解码渲染(本地插件,含 ffmpeg-kit)
|
||||||
video_decode_plugin:
|
video_decode_plugin:
|
||||||
path: ../../video_decode_plugin
|
git:
|
||||||
|
url: https://code.skychip.top/sky/video_decode_plugin.git
|
||||||
|
ref: 26ce13204e017f421c6b236c0342a40c0cd120ac
|
||||||
|
|
||||||
|
dependency_overrides:
|
||||||
|
win32: 5.5.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user