Merge branch 'zma_to_thread' of github.com:/ConnorTechnology/ZoneMinder into zma_to_thread

This commit is contained in:
Isaac Connor 2017-12-15 10:47:53 -05:00
commit 49214a8902
3 changed files with 6 additions and 11 deletions

View File

@ -1413,13 +1413,9 @@ bool Monitor::Analyse() {
if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) { if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) {
Info( "%s: %03d - Gone into alarm state", name, analysis_image_count ); Info( "%s: %03d - Gone into alarm state", name, analysis_image_count );
shared_data->state = state = ALARM; shared_data->state = state = ALARM;
if ( (function != MOCORD && state != ALERT) ) { if ( ! event ) {
if ( event ) {
Error("Already ahve evnet!");
} else {
event = new Event( this, *timestamp, cause, noteSetMap ); event = new Event( this, *timestamp, cause, noteSetMap );
shared_data->last_event_id = event->Id(); shared_data->last_event_id = event->Id();
}
} }
} else if ( state != PREALARM ) { } else if ( state != PREALARM ) {
Info( "%s: %03d - Gone into prealarm state", name, analysis_image_count ); Info( "%s: %03d - Gone into prealarm state", name, analysis_image_count );
@ -3259,7 +3255,7 @@ void Monitor::get_ref_image() {
( shared_data->last_write_time == 0 ) ( shared_data->last_write_time == 0 )
&& ! zm_terminate && ! zm_terminate
) { ) {
Warning( "Waiting for capture daemon" ); Warning( "Waiting for capture daemon lwi(%d) lwt(%d)", shared_data->last_write_index, shared_data->last_write_time );
usleep( 50000 ); usleep( 50000 );
} }
int last_write_index = shared_data->last_write_index ; int last_write_index = shared_data->last_write_index ;

View File

@ -348,7 +348,6 @@ Debug(2,"Using mjpeg");
zm_dump_codecpar(video_out_stream->codecpar); zm_dump_codecpar(video_out_stream->codecpar);
#else #else
avcodec_copy_context(video_out_stream->codec, video_out_ctx); avcodec_copy_context(video_out_stream->codec, video_out_ctx);
Debug(2, "%dx%d", video_out_stream->codec->width, video_out_stream->codec->height );
zm_dump_codec(video_out_stream->codec); zm_dump_codec(video_out_stream->codec);
#endif #endif
@ -563,10 +562,9 @@ VideoStore::~VideoStore() {
break; break;
} }
#endif #endif
int keyframe = pkt.flags & AV_PKT_FLAG_KEY; dumpPacket(&pkt);
Debug(3, "dts:%I64d, pts:%I64d, keyframe:%d", pkt.dts, pkt.pts, keyframe );
//pkt.dts = video_next_dts; //pkt.dts = video_next_dts;
pkt.pts = pkt.dts; //pkt.pts = pkt.dts;
//pkt.duration = video_last_duration; //pkt.duration = video_last_duration;
write_video_packet(pkt); write_video_packet(pkt);
zm_av_packet_unref(&pkt); zm_av_packet_unref(&pkt);

View File

@ -254,7 +254,7 @@ int main(int argc, char *argv[]) {
last_capture_times[i].tv_sec = last_capture_times[i].tv_usec = 0; last_capture_times[i].tv_sec = last_capture_times[i].tv_usec = 0;
capture_delays[i] = monitors[i]->GetCaptureDelay(); capture_delays[i] = monitors[i]->GetCaptureDelay();
alarm_capture_delays[i] = monitors[i]->GetAlarmCaptureDelay(); alarm_capture_delays[i] = monitors[i]->GetAlarmCaptureDelay();
Debug(2, "capture delay(%u) alarm delay(%u)", capture_delays[i], alarm_capture_delays[i] ); Debug(2, "capture delay(%u mSecs 1000/capture_fps) alarm delay(%u)", capture_delays[i], alarm_capture_delays[i] );
Monitor::Function function = monitors[0]->GetFunction(); Monitor::Function function = monitors[0]->GetFunction();
if ( function == Monitor::MODECT || function == Monitor::MOCORD || function == Monitor::RECORD) { if ( function == Monitor::MODECT || function == Monitor::MOCORD || function == Monitor::RECORD) {
@ -278,6 +278,7 @@ int main(int argc, char *argv[]) {
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
for ( int j = 0; j < n_monitors; j++ ) { for ( int j = 0; j < n_monitors; j++ ) {
if ( last_capture_times[j].tv_sec ) { if ( last_capture_times[j].tv_sec ) {
// We pretty much know this is positive.
DELTA_TIMEVAL(delta_time, now, last_capture_times[j], DT_PREC_3); DELTA_TIMEVAL(delta_time, now, last_capture_times[j], DT_PREC_3);
// capture_delay is the amount of time we should sleep to achieve the desired framerate. // capture_delay is the amount of time we should sleep to achieve the desired framerate.
if ( monitors[i]->GetState() == Monitor::ALARM ) if ( monitors[i]->GetState() == Monitor::ALARM )