a/tracking: Change destructor to be private

This commit is contained in:
Jakob Bornecrantz 2023-11-27 19:48:46 +00:00
parent e9d8e0db21
commit 8c1ee42fee
2 changed files with 13 additions and 13 deletions

View file

@ -21,13 +21,6 @@ namespace xrt::auxiliary::tracking {
*
*/
extern "C" void
frame_mat_destroy(struct xrt_frame *xf)
{
FrameMat *fm = (FrameMat *)xf;
delete fm;
}
/*
*
@ -48,7 +41,7 @@ FrameMat::fillInFields(cv::Mat mat, xrt_format format, const Params &params)
// Main wrapping of cv::Mat by frame.
xrt_frame &frame = this->frame;
frame.reference.count = 1;
frame.destroy = frame_mat_destroy;
frame.destroy = destroyFrame;
frame.data = mat.ptr<uint8_t>();
frame.format = format;
frame.width = width;
@ -71,6 +64,13 @@ FrameMat::FrameMat()
// Noop
}
void
FrameMat::destroyFrame(xrt_frame *xf)
{
FrameMat *fm = (FrameMat *)xf;
delete fm;
}
/*
*

View file

@ -39,11 +39,6 @@ public:
public: // Methods
/*!
* Only public due to C needed to destroy it.
*/
~FrameMat();
/*!
* Wraps the given cv::Mat assuming it's a 24bit RGB format matrix.
* In all but the most strange cases you probably want the pointer
@ -64,10 +59,15 @@ public: // Methods
private:
~FrameMat();
FrameMat();
void
fillInFields(cv::Mat mat, xrt_format format, const Params &params);
//! C callback used when the reference of the frames reaches zero.
static void
destroyFrame(xrt_frame *frame);
};