C++ Java Unity
C++ Reference
SessionRecorder Class Referenceabstract

Detailed Description

API for recording data from sources such as camera and sensors on the device running Vuforia.

Inheritance diagram for SessionRecorder:
NonCopyable

Public Types

enum  Source {
  Camera = 0x01,
  Sensors = 0x02
}
 Combinable flag bits indicating which sources to record from. More...
 
enum  RecordingStatus {
  RecordingNotStarted = 1,
  RecordingInProgress = 2,
  SourcesNotAvailable = 3,
  StorageLocationRetrievalError = 4,
  SourceOperationError = 5,
  InsufficientFreeSpace = 6,
  OrientationNotSupported = 7
}
 Current recording status. More...
 

Public Member Functions

virtual int getSupportedSources () const =0
 Get flag value indicating sources supported on this device. More...
 
virtual RecordingStatus start (int sources)=0
 Start recording data from the specified sources. More...
 
virtual void stop ()=0
 Stop current recording. More...
 
virtual const char * getRecordingPath () const =0
 Get the recording output path. More...
 
virtual RecordingStatus getRecordingStatus () const =0
 Get current recording status. More...
 
virtual bool clean () const =0
 Remove all previously recorded sequences. More...
 

Static Public Member Functions

static SessionRecordergetInstance ()
 Get the singleton instance. More...
 

Member Enumeration Documentation

enum Source

Combinable flag bits indicating which sources to record from.

Enumerator
Camera 
Sensors 

Camera images, and device poses. Please note that pose data is not available on all devices. If pose data is unavailable, then only camera images are recorded.

Current recording status.

Enumerator
RecordingNotStarted 
RecordingInProgress 

Not recording.

SourcesNotAvailable 

A recording is in progress.

StorageLocationRetrievalError 

One or more requested sources are physically unavailable on this platform.

SourceOperationError 

Unable to retrieve a suitable location for storing the data on the device.

InsufficientFreeSpace 

Could not operate some requested sources.

OrientationNotSupported 

There isn't sufficient free space on the device for recording the data - a recording could not be started or was aborted due to this reason.

Member Function Documentation

static SessionRecorder& getInstance ( )
static

Get the singleton instance.

virtual int getSupportedSources ( ) const
pure virtual

Get flag value indicating sources supported on this device.

This method should be called after Vuforia has been initialized. Otherwise, some supported sources may not be recognized.

See also
Source
Returns
a combination of source flag bits indicating which data sources are supported on this device.
virtual RecordingStatus start ( int  sources)
pure virtual

Start recording data from the specified sources.

If recording fails or is not stopped before Vuforia is deinitialized, any created files are not cleaned up and may not be valid for playback. This method should be called after Vuforia has been initialized. Failure to do so may result in the incorrect status value being returned. In particular, the camera device should be properly initialized and started.

See also
getSupportedSources
RecordingStatus
Parameters
sourcesflag indicating which sources to record data from
Returns
a status value indicating whether a recording has been started / is in progress, or the error otherwise. In case of an error, check the application logs for details.
virtual void stop ( )
pure virtual

Stop current recording.

Currently this API does not provide a pause/resume capability. Hence, when an app is paused, it should call stop (BEFORE stopping the camera); and on the subsequent resume it should call start. This implies that the current recording will be finalized on pause, and a new one will be started on resume.

If on pausing an application, an ongoing recording is not stopped as instructed above, Vuforia::onPause will force-stop it. However, in this case the resulting recording is not guaranteed to be in a usable state.

virtual const char* getRecordingPath ( ) const
pure virtual

Get the recording output path.

The method will return null until a recording has been started, the path is updated each time start is called.

Returns
the full path where the recording is output. Note that on the next call to start, this pointer may be invalidated (could be freed). So if the returned path is to be retained beyond that, it's recommended to make a copy of it.
virtual RecordingStatus getRecordingStatus ( ) const
pure virtual

Get current recording status.

Returns
whether a recording is in progress, or the error otherwise. In case of an error, check the application logs for details.
virtual bool clean ( ) const
pure virtual

Remove all previously recorded sequences.

Returns
true if all recorded sequences have been removed successfully, or false otherwise (check application logs for details), for instance if called while a recording is in progress.