mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-16 04:51:42 -04:00
Keep track of max_keyframe_interval and log it when complaining
This commit is contained in:
@@ -34,7 +34,8 @@ PacketQueue::PacketQueue():
|
||||
deleting(false),
|
||||
keep_keyframes(false),
|
||||
warned_count(0),
|
||||
has_out_of_order_packets_(false)
|
||||
has_out_of_order_packets_(false),
|
||||
max_keyframe_interval_(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -134,8 +135,8 @@ bool PacketQueue::queuePacket(std::shared_ptr<ZMPacket> add_packet) {
|
||||
warned_count++;
|
||||
Warning("You have set the max video packets in the queue to %u."
|
||||
" The queue is full. Either Analysis is not keeping up or"
|
||||
" your camera's keyframe interval is larger than this setting."
|
||||
, max_video_packet_count);
|
||||
" your camera's keyframe interval %d is larger than this setting."
|
||||
, max_video_packet_count, max_keyframe_interval_);
|
||||
}
|
||||
|
||||
for (
|
||||
@@ -318,8 +319,9 @@ void PacketQueue::clearPackets(const std::shared_ptr<ZMPacket> &add_packet) {
|
||||
if (zm_packet->packet->stream_index == video_stream_id) {
|
||||
keyframe_interval_count++;
|
||||
if (zm_packet->keyframe) {
|
||||
Debug(4, "Have a video keyframe so setting next front to it. Keyframe interval so far is %d", keyframe_interval_count);
|
||||
|
||||
Debug(3, "Have a video keyframe so setting next front to it. Keyframe interval so far is %d", keyframe_interval_count);
|
||||
if (keyframe_interval_count > max_keyframe_interval_)
|
||||
max_keyframe_interval_ = keyframe_interval_count;
|
||||
keyframe_interval_count = 1;
|
||||
next_front = it;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class PacketQueue {
|
||||
std::condition_variable condition;
|
||||
int warned_count;
|
||||
bool has_out_of_order_packets_;
|
||||
int max_keyframe_interval_;
|
||||
|
||||
public:
|
||||
PacketQueue();
|
||||
@@ -67,6 +68,7 @@ class PacketQueue {
|
||||
unsigned int size();
|
||||
unsigned int get_packet_count(int stream_id) const { return packet_counts[stream_id]; };
|
||||
bool has_out_of_order_packets() const { return has_out_of_order_packets_; };
|
||||
int get_max_keyframe_interval() const { return max_keyframe_interval_; };
|
||||
|
||||
void clearPackets(const std::shared_ptr<ZMPacket> &packet);
|
||||
int packet_count(int stream_id);
|
||||
|
||||
Reference in New Issue
Block a user