Skip to main content
API Reference NSDK

NSDKDashcamSession

A session for continuous frame buffering and on-demand save functionality....

Declaration

final class NSDKDashcamSession

Summary

A session for continuous frame buffering and on-demand save functionality. The dashcam feature captures frames into a circular buffer while running. At any point, the buffer contents can be saved to disk as a V2 sequence for later playback or upload. This is useful for capturing context around events of interest without requiring the user to explicitly start recording in advance.


Methods

NameTypeSummary
bufferInfoNSDKDashcamSession.BufferInfo
Returns information about the current buffer state.
- Returns: A BufferInfo with frame count, memory usage, and duration.
configurevoid
Configures the dashcam with the specified settings.
- Attention: Must be called while the dashcam is stopped.
- Parameter config: Configuration defining buffer limits, framerate, and output path.
- Throws: NSDKError.invalidArgument if the configuration is invalid.
featureStatusNSDKFeatureStatus
Reports errors that have occurred within the dashcam feature.
Check this periodically to monitor the health of the dashcam.
Once an error has been flagged, it remains until the process
runs again and completes successfully.
- Returns: Feature status flags for any issues that have occurred.
saveBufferNSDKDashcamSession.SaveResult
Saves the current buffer contents and waits for completion.
- Parameters:
- timeout: Maximum duration in seconds to wait (default 30 seconds).
- pollingInterval: Interval in seconds between progress checks (default 0.5 seconds).
- Returns: The SaveResult containing the save path on success.
- Throws:
- NSDKError.invalidOperation if the buffer is empty.
- TimeoutError if the save does not complete within the timeout.
- CancellationError if the running Task is cancelled.
- SaveError.saveFailed if the native save operation failed.
startvoid
Starts buffering frames.
The dashcam will continuously capture and buffer sensor data
from the frame pipeline.
stopvoid
Stops buffering frames.
The buffer is cleared. Saving is not allowed while stopped.

Nested Types

Structs

NameTypeSummary
BufferInfoBufferInfo
Information about the current state of the dashcam buffer.
ConfigurationConfiguration
Configuration for the dashcam feature.
SaveResultSaveResult
Result of a dashcam save operation.

Enums

NameTypeSummary
SaveErrorSaveError
Errors specific to dashcam save operations.
SaveStateSaveState
State of a dashcam save operation.

Relationships

conforms to: NSDKFeatureSession