libfreenect2 0.4
Open source driver for the Kinect for Windows v2 (K4W2) sensor
Loading...
Searching...
No Matches
RecordingWriter Class Reference

Bounded, thread-safe writer for raw Kinect recording directories. More...

#include <libfreenect2/recording.h>

Inheritance diagram for RecordingWriter:
FrameListener

Classes

struct  Stats

Public Member Functions

 RecordingWriter (const std::string &directory, size_t queue_capacity=32)
 Create the recording directory tree and start the writer thread.
virtual ~RecordingWriter ()
virtual bool onNewFrame (Frame::Type type, Frame *frame)
 Copy a raw frame into the bounded writer queue.
bool setCalibration (const std::string &serial, const std::string &firmware, const CalibrationData &calibration)
 Publish the calibration required to decode raw depth frames.
bool setCalibrationProfile (const CalibrationProfile &profile, bool allow_serial_mismatch=false)
 Attach a validated user calibration under calibration/profile.json.
bool close ()
 Flush queued frames and close the recording.
bool isOpen () const
std::string getLastError () const
Stats getStats () const
Public Member Functions inherited from FrameListener
virtual ~FrameListener ()

Detailed Description

Bounded, thread-safe writer for raw Kinect recording directories.

Constructor & Destructor Documentation

◆ RecordingWriter()

RecordingWriter ( const std::string & directory,
size_t queue_capacity = 32 )
explicit

Create the recording directory tree and start the writer thread.

Ordinary setup failures leave the writer closed and are reported through getLastError(). Check isOpen() immediately after construction before registering the writer as a frame listener.

Referenced by getStats().

◆ ~RecordingWriter()

virtual ~RecordingWriter ( )
virtual

Member Function Documentation

◆ onNewFrame()

virtual bool onNewFrame ( Frame::Type type,
Frame * frame )
virtual

Copy a raw frame into the bounded writer queue.

Always returns false because the writer copies the bytes and never assumes ownership of the caller's frame, including when the copy is accepted.

Implements FrameListener.

◆ setCalibration()

bool setCalibration ( const std::string & serial,
const std::string & firmware,
const CalibrationData & calibration )

Publish the calibration required to decode raw depth frames.

◆ setCalibrationProfile()

bool setCalibrationProfile ( const CalibrationProfile & profile,
bool allow_serial_mismatch = false )

Attach a validated user calibration under calibration/profile.json.

Factory calibration must be set first. Serial mismatches are rejected unless explicitly allowed.

◆ close()

bool close ( )

Flush queued frames and close the recording.

Idempotent.

◆ isOpen()

bool isOpen ( ) const

◆ getLastError()

std::string getLastError ( ) const

◆ getStats()

Stats getStats ( ) const

References RecordingWriter().