Merge branch 'smarter_packetqueue' into storageareas
This commit is contained in:
commit
5fce783b65
|
@ -869,6 +869,10 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event
|
|||
if ( packet.stream_index == mVideoStreamId ) {
|
||||
if ( keyframe ) {
|
||||
Debug(3, "Clearing queue");
|
||||
if ( packetqueue->packet_count(mVideoStreamId) >= monitor->GetImageBufferCount() ) {
|
||||
Warning("ImageBufferCount is too small. Either increase it or decrease time between keyframes");
|
||||
}
|
||||
|
||||
packetqueue->clearQueue(monitor->GetPreEventCount(), mVideoStreamId);
|
||||
packetqueue->queuePacket(&packet);
|
||||
} else if ( packetqueue->size() ) {
|
||||
|
|
|
@ -456,6 +456,7 @@ public:
|
|||
void SetVideoWriterEventId( unsigned long long p_event_id ) { video_store_data->current_event = p_event_id; }
|
||||
|
||||
unsigned int GetPreEventCount() const { return pre_event_count; };
|
||||
int GetImageBufferCount() const { return image_buffer_count; };
|
||||
State GetState() const;
|
||||
int GetImage( int index=-1, int scale=100 );
|
||||
Snapshot *getSnapshot() const;
|
||||
|
|
|
@ -25,7 +25,7 @@ zm_packetqueue::zm_packetqueue( int p_max_stream_id ) {
|
|||
max_stream_id = p_max_stream_id;
|
||||
packet_counts = new int[max_stream_id+1];
|
||||
for ( int i=0; i <= max_stream_id; ++i )
|
||||
packet_counts = 0;
|
||||
packet_counts[i] = 0;
|
||||
}
|
||||
|
||||
zm_packetqueue::~zm_packetqueue() {
|
||||
|
|
Loading…
Reference in New Issue