#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
Go to the source code of this file.
|
| 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) |
| |
◆ 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_path | C string containing base path to the output recording file(s) |
| timestamp_filename | Whether to add timestamp to filename (true/false) |
| frames_per_file | Maximum frames per file before splitting (0 = no limit) |
| duration_per_file | Maximum duration per file in seconds before splitting (0 = no limit) |
| size_per_file_mb | Maximum size per file in MB before splitting (0 = no limit) |
| max_total_frames | Maximum total frames across all files (0 = no limit) |
| max_total_duration | Maximum total duration in seconds across all files (0 = no limit) |
| max_total_size_mb | Maximum total size in MB across all files (0 = no limit) |
| buffer_size_mb | Frame 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()
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
-
- 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
-
- 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
-
| recorder | Reference to VoyantRecorderC instance |
| frame_data | Pointer to serialized frame data buffer |
| frame_size | Size 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()
Gets the number of files created (split count)
- Parameters
-
- Returns
- Number of files created, -1 if recorder is invalid
- Warning
- recorder must be a valid VoyantRecorderC instance