Protocols

The following protocols are available globally.

  • Authentification handler protocol One instance per SDK that controlls the access. Use TraceVisionFactory.shared.getAuthHandler() to get the instance

    Note

    This is used for authenticating users in the TraceVision apps, please ignore.
    See more

    Declaration

    Swift

    public protocol AuthHandlerProtocol
  • Common result of any operation, usually async

    See more

    Declaration

    Swift

    public protocol OperationResult
  • A protocol that defines a reader of HighlightObjects

    See more

    Declaration

    Swift

    public protocol HighlightReaderProtocol
  • Protocol to create and handle a video session

    Video session should be used to process one video The video can be recorded or uploaded from local file URL usually from the camera roll

    Note

    you can’t mix recording and importing in one session
    See more

    Declaration

    Swift

    public protocol VideoSessionProtocol
  • Protocol for a video session that can be recorded

    This session has a video recorder that can be controlled to start/stop the recording with the rear camera. You can configure the session to record full video and save it to camera roll or just record the highlights. Highlights can also be exported to camera roll or viewed with this SDK

    See more

    Declaration

    Swift

    public protocol VideoRecordSessionProtocol : VideoRecorderProtocol, VideoSessionProtocol
  • Protocol for a video session that can be imported

    Create this type of session for every video file that should be processed. Video file should be accessible for within the app.

    See more

    Declaration

    Swift

    public protocol VideoImportSessionProtocol : VideoSessionProtocol
  • Protocol for a video session that can be processed frame by frame

    This is a low level highlight processing session that can be used to process video frames one by one. You should obtain the video frame in any way you want and call processFrame method to process it. Sequence of calls to process the video:

    • start() to start processing
    • processFrame(buffer) for every frame of the video
    • stop() to stop processing and finalize the results

    Note

    Listen to status.highlights observable property to get the highlights found in the video.
    See more

    Declaration

    Swift

    public protocol VideoByFrameSessionProtocol : VideoSessionProtocol
  • Protocol to record a video with the rear camera.

    Provides control over the recording process and camera preview. You can access the current state of the recording with status observable property.

    The sequence of calls should be as follows:

    • initVideoRecorder(orientation) (usually onAppear and orientation change) call to init the rear camera and start receiving the preview into the previewLayer
    • startRecording() when the user presses the record button. This will start supplying the video frames to the recording session

    When done:

    • stopRecording() when the user presses the stop button. Recording stops but previewLayer continues to show the camera view
    • stopVideoRecorder() (usually onDisappear) to stop the preview and shutdown the camera
    See more

    Declaration

    Swift

    public protocol VideoRecorderProtocol