diff --git a/src/video_capture/aja.cpp b/src/video_capture/aja.cpp index e5be0011c..bd836897f 100644 --- a/src/video_capture/aja.cpp +++ b/src/video_capture/aja.cpp @@ -127,13 +127,16 @@ volatile bool *aja_should_exit = &should_exit; using namespace std; -struct aligned_data_allocator { - void *allocate(size_t size) { +struct aligned_data_allocator : public video_frame_pool_allocator { + void *allocate(size_t size) override { return aligned_malloc(size, AJA_PAGE_SIZE); } - void deallocate(void *ptr) { + void deallocate(void *ptr) override { aligned_free(ptr); } + video_frame_pool_allocator *clone() const override { + return new aligned_data_allocator(*this); + } }; static const ULWord app = AJA_FOURCC ('U','L','G','R'); @@ -161,7 +164,7 @@ class vidcap_state_aja { uint32_t mVideoBufferSize{}; /// My video buffer size, in bytes uint32_t mAudioBufferSize{}; /// My audio buffer size, in bytes thread mProducerThread; /// My producer thread object -- does the frame capturing - video_frame_pool mPool; + video_frame_pool mPool{0, aligned_data_allocator()}; shared_ptr mOutputFrame; shared_ptr mOutputAudioFrame; size_t mOutputAudioFrameSize{};