/// <summary> /// Call to enable motion detection. /// </summary> /// <param name="handler">The motion capture handler.</param> /// <param name="config">The motion configuration object.</param> /// <param name="onDetect">The callback when motion is detected.</param> /// <param name="onStopDetect">An optional callback which is called when the record duration has passed.</param> /// <returns>The camera instance.</returns> public MMALCamera WithMotionDetection(IMotionCaptureHandler handler, MotionConfig config, Action onDetect, Action onStopDetect = null) { MMALCameraConfig.InlineMotionVectors = true; handler.ConfigureMotionDetection(config, onDetect, onStopDetect); return(this); }
/// <summary> /// Call to enable motion detection. /// </summary> /// <param name="handler">The motion capture handler.</param> /// <param name="config">The motion configuration object.</param> /// <param name="onDetect">The callback when motion is detected.</param> /// <param name="imageContext">The image metadata.</param> /// <returns>The camera instance.</returns> public MMALCamera WithMotionDetection(IMotionCaptureHandler handler, MotionConfig config, Action onDetect, IImageContext imageContext) { MMALCameraConfig.InlineMotionVectors = true; handler.DetectMotion(config, onDetect, imageContext); return(this); }