Skip to content

Commit dd3bc71

Browse files
authored
Processor fixes 1 (#1038)
1 parent ec38a86 commit dd3bc71

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Fix missing params in CameraCaptureOptions.copyWith"

.changes/fix-processor-stop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Stop processor on track end"

lib/src/track/local/local.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ abstract class LocalTrack extends Track {
224224
logger.severe('MediaStreamTrack.dispose() did throw $error');
225225
}
226226
_stopped = true;
227+
try {
228+
if (_processor != null) {
229+
await stopProcessor();
230+
}
231+
} catch (error) {
232+
logger.severe('LocalTrack.stopProcessor did throw: $error');
233+
}
227234
}
228235
return didStop;
229236
}

lib/src/track/options.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class CameraCaptureOptions extends VideoCaptureOptions {
7979
params: captureOptions.params,
8080
deviceId: captureOptions.deviceId,
8181
maxFrameRate: captureOptions.maxFrameRate,
82+
processor: captureOptions.processor,
8283
);
8384

8485
@override
@@ -108,18 +109,24 @@ class CameraCaptureOptions extends VideoCaptureOptions {
108109

109110
// Returns new options with updated properties
110111
CameraCaptureOptions copyWith({
111-
VideoParameters? params,
112112
CameraPosition? cameraPosition,
113+
CameraFocusMode? focusMode,
114+
CameraExposureMode? exposureMode,
113115
String? deviceId,
114116
double? maxFrameRate,
117+
VideoParameters? params,
115118
bool? stopCameraCaptureOnMute,
119+
TrackProcessor<VideoProcessorOptions>? processor,
116120
}) =>
117121
CameraCaptureOptions(
118-
params: params ?? this.params,
119122
cameraPosition: cameraPosition ?? this.cameraPosition,
123+
focusMode: focusMode ?? this.focusMode,
124+
exposureMode: exposureMode ?? this.exposureMode,
120125
deviceId: deviceId ?? this.deviceId,
121126
maxFrameRate: maxFrameRate ?? this.maxFrameRate,
127+
params: params ?? this.params,
122128
stopCameraCaptureOnMute: stopCameraCaptureOnMute ?? this.stopCameraCaptureOnMute,
129+
processor: processor ?? this.processor,
123130
);
124131
}
125132

0 commit comments

Comments
 (0)