|
@@ -14,17 +14,16 @@ import 'package:vid/us/vid_us_image.dart';
|
|
|
import 'package:vid/us/vid_us_image_data.dart';
|
|
|
import 'package:vid/us/vid_us_probe.dart';
|
|
|
|
|
|
+import '../base/data_host.dart';
|
|
|
+
|
|
|
part 'broswer.dart';
|
|
|
part 'shell.dart';
|
|
|
|
|
|
-class VidDataHost implements VidDataHostInterface {
|
|
|
- VidDataHost(this.url);
|
|
|
+class VidDataHost extends VidDataHostBase {
|
|
|
+ VidDataHost(String url) : super(url);
|
|
|
|
|
|
VidDataHostInterface? _hostInstance;
|
|
|
|
|
|
- @override
|
|
|
- final String url;
|
|
|
-
|
|
|
@override
|
|
|
int get frameCount => _hostInstance!.frameCount;
|
|
|
|
|
@@ -38,12 +37,16 @@ class VidDataHost implements VidDataHostInterface {
|
|
|
Future<VidUsImage?> getFrame<TProcessor extends VidFrameProcessor>(
|
|
|
int index, {
|
|
|
List<TProcessor>? processors,
|
|
|
- }) {
|
|
|
+ }) async {
|
|
|
if (_hostInstance == null) {
|
|
|
throw Exception(
|
|
|
"[VidDataHost] getFrame: must call load first and data is not null.");
|
|
|
}
|
|
|
- return _hostInstance!.getFrame(index, processors: processors);
|
|
|
+ final frame = await _hostInstance!.getFrame(index, processors: processors);
|
|
|
+ if (frame != null) {
|
|
|
+ frameLoaded.emit(this, frame);
|
|
|
+ }
|
|
|
+ return frame;
|
|
|
}
|
|
|
|
|
|
@override
|