36 other.m_handle =
nullptr;
47 record &operator=(
const record &) =
delete;
56 m_handle = other.m_handle;
57 other.m_handle =
nullptr;
65 explicit operator bool() const noexcept
74 return m_handle !=
nullptr;
85 k4a_record_close(m_handle);
102 throw error(
"Failed to flush!");
112 void add_tag(
const char *name,
const char *value)
114 k4a_result_t result = k4a_record_add_tag(m_handle, name, value);
118 throw error(
"Failed to add tag!");
129 k4a_result_t result = k4a_record_add_imu_track(m_handle);
133 throw error(
"Failed to add imu_track!");
142 void add_attachment(
const char *attachment_name,
const uint8_t *buffer,
size_t buffer_size)
144 k4a_result_t result = k4a_record_add_attachment(m_handle, attachment_name, buffer, buffer_size);
148 throw error(
"Failed to add attachment!");
158 const char *codec_id,
159 const uint8_t *codec_context,
160 size_t codec_context_size,
163 k4a_result_t result = k4a_record_add_custom_video_track(m_handle,
172 throw error(
"Failed to add custom video track!");
182 const char *codec_id,
183 const uint8_t *codec_context,
184 size_t codec_context_size,
187 k4a_result_t result = k4a_record_add_custom_subtitle_track(m_handle,
196 throw error(
"Failed to add custom subtitle track!");
207 k4a_result_t result = k4a_record_write_header(m_handle);
211 throw error(
"Failed to write header!");
226 throw error(
"Failed to write capture!");
237 k4a_result_t result = k4a_record_write_imu_sample(m_handle, imu_sample);
241 throw error(
"Failed to write imu sample!");
251 const std::chrono::microseconds device_timestamp_usec,
252 uint8_t *custom_data,
253 size_t custom_data_size)
255 k4a_result_t result = k4a_record_write_custom_track_data(m_handle,
257 internal::clamp_cast<uint64_t>(
258 device_timestamp_usec.count()),
264 throw error(
"Failed to write custom track data!");
280 throw error(
"Failed to create recorder!");
k4a_capture_t handle() const noexcept
k4a_device_t handle() const noexcept
void write_imu_sample(const k4a_imu_sample_t &imu_sample)
void add_custom_subtitle_track(const char *track_name, const char *codec_id, const uint8_t *codec_context, size_t codec_context_size, const k4a_record_subtitle_settings_t *track_settings)
bool is_valid() const noexcept
void write_custom_track_data(const char *track_name, const std::chrono::microseconds device_timestamp_usec, uint8_t *custom_data, size_t custom_data_size)
void add_attachment(const char *attachment_name, const uint8_t *buffer, size_t buffer_size)
record(record &&other) noexcept
static record create(const char *path, const device &device, const k4a_device_configuration_t &device_configuration)
record & operator=(record &&other) noexcept
record(k4a_record_t handle=nullptr) noexcept
void add_custom_video_track(const char *track_name, const char *codec_id, const uint8_t *codec_context, size_t codec_context_size, const k4a_record_video_settings_t *track_settings)
void add_tag(const char *name, const char *value)
void write_capture(const capture &capture)
#define K4A_FAILED(_result_)