Merge branch 'master' into storageareas

This commit is contained in:
Isaac Connor 2019-03-28 11:20:29 -04:00
commit 90e97ff135
5 changed files with 167 additions and 165 deletions

View File

@ -766,7 +766,7 @@ FROM Frames WHERE EventId=?';
$res = $selectUnclosedEventsSth->execute() $res = $selectUnclosedEventsSth->execute()
or Fatal( "Can't execute: ".$selectUnclosedEventsSth->errstr() ); or Fatal( "Can't execute: ".$selectUnclosedEventsSth->errstr() );
while( my $event = $selectUnclosedEventsSth->fetchrow_hashref() ) { while( my $event = $selectUnclosedEventsSth->fetchrow_hashref() ) {
aud_print( "Found open event '$event->{Id}' at $$event{StartTime}" ); aud_print( "Found open event '$event->{Id}' on Monitor $event->{MonitorId} at $$event{StartTime}" );
if ( confirm( 'close', 'closing' ) ) { if ( confirm( 'close', 'closing' ) ) {
if ( ! ( $res = $selectFrameDataSth->execute($event->{Id}) ) ) { if ( ! ( $res = $selectFrameDataSth->execute($event->{Id}) ) ) {
Error( "Can't execute: $selectFrameDataSql:".$selectFrameDataSth->errstr() ); Error( "Can't execute: $selectFrameDataSql:".$selectFrameDataSth->errstr() );
@ -792,13 +792,13 @@ FROM Frames WHERE EventId=?';
$frame->{MaxScore}, $frame->{MaxScore},
RECOVER_TEXT, RECOVER_TEXT,
$event->{Id} $event->{Id}
) or Error( "Can't execute: ".$updateUnclosedEventsSth->errstr() ); ) or Error( 'Can\'t execute: '.$updateUnclosedEventsSth->errstr() );
} else { } else {
Error('SHOULD DELETE'); Error('SHOULD DELETE');
} # end if has frame data } # end if has frame data
} }
} # end while unclosed event } # end while unclosed event
Debug("Done closing open events."); Debug('Done closing open events.');
# Now delete any old image files # Now delete any old image files
if ( my @old_files = grep { -M > $max_image_age } <$image_path/*.{jpg,gif,wbmp}> ) { if ( my @old_files = grep { -M > $max_image_age } <$image_path/*.{jpg,gif,wbmp}> ) {

View File

@ -114,8 +114,7 @@ VideoStore::VideoStore(
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
//video_out_stream->codec = avcodec_alloc_context3(video_out_codec); //video_out_stream->codec = avcodec_alloc_context3(video_out_codec);
// Since we are not re-encoding, all we have to do is copy the parameters // Since we are not re-encoding, all we have to do is copy the parameters
video_out_ctx = video_out_stream->codec; video_out_ctx = avcodec_alloc_context3(video_out_codec);
//video_out_ctx = avcodec_alloc_context3(video_out_codec);
// Copy params from instream to ctx // Copy params from instream to ctx
ret = avcodec_parameters_to_context(video_out_ctx, video_in_stream->codecpar); ret = avcodec_parameters_to_context(video_out_ctx, video_in_stream->codecpar);
if ( ret < 0 ) { if ( ret < 0 ) {
@ -125,6 +124,7 @@ VideoStore::VideoStore(
zm_dump_codec(video_out_ctx); zm_dump_codec(video_out_ctx);
} }
#else #else
video_out_ctx = video_out_stream->codec;
ret = avcodec_copy_context(video_out_ctx, video_in_ctx); ret = avcodec_copy_context(video_out_ctx, video_in_ctx);
if ( ret < 0 ) { if ( ret < 0 ) {
Fatal("Unable to copy in video ctx to out video ctx %s", Fatal("Unable to copy in video ctx to out video ctx %s",

View File

@ -10,10 +10,10 @@
// a bug in ActiveXObject prevents us from properly testing for it. // a bug in ActiveXObject prevents us from properly testing for it.
CsrfMagic = function(real) { CsrfMagic = function(real) {
// try to make it ourselves, if you didn't pass it // try to make it ourselves, if you didn't pass it
if (!real) try { real = new XMLHttpRequest; } catch (e) {;} if (!real) try {real = new XMLHttpRequest;} catch (e) {;}
if (!real) try { real = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {;} if (!real) try {real = new ActiveXObject('Msxml2.XMLHTTP');} catch (e) {;}
if (!real) try { real = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {;} if (!real) try {real = new ActiveXObject('Microsoft.XMLHTTP');} catch (e) {;}
if (!real) try { real = new ActiveXObject('Msxml2.XMLHTTP.4.0'); } catch (e) {;} if (!real) try {real = new ActiveXObject('Msxml2.XMLHTTP.4.0');} catch (e) {;}
this.csrf = real; this.csrf = real;
// properties // properties
var csrfMagic = this; var csrfMagic = this;
@ -22,7 +22,7 @@ CsrfMagic = function(real) {
return csrfMagic.onreadystatechange ? csrfMagic.onreadystatechange() : null; return csrfMagic.onreadystatechange ? csrfMagic.onreadystatechange() : null;
}; };
csrfMagic._updateProps(); csrfMagic._updateProps();
} };
CsrfMagic.prototype = { CsrfMagic.prototype = {
@ -74,7 +74,7 @@ CsrfMagic.prototype = {
getResponseHeader: function(header) { getResponseHeader: function(header) {
return this.csrf.getResponseHeader(header); return this.csrf.getResponseHeader(header);
} // , } // ,
} };
// proprietary // proprietary
CsrfMagic.prototype._updateProps = function() { CsrfMagic.prototype._updateProps = function() {
@ -85,16 +85,18 @@ CsrfMagic.prototype._updateProps = function() {
this.status = this.csrf.status; this.status = this.csrf.status;
this.statusText = this.csrf.statusText; this.statusText = this.csrf.statusText;
} }
} };
CsrfMagic.process = function(base) { CsrfMagic.process = function(base) {
if(typeof base == 'object') { if ( typeof base == 'object' ) {
base[csrfMagicName] = csrfMagicToken; base[csrfMagicName] = csrfMagicToken;
return base; return base;
} }
var prepend = csrfMagicName + '=' + csrfMagicToken; var prepend = csrfMagicName + '=' + csrfMagicToken;
if (base) return prepend + '&' + base; if ( base ) return prepend + '&' + base;
return prepend; return prepend;
} };
// callback function for when everything on the page has loaded // callback function for when everything on the page has loaded
CsrfMagic.end = function() { CsrfMagic.end = function() {
// This rewrites forms AGAIN, so in case buffering didn't work this // This rewrites forms AGAIN, so in case buffering didn't work this
@ -110,12 +112,12 @@ CsrfMagic.end = function() {
input.setAttribute('type', 'hidden'); input.setAttribute('type', 'hidden');
form.appendChild(input); form.appendChild(input);
} }
} };
// Sets things up for Mozilla/Opera/nice browsers // Sets things up for Mozilla/Opera/nice browsers
// We very specifically match against Internet Explorer, since they haven't // We very specifically match against Internet Explorer, since they haven't
// implemented prototypes correctly yet. // implemented prototypes correctly yet.
if (window.XMLHttpRequest && window.XMLHttpRequest.prototype && '\v' != 'v') { if ( window.XMLHttpRequest && window.XMLHttpRequest.prototype && '\v' != 'v' ) {
var x = XMLHttpRequest.prototype; var x = XMLHttpRequest.prototype;
var c = CsrfMagic.prototype; var c = CsrfMagic.prototype;
@ -133,7 +135,7 @@ if (window.XMLHttpRequest && window.XMLHttpRequest.prototype && '\v' != 'v') {
// The only way we can do this is by modifying a library you have been // The only way we can do this is by modifying a library you have been
// using. We support YUI, script.aculo.us, prototype, MooTools, // using. We support YUI, script.aculo.us, prototype, MooTools,
// jQuery, Ext and Dojo. // jQuery, Ext and Dojo.
if (window.jQuery) { if ( window.jQuery ) {
// jQuery didn't implement a new XMLHttpRequest function, so we have // jQuery didn't implement a new XMLHttpRequest function, so we have
// to do this the hard way. // to do this the hard way.
jQuery.csrf_ajax = jQuery.ajax; jQuery.csrf_ajax = jQuery.ajax;
@ -145,47 +147,47 @@ if (window.XMLHttpRequest && window.XMLHttpRequest.prototype && '\v' != 'v') {
} }
s.data = CsrfMagic.process(s.data); s.data = CsrfMagic.process(s.data);
} }
return jQuery.csrf_ajax( s ); return jQuery.csrf_ajax(s);
};
} }
} if ( window.Prototype ) {
if (window.Prototype) {
// This works for script.aculo.us too // This works for script.aculo.us too
Ajax.csrf_getTransport = Ajax.getTransport; Ajax.csrf_getTransport = Ajax.getTransport;
Ajax.getTransport = function() { Ajax.getTransport = function() {
return new CsrfMagic(Ajax.csrf_getTransport()); return new CsrfMagic(Ajax.csrf_getTransport());
};
} }
} if ( window.MooTools ) {
if (window.MooTools) {
Browser.csrf_Request = Browser.Request; Browser.csrf_Request = Browser.Request;
Browser.Request = function () { Browser.Request = function() {
return new CsrfMagic(Browser.csrf_Request()); return new CsrfMagic(Browser.csrf_Request());
};
} }
} if ( window.YAHOO ) {
if (window.YAHOO) {
// old YUI API // old YUI API
YAHOO.util.Connect.csrf_createXhrObject = YAHOO.util.Connect.createXhrObject; YAHOO.util.Connect.csrf_createXhrObject = YAHOO.util.Connect.createXhrObject;
YAHOO.util.Connect.createXhrObject = function (transaction) { YAHOO.util.Connect.createXhrObject = function(transaction) {
obj = YAHOO.util.Connect.csrf_createXhrObject(transaction); obj = YAHOO.util.Connect.csrf_createXhrObject(transaction);
obj.conn = new CsrfMagic(obj.conn); obj.conn = new CsrfMagic(obj.conn);
return obj; return obj;
};
} }
} if ( window.Ext ) {
if (window.Ext) {
// Ext can use other js libraries as loaders, so it has to come last // Ext can use other js libraries as loaders, so it has to come last
// Ext's implementation is pretty identical to Yahoo's, but we duplicate // Ext's implementation is pretty identical to Yahoo's, but we duplicate
// it for comprehensiveness's sake. // it for comprehensiveness's sake.
Ext.lib.Ajax.csrf_createXhrObject = Ext.lib.Ajax.createXhrObject; Ext.lib.Ajax.csrf_createXhrObject = Ext.lib.Ajax.createXhrObject;
Ext.lib.Ajax.createXhrObject = function (transaction) { Ext.lib.Ajax.createXhrObject = function(transaction) {
obj = Ext.lib.Ajax.csrf_createXhrObject(transaction); obj = Ext.lib.Ajax.csrf_createXhrObject(transaction);
obj.conn = new CsrfMagic(obj.conn); obj.conn = new CsrfMagic(obj.conn);
return obj; return obj;
};
} }
} if ( window.dojo ) {
if (window.dojo) {
// NOTE: this doesn't work with latest dojo // NOTE: this doesn't work with latest dojo
dojo.csrf__xhrObj = dojo._xhrObj; dojo.csrf__xhrObj = dojo._xhrObj;
dojo._xhrObj = function () { dojo._xhrObj = function() {
return new CsrfMagic(dojo.csrf__xhrObj()); return new CsrfMagic(dojo.csrf__xhrObj());
};
} }
} };
}

View File

@ -27,7 +27,7 @@ function Monitor(monitorData) {
this.eventHandler = function( event ) { this.eventHandler = function( event ) {
console.log(event); console.log(event);
} };
this.onclick = function(evt) { this.onclick = function(evt) {
var el = evt.currentTarget; var el = evt.currentTarget;