X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.hpp;h=f2f8c7c8e26549be7e6ba8a5e5977c3faf6b10f2;hp=f0b4c1624b88d29a249c011e38e8f063651f2744;hb=48257a69ffad409c9893605d99cd6e15161dff4f;hpb=ffe001198ecb5ea2e44c2947868c258afe948f20 diff --git a/pv/session.hpp b/pv/session.hpp index f0b4c162..f2f8c7c8 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -31,15 +31,17 @@ #include #ifdef _WIN32 -// Windows: Avoid namespace pollution by thread.hpp (which includes windows.h). +// Windows: Avoid boost/thread namespace pollution (which includes windows.h). #define NOGDI #define NORESOURCE #endif -#include +#include #include #include +#include "util.hpp" + struct srd_decoder; struct srd_channel; @@ -114,9 +116,9 @@ public: std::set< std::shared_ptr > get_data() const; - boost::shared_mutex& signals_mutex() const; + double get_samplerate() const; - const std::unordered_set< std::shared_ptr >& + const std::unordered_set< std::shared_ptr > signals() const; #ifdef ENABLE_DECODE @@ -136,8 +138,6 @@ private: std::shared_ptr signal_from_channel( std::shared_ptr channel) const; - void read_sample_rate(std::shared_ptr device); - private: void sample_thread_proc(std::shared_ptr device, std::function error_handler); @@ -146,6 +146,8 @@ private: void feed_in_meta(std::shared_ptr meta); + void feed_in_trigger(); + void feed_in_frame_begin(); void feed_in_logic(std::shared_ptr logic); @@ -167,7 +169,7 @@ private: mutable boost::shared_mutex signals_mutex_; std::unordered_set< std::shared_ptr > signals_; - mutable std::mutex data_mutex_; + mutable std::recursive_mutex data_mutex_; std::shared_ptr logic_data_; uint64_t cur_samplerate_; std::shared_ptr cur_logic_segment_; @@ -176,12 +178,16 @@ private: std::thread sampling_thread_; + bool out_of_memory_; + Q_SIGNALS: void capture_state_changed(int state); void device_selected(); void signals_changed(); + void trigger_event(util::Timestamp location); + void frame_began(); void data_received();