pull/3122/head
Isaac Connor 2017-11-28 11:55:47 -05:00
parent d73f9e8a73
commit 344539f5dc
3 changed files with 12 additions and 6 deletions

View File

@ -779,7 +779,14 @@ unsigned int Monitor::GetLastWriteIndex() const {
return( shared_data->last_write_index!=(unsigned int)image_buffer_count?shared_data->last_write_index:-1 ); return( shared_data->last_write_index!=(unsigned int)image_buffer_count?shared_data->last_write_index:-1 );
} }
unsigned int Monitor::GetLastEvent() const { uint32_t Monitor::GetLastEventId() const {
Debug(2, "mem_ptr(%x), State(%d) last_read_index(%d) last_read_time(%d) last_event(%d)",
mem_ptr,
shared_data->state,
shared_data->last_read_index,
shared_data->last_read_time,
shared_data->last_event
);
return( shared_data->last_event ); return( shared_data->last_event );
} }

View File

@ -432,7 +432,6 @@ public:
int GetOptSaveJPEGs() const { return( savejpegspref ); } int GetOptSaveJPEGs() const { return( savejpegspref ); }
VideoWriter GetOptVideoWriter() const { return( videowriter ); } VideoWriter GetOptVideoWriter() const { return( videowriter ); }
const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); } const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); }
uint32_t GetLastEventId() const { return shared_data->last_event; }
uint32_t GetVideoWriterEventId() const { return video_store_data->current_event; } uint32_t GetVideoWriterEventId() const { return video_store_data->current_event; }
void SetVideoWriterEventId( uint32_t p_event_id ) { video_store_data->current_event = p_event_id; } void SetVideoWriterEventId( uint32_t p_event_id ) { video_store_data->current_event = p_event_id; }
@ -448,7 +447,7 @@ public:
int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); } int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); }
unsigned int GetLastReadIndex() const; unsigned int GetLastReadIndex() const;
unsigned int GetLastWriteIndex() const; unsigned int GetLastWriteIndex() const;
unsigned int GetLastEvent() const; uint32_t GetLastEventId() const;
double GetFPS() const; double GetFPS() const;
void ForceAlarmOn( int force_score, const char *force_case, const char *force_text="" ); void ForceAlarmOn( int force_score, const char *force_case, const char *force_text="" );
void ForceAlarmOff(); void ForceAlarmOff();

View File

@ -514,10 +514,10 @@ int main( int argc, char *argv[] ) {
} }
if ( function & ZMU_EVENT ) { if ( function & ZMU_EVENT ) {
if ( verbose ) if ( verbose )
printf( "Last event id: %d\n", monitor->GetLastEvent() ); printf( "Last event id: %d\n", monitor->GetLastEventId() );
else { else {
if ( have_output ) printf( "%c", separator ); if ( have_output ) printf( "%c", separator );
printf( "%d", monitor->GetLastEvent() ); printf( "%d", monitor->GetLastEventId() );
have_output = true; have_output = true;
} }
} }
@ -712,7 +712,7 @@ int main( int argc, char *argv[] ) {
tv.tv_sec, tv.tv_usec/10000, tv.tv_sec, tv.tv_usec/10000,
monitor->GetLastReadIndex(), monitor->GetLastReadIndex(),
monitor->GetLastWriteIndex(), monitor->GetLastWriteIndex(),
monitor->GetLastEvent(), monitor->GetLastEventId(),
monitor->GetFPS() monitor->GetFPS()
); );
delete monitor; delete monitor;