Voyant API 0.8.0
Loading...
Searching...
No Matches
Classes | Functions
voyant_recorder_ffi.hpp File Reference
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

Go to the source code of this file.

Classes

struct  VoyantRecorderC
 

Functions

VoyantRecorderC voyant_recorder_create (const char *output_path, bool timestamp_filename, uint32_t frames_per_file, uint64_t duration_per_file, uint64_t size_per_file_mb, uint32_t max_total_frames, uint64_t max_total_duration, uint64_t max_total_size_mb, uint64_t buffer_size_mb)
 
int32_t voyant_recorder_record_frame (VoyantRecorderC *recorder, const uint8_t *frame_data, uintptr_t frame_size)
 
int32_t voyant_recorder_frames_recorded (const VoyantRecorderC *recorder)
 
int32_t voyant_recorder_split_count (const VoyantRecorderC *recorder)
 
int32_t voyant_recorder_finalize (VoyantRecorderC recorder)
 

Function Documentation

◆ voyant_recorder_create()

VoyantRecorderC voyant_recorder_create ( const char *  output_path,
bool  timestamp_filename,
uint32_t  frames_per_file,
uint64_t  duration_per_file,
uint64_t  size_per_file_mb,
uint32_t  max_total_frames,
uint64_t  max_total_duration,
uint64_t  max_total_size_mb,
uint64_t  buffer_size_mb 
)

Creates a new VoyantRecorder instance

Parameters
output_pathC string containing base path to the output recording file(s)
timestamp_filenameWhether to add timestamp to filename (true/false)
frames_per_fileMaximum frames per file before splitting (0 = no limit)
duration_per_fileMaximum duration per file in seconds before splitting (0 = no limit)
size_per_file_mbMaximum size per file in MB before splitting (0 = no limit)
max_total_framesMaximum total frames across all files (0 = no limit)
max_total_durationMaximum total duration in seconds across all files (0 = no limit)
max_total_size_mbMaximum total size in MB across all files (0 = no limit)
buffer_size_mbFrame buffer size in MB for writing (Recommended: 4MB, advanced users only modify as needed)
Returns
VoyantRecorderC struct containing the recorder instance
Note
Returns a VoyantRecorderC with null pointer if creation fails
Warning
output_path must be a valid null-terminated C string
Note
Using 0 for any limit parameter means "no limit" for that constraint

◆ voyant_recorder_finalize()

int32_t voyant_recorder_finalize ( VoyantRecorderC  recorder)

Finalizes the recording and frees the recorder instance

This function properly closes the file and releases all resources. The recorder should not be used after calling this function.

Parameters
recorderVoyantRecorderC instance to finalize and free
Returns
1: Successfully finalized
0: Failed to finalize (I/O error during flush/close)
-1: Invalid recorder instance
Warning
After calling this function, the recorder instance should not be used

◆ voyant_recorder_frames_recorded()

int32_t voyant_recorder_frames_recorded ( const VoyantRecorderC recorder)

Gets the number of frames recorded so far across all files

Parameters
recorderReference to VoyantRecorderC instance
Returns
Number of frames recorded, -1 if recorder is invalid
Warning
recorder must be a valid VoyantRecorderC instance

◆ voyant_recorder_record_frame()

int32_t voyant_recorder_record_frame ( VoyantRecorderC recorder,
const uint8_t *  frame_data,
uintptr_t  frame_size 
)

Records a single frame from serialized frame data

Parameters
recorderReference to VoyantRecorderC instance
frame_dataPointer to serialized frame data buffer
frame_sizeSize of the frame data in bytes
Returns
0: Successfully recorded frame, continue recording
1: Successfully recorded frame, file was split due to limits
2: Limits reached - recording should stop (not an error)
-1: Failed to record frame (serialization error, I/O error, etc.)
-2: Invalid recorder instance
Warning
recorder must be a valid VoyantRecorderC instance
frame_data must point to a buffer of at least frame_size bytes

◆ voyant_recorder_split_count()

int32_t voyant_recorder_split_count ( const VoyantRecorderC recorder)

Gets the number of files created (split count)

Parameters
recorderReference to VoyantRecorderC instance
Returns
Number of files created, -1 if recorder is invalid
Warning
recorder must be a valid VoyantRecorderC instance