From 533b370a81bc19c3d0876c6299dbc967eaed139a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 8 Dec 2017 10:39:57 -0500 Subject: [PATCH] add a mutex to the packetqueue --- src/zm_packetqueue.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zm_packetqueue.h b/src/zm_packetqueue.h index a3a4a5ee0..de333e36d 100644 --- a/src/zm_packetqueue.h +++ b/src/zm_packetqueue.h @@ -25,6 +25,7 @@ //#include #include #include "zm_packet.h" +#include "zm_thread.h" extern "C" { #include @@ -37,11 +38,15 @@ class zm_packetqueue { int video_stream_id; int video_packet_count; // keep track of how many video packets we have, because we shouldn't have more than image_buffer_count + int first_video_packet_index; int max_video_packet_count; // allow a negative value to someday mean unlimited + Mutex mutex; + public: zm_packetqueue( int p_max_video_packet_count, int p_video_stream_id ); virtual ~zm_packetqueue(); + bool queuePacket( ZMPacket* packet ); ZMPacket * popPacket( ); unsigned int clearQueue( unsigned int video_frames_to_keep, int stream_id );