#include "decklink_consumer.h"
#include "../util/util.h"
+#include "../util/decklink_allocator.h"
#include "../interop/DeckLinkAPI_h.h"
const int channel_index_;
const configuration config_;
+ std::unique_ptr<thread_safe_decklink_allocator> allocator_;
CComPtr<IDeckLink> decklink_;
CComQIPtr<IDeckLinkOutput> output_;
CComQIPtr<IDeckLinkKeyer> keyer_;
void enable_video(BMDDisplayMode display_mode)
{
+ if (config_.custom_allocator)
+ {
+ allocator_.reset(new thread_safe_decklink_allocator(print()));
+
+ if (FAILED(output_->SetVideoOutputFrameMemoryAllocator(allocator_.get())))
+ BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not set custom memory allocator."));
+
+ CASPAR_LOG(info) << print() << L" Using custom allocator.";
+ }
+
if(FAILED(output_->EnableVideoOutput(display_mode, bmdVideoOutputFlagDefault)))
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not enable video output."));
}