const configuration config_;
com_ptr<IDeckLink> decklink_ = get_device(config_.key_device_index());
com_iface_ptr<IDeckLinkOutput> output_ = iface_cast<IDeckLinkOutput>(decklink_);
- com_iface_ptr<IDeckLinkKeyer> keyer_ = iface_cast<IDeckLinkKeyer>(decklink_);
+ com_iface_ptr<IDeckLinkKeyer> keyer_ = iface_cast<IDeckLinkKeyer>(decklink_, true);
com_iface_ptr<IDeckLinkAttributes> attributes_ = iface_cast<IDeckLinkAttributes>(decklink_);
com_iface_ptr<Configuration> configuration_ = iface_cast<Configuration>(decklink_);
tbb::atomic<int64_t> current_presentation_delay_;
com_ptr<IDeckLink> decklink_ = get_device(config_.device_index);
com_iface_ptr<IDeckLinkOutput> output_ = iface_cast<IDeckLinkOutput>(decklink_);
com_iface_ptr<Configuration> configuration_ = iface_cast<Configuration>(decklink_);
- com_iface_ptr<IDeckLinkKeyer> keyer_ = iface_cast<IDeckLinkKeyer>(decklink_);
+ com_iface_ptr<IDeckLinkKeyer> keyer_ = iface_cast<IDeckLinkKeyer>(decklink_, true);
com_iface_ptr<IDeckLinkAttributes> attributes_ = iface_cast<IDeckLinkAttributes>(decklink_);
tbb::spin_mutex exception_mutex_;
}
template<typename I, typename T>
-static com_iface_ptr<I> iface_cast(const com_ptr<T>& ptr)
+static com_iface_ptr<I> iface_cast(const com_ptr<T>& ptr, bool optional = false)
{
com_iface_ptr<I> result = ptr;
- if (!result)
+ if (!optional && !result)
CASPAR_THROW_EXCEPTION(not_supported() << msg_info(std::string("Could not cast from ") + typeid(T).name() + " to " + typeid(I).name() + ". This is probably due to old Decklink drivers."));
return result;
template<> REFIID iface_id<IDeckLinkInput>() { return IID_IDeckLinkInput; }
template<typename I, typename T>
-static com_iface_ptr<I> iface_cast(com_ptr<T> ptr)
+static com_iface_ptr<I> iface_cast(com_ptr<T> ptr, bool optional = false)
{
I* iface;
ptr->QueryInterface(iface_id<I>(), reinterpret_cast<void**>(&iface));