12345678910111213141516171819202122232425262728 |
- import 'package:fis_vid/async_vid/vid_data.dart';
- import 'package:flutter/foundation.dart';
- import 'package:vid/us/vid_us_image.dart';
- abstract class VidDataChannel {
- late final AsyncVidImageDataBase _source;
- /// 开始加载数据
- Future<bool> load() async {
- try {
- _source = await buildSource();
- await _source.initialize();
- return true;
- } catch (e) {
- return false;
- }
- }
- /// 获取指定帧
- ///
- /// [index] 帧索引
- Future<VidUsImage> getImage(int index) async {
- return _source.getImage(index);
- }
- @protected
- Future<AsyncVidImageDataBase> buildSource();
- }
|