source_group(sources\\consumer consumer/*)
source_group(sources\\interop interop/*)
source_group(sources\\producer producer/*)
+source_group(sources\\util util/*)
if (MSVC)
target_link_libraries(decklink
tbb::concurrent_bounded_queue<core::const_frame> audio_frame_buffer_;
spl::shared_ptr<diagnostics::graph> graph_;
- tbb::atomic<int64_t> current_presentation_delay_;
caspar::timer tick_timer_;
retry_task<bool> send_completion_;
+ reference_signal_detector reference_signal_detector_ { output_ };
+ tbb::atomic<int64_t> current_presentation_delay_;
tbb::atomic<int64_t> scheduled_frames_completed_;
std::unique_ptr<key_video_context> key_context_;
graph_->set_value("tick-time", tick_timer_.elapsed()*format_desc_.fps*0.5);
tick_timer_.restart();
+
+ reference_signal_detector_.detect_change([this]() { return print(); });
}
std::future<bool> send(core::const_frame frame)
return u16(pModelName);
}
+class reference_signal_detector
+{
+ com_iface_ptr<IDeckLinkOutput> output_;
+ BMDReferenceStatus last_reference_status_ = static_cast<BMDReferenceStatus>(-1);
+public:
+ reference_signal_detector(const com_iface_ptr<IDeckLinkOutput>& output)
+ : output_(output)
+ {
+ }
+
+ template<typename Print>
+ void detect_change(const Print& print)
+ {
+ BMDReferenceStatus reference_status;
+
+ if (output_->GetReferenceStatus(&reference_status) != S_OK)
+ {
+ CASPAR_LOG(error) << print() << L" Reference signal: failed while querying status";
+ }
+ else if (reference_status != last_reference_status_)
+ {
+ last_reference_status_ = reference_status;
+
+ if (reference_status == 0)
+ CASPAR_LOG(info) << print() << L" Reference signal: not detected.";
+ else if (reference_status & bmdReferenceNotSupportedByHardware)
+ CASPAR_LOG(info) << print() << L" Reference signal: not supported by hardware.";
+ else if (reference_status & bmdReferenceLocked)
+ CASPAR_LOG(info) << print() << L" Reference signal: locked.";
+ else
+ CASPAR_LOG(info) << print() << L" Reference signal: Unhandled enum bitfield: " << reference_status;
+ }
+ }
+};
+
}}